This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/51843] New: ICE with LTO and attribute `dllimport'
- From: "d.g.gorbachev at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Jan 2012 06:51:15 +0000
- Subject: [Bug target/51843] New: ICE with LTO and attribute `dllimport'
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: d.g.gorbachev@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.