Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 286982 - sys-devel/gcc-4.4.1 -O1 optimization bug
Summary: sys-devel/gcc-4.4.1 -O1 optimization bug
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-29 21:34 UTC by Jochen Schlick
Modified: 2009-10-18 09:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
test program (test.cpp,1.22 KB, text/plain)
2009-09-29 21:36 UTC, Jochen Schlick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Schlick 2009-09-29 21:34:04 UTC
the attached C++ test program triggers this optimization bug.


>  /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=3, val2=0
val1=3, val2=0


--> FAIL


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

--> OK

Reproducible: Always
Comment 1 Jochen Schlick 2009-09-29 21:36:24 UTC
Created attachment 205622 [details]
test program
Comment 2 Jochen Schlick 2009-09-29 21:49:36 UTC
This happens on intel 32bit and on AMD64 platforms with this compiler
Comment 3 Rafał Mużyło 2009-09-29 22:23:51 UTC
Looks like a valid bug, but it would be better to report it upstream.
Comment 4 Jochen Schlick 2009-09-30 08:15:36 UTC
same results on Fedora 11 with Fedora's gcc 4.4.1
Comment 5 Jochen Schlick 2009-10-01 08:36:31 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=526428

seems to work with the current gcc-4.4.1 in Fedora RawHide. Our Gentoo gcc-4.4.1 is too old.
Comment 6 Rafał Mużyło 2009-10-18 05:15:58 UTC
Please don't whine (without a good reason).

Anyway, seems fixed in gcc 4.4.2.
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2009-10-18 09:53:52 UTC
Fixed in 4.4.2.