Hi,
I have here a specific code where gcc 4.8.2 generates wrong code, when optimizing with -O2.
The issue seems to be new in 4.8.2 as gcc 4.7.2 works fine.
I have attached a small example project (EX02_gcc_opt_issue.zip) showing the issue.
The testcase implements two flavours of the same function, hipBugTest_c() and hipBugTest_c1().
Both functions should return the same result, but hipBugTest_c1() fails when -O2 optimization is used.
Seems that the problem is related to register usage and signed/unsigned conversion.
See README.txt and src/main.cpp for the more details.
I ran the test on a T2080RDB eval system.
regards
Alois
Original Attachment has been moved to: EX02_gcc_opt_issue.zip
解決済! 解決策の投稿を見る。
I tested on my T2080 setup. Indeed, it seems to be a problem.
When building with 4.7.2 I see no problem, iOut = iOut1 = 24 in your test program no
matter what the optimization level is.
When building with 4.8.2 all is fine in O0, but in O2 I see iOut = 24 and iOut1=100.
I will write a report to the compiler team.
regards,
Catalin
Hi,
I will make the environment and look into your problem.
Can you tell me the exact CW version and build number ?
regards,
Catalin
Hi Catalin,
my versions are
CodeWarrior for Power Architecture
Version: 10.4.0
Build Id: 140709
powerpc-aeabi-g++ (GCC) 4.8.2 20131016 (Thu Mar 13 11:42:43 CDT 2014 | build.sh rev=963 s=F482 ELe6500 -V release_r963_build_Fed_ELe6500) |
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
great! I have this exact build already installed on my machine.
I guess you installed on this build via Help\Install New Software the toolchains ?
Catalin
yes
Hi Catalin,
many thanks, just keep me informed
Alois
I tested on my T2080 setup. Indeed, it seems to be a problem.
When building with 4.7.2 I see no problem, iOut = iOut1 = 24 in your test program no
matter what the optimization level is.
When building with 4.8.2 all is fine in O0, but in O2 I see iOut = 24 and iOut1=100.
I will write a report to the compiler team.
regards,
Catalin