Bug 54518 - A problem using -O2 with g++4.5.0 and g++4.6.0 (see titi.cc)
Summary: A problem using -O2 with g++4.5.0 and g++4.6.0 (see titi.cc)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2012-09-07 12:35 UTC by thierry.visonneau
Modified: 2012-09-08 08:54 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work: 4.6.2
Known to fail: 4.4.3, 4.5.2, 4.6.1
Last reconfirmed:


Attachments
titi.cc (240 bytes, text/x-c++src)
2012-09-07 12:35 UTC, thierry.visonneau
Details
test.list (226 bytes, text/plain)
2012-09-07 12:36 UTC, thierry.visonneau
Details
titi.g++440-O2.s (599 bytes, text/plain)
2012-09-07 12:37 UTC, thierry.visonneau
Details
titi.g++450-O2.s (595 bytes, text/plain)
2012-09-07 12:38 UTC, thierry.visonneau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description thierry.visonneau 2012-09-07 12:35:19 UTC
Created attachment 28147 [details]
titi.cc

A problem using -O2 with g++4.5.0 and g++4.6.0

Using -O2 option with g++4.5.0 and g++4.6.0, the attached file titi.cc is crashing.
It seems that the correct behavior is to obtain the following output :
titi : I=

Please find "test.list" attached that summarizes our tests, and also the assembly code obtained with g++4.5.0 -O2 and g++4.6.0 -O2 :
- titi.g++440-O2.s
- titi.g++450-O2.s
< 	movsbl	1(%rsp),%edi
> 	xorl	%edi, %edi

Thanks,
Best regards
Comment 1 thierry.visonneau 2012-09-07 12:36:23 UTC
Created attachment 28148 [details]
test.list
Comment 2 thierry.visonneau 2012-09-07 12:37:06 UTC
Created attachment 28149 [details]
titi.g++440-O2.s
Comment 3 thierry.visonneau 2012-09-07 12:38:11 UTC
Created attachment 28150 [details]
titi.g++450-O2.s
Comment 4 Jonathan Wakely 2012-09-07 15:22:22 UTC
works fine with 4.6.2 and later, so the problem seems to be fixed in all current releases
Comment 5 Paolo Carlini 2012-09-08 08:54:51 UTC
Fixed.