Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

#3402 closed defect (fixed)

Fix GCC 5.x issues so that it can be used in Windows

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone: 1.11.0
Component: Build Environment Version: trunk
Keywords: Cc:

Description

There are some tests failing when using GCC 5.x:
https://test.openmodelica.org/hudson/job/OpenModelica_TEST_GCC_5/lastCompletedBuild/testReport/

These should be fixed before we update OMDev to msys2 which uses GCC 5.2.

Change History (17)

comment:1 by Adrian Pop, 9 years ago

Owner: changed from Martin Sjölund to Adrian Pop
Status: newaccepted

comment:2 by Adrian Pop, 9 years ago

Update: seems that if you compiled Matching.mo with -O1 it works fine.

Version 0, edited 9 years ago by Adrian Pop (next)

comment:3 by Adrian Pop, 9 years ago

So is one of these that needs to be disabled (or a combination) for Matching.mo:

-fthread-jumps -falign-functions  -falign-jumps -falign-loops 
-falign-labels -fcaller-saves -fcrossjumping -fcse-follow-jumps 
-fcse-skip-blocks -fdelete-null-pointer-checks 
-fdevirtualize -fdevirtualize-speculatively -fexpensive-optimizations 
-fgcse  -fgcse-lm -fhoist-adjacent-loads -finline-small-functions 
-findirect-inlining -fipa-cp -fipa-cp-alignment 
-fipa-sra -fipa-icf -fisolate-erroneous-paths-dereference 
-flra-remat -foptimize-sibling-calls -foptimize-strlen 
-fpartial-inlining -fpeephole2 -freorder-blocks -freorder-blocks-and-partition 
-freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec 
-fschedule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow 
-ftree-builtin-call-dce -ftree-switch-conversion -ftree-tail-merge 
-ftree-pre -ftree-vrp -fipa-ra

Anybody wants to hazard a guess? :)

comment:4 by Adrian Pop, 9 years ago

The diffs between GCC 4.9.3 and GCC 5.2.0 with regards to -O2 optimizations are:

  • .txt

    old new  
    1111-fhoist-adjacent-loads
    1212-finline-small-functions
    1313-findirect-inlining
     14-fipa-cp
     15-fipa-cp-alignment
    1416-fipa-sra
     17-fipa-icf
    1518-fisolate-erroneous-paths-dereference
     19-flra-remat
    1620-foptimize-sibling-calls
     21-foptimize-strlen
    1722-fpartial-inlining
    1823-fpeephole2
    1924-freorder-blocks  -freorder-functions
     25-freorder-blocks-and-partition
    2026-frerun-cse-after-loop 
    2127-fsched-interblock  -fsched-spec
    2228-fschedule-insns  -fschedule-insns2
    2329-fstrict-aliasing -fstrict-overflow
     30-ftree-builtin-call-dce
    2431-ftree-switch-conversion -ftree-tail-merge
    2532-ftree-pre
    2633-ftree-vrp
     34-fipa-ra

So maybe one of the new ones are buggy :)

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

If it's only Matching.mo, it is possible to script it. I could try in the afternoon when I am less busy, if you'd like me to.

comment:6 by Adrian Pop, 9 years ago

I have tried the omc with Matching.mo compiled with -O1 just on one model: testsuite/simulation/modelica/built_in_functions/DummyDerMatching.mo so I'm not 100% sure it will work on all the affected ones.

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

I've gone through all of those optimization, and -O1 -f$opt works for all of them. It must be a combination. Is this list of -O2 optimizations a complete list of GCC 5.2.0 -O2 optimization? Because -O1 -fALLOFTHEM... also works.

comment:9 by Martin Sjölund, 9 years ago

Partial fix in 97de296: It was an -O1 flag that was marking function calls pure that was the culprit. GCC 5.1 will still be broken, but 5.2 seems to work (for C code, the tests use g++-4.9 for the cppruntime since boost breaks in g++-5.2).

comment:10 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:11 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:12 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:13 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:14 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:15 by Francesco Casella, 7 years ago

Milestone: 1.12.0Future

The milestone of this ticket has been reassigned to "Future".

If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.

If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".

In both cases, a short informative comment would be welcome.

comment:16 by Adrian Pop, 7 years ago

Resolution: fixed
Status: acceptedclosed

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

Milestone: Future1.11.0
Note: See TracTickets for help on using tickets.