http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51843
Bug #: 51843 Summary: ICE with LTO and attribute `dllimport' Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: d.g.gorbac...@gmail.com Target: *-*-mingw32 Created attachment 26312 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26312 Testcase "If a symbol previously declared `dllimport' is later defined, the attribute is ignored in subsequent references, and a warning is emitted." GCC 4.7.0 gives this error: In file included from :0:0: main.c: In function 'main': main.c:4:5: error: constant not recomputed when ADDR_EXPR changed &bar In file included from b.c:1:0, from :1: main.c:6:7: note: in statement # .MEM_3 = VDEF <.MEM_2(D)> bar = 7; In file included from :0:0: main.c:4:5: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. GCC 4.6.3 just ignores the attribute, emitting no warning. Without LTO, the two `bar's are treated as 2 different variables.