Bug 56232 - Missed optimization with LTO
Summary: Missed optimization with LTO
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 4.8.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: alias, lto, missed-optimization
Depends on:
Blocks:
 
Reported: 2013-02-07 00:29 UTC by Dmitry Gorbachev
Modified: 2013-02-07 10:45 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.6.4, 4.7.3, 4.8.0
Last reconfirmed:


Attachments
Compile with -flto -O2 (183 bytes, text/plain)
2013-02-07 00:29 UTC, Dmitry Gorbachev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Gorbachev 2013-02-07 00:29:42 UTC
Created attachment 29377 [details]
Compile with -flto -O2

/tmp/cce3xw28.ltrans0.ltrans.o:cce3xw28.ltrans0.o:function main: error: undefined reference to 'bar'
Comment 1 Andrew Pinski 2013-02-07 00:54:02 UTC
Strict aliasing is effectively turned off for LTO.
Comment 2 Richard Biener 2013-02-07 10:45:30 UTC
(In reply to comment #1)
> Strict aliasing is effectively turned off for LTO.

That's not true. It's just weakened to the extend to make structurally
equivalent types have the same alias sets.  In this case struct S and
struct T are aliasing.

So indeed this works as designed.