Opened 7 years ago

Closed 6 years ago

#4836 closed defect (fixed)

Red warnings show up in OMEdit when using --daeMode=new

Reported by: Francesco Casella Owned by: Willi Braun
Priority: high Milestone: 1.13.0
Component: Code Generation Version:
Keywords: Cc: Martin Sjölund, Adeel Asghar

Description

When compiling models with -daeMode=new, I get red lines in the compilation window about this issue:

ScalablePowerGrids.Tests.GridBusSimpleControl_N_1_M_1_16dae.c:2151:1: 
warning: 'optimize' attribute ignored [-Wattributes]
 static void (*functionDAERes_systems[3])(DATA *, threadData_t *threadData) = {
 ^

Please make sure this is fixed before the release.

Change History (6)

comment:1 by Willi Braun, 7 years ago

Cc: Martin Sjölund Adeel Asghar added
Status: newaccepted

Okay, I'm able to reproduce it in OMEdit, but not in a terminal.

warning: 'optnone' attribute only applies to functions and methods [-Wignored-attributes]
OMC_DISABLE_OPT
^
/usr/include/omc/c/openmodelica.h:183:40: note: expanded from macro 'OMC_DISABLE_OPT'
#define OMC_DISABLE_OPT __attribute__((optnone))

Although it's hard to debug, since OMEdit deletes the sources or I'm just unable to find them.
@adeas31 Does OMEdit delete all sources? Would it possible to suppress that somehow?

Also I'm unsure when and where this optimization attributes are added.
@sjoelund.se Can you enlighten me?

comment:2 by Martin Sjölund, 7 years ago

The attributes are added by Susan since compilation is too slow for example for large functions containing simple bindings. I cannot reproduce this in OMEdit or in a terminal.

You can re-compile the OMEdit-generated sources by running:

make -C /tmp/OpenModelica_userName/OMEdit/ModelName/ -f ModelName.makefile

in reply to:  1 comment:3 by Willi Braun, 7 years ago

Replying to wbraun:

Although it's hard to debug, since OMEdit deletes the sources or I'm just unable to find them.
@adeas31 Does OMEdit delete all sources? Would it possible to suppress that somehow?

Ah, I found the check box "Delete intermediate compilation files".

in reply to:  2 comment:4 by Willi Braun, 7 years ago

Replying to sjoelund.se:

The attributes are added by Susan since compilation is too slow for example for large functions containing simple bindings. I cannot reproduce this in OMEdit or in a terminal.

It depends on a model and is related to separated partitions. The relevant code looks like:

OMC_DISABLE_OPT
static void (*functionDAERes_systems[3])(DATA *, threadData_t *threadData) = {
  functionDAERes_system0,
  functionDAERes_system1,
  functionDAERes_system2
};

comment:5 by Martin Sjölund, 7 years ago

Ah, yes. If it's split you put the OMC_DISABLE_OPT on functionDAERes_system0, functionDAERes_system1, and functionDAERes_system2 and you can remove it for the array of function pointers.

comment:6 by Francesco Casella, 6 years ago

Resolution: fixed
Status: acceptedclosed

As of OMEdit v1.13.0-dev-253-g8f7c38ac OMC-v1.13.0-dev-1052-g5c466368f, there are no more red lines in the C code showing up.

Note: See TracTickets for help on using tickets.