Bug 526428 - gcc 4.4.1 -O1 optimization bug
Summary: gcc 4.4.1 -O1 optimization bug
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-09-30 08:50 UTC by Jochen Schlick
Modified: 2009-09-30 19:51 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-30 19:51:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
test program that triggers this bug (1.22 KB, text/plain)
2009-09-30 08:50 UTC, Jochen Schlick
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Gentoo 286982 0 None None None Never

Description Jochen Schlick 2009-09-30 08:50:45 UTC
Created attachment 363153 [details]
test program that triggers this bug

Description of problem:

There is a problem with the -O1 optimization together with inline code, loops, class constructors and temporal objects.

Version-Release number of selected component (if applicable):
gcc-4.4.1-2.fc11

How reproducible:
see attached test program.
here the results from a Fedora 11 system with the mentioned compiler


>  /usr/bin/gcc -lstdc++ test.cpp
>  ./a.out
val1=1234, val2=0
val1=1234, val2=1

--> OK


>  /usr/bin/gcc -lstdc++ -O1  test.cpp
> ./a.out
val1=-1081510952, val2=-30798
val1=-1081510952, val2=-30798


--> FAIL


>  /usr/bin/gcc -lstdc++ -O2  test.cpp
> ./a.out
val1=1234, val2=0
val1=1234, val2=1

--> OK


PS: I've already created a bug report for Gentoo Linux but the same happens on Fedora 11 too (that's why I create also a Fedora bug report)

https://bugs.gentoo.org/show_bug.cgi?id=286982

Comment 1 Jakub Jelinek 2009-09-30 19:51:30 UTC
Works just fine with gcc-4.4.1-17.


Note You need to log in before you can comment on or make changes to this bug.