public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/51843] New: ICE with LTO and attribute `dllimport'
@ 2012-01-13  6:55 d.g.gorbachev at gmail dot com
  2012-01-13  9:58 ` [Bug target/51843] " rguenth at gcc dot gnu.org
  2014-08-07  2:27 ` d.g.gorbachev at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2012-01-13  6:55 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/51843] ICE with LTO and attribute `dllimport'
  2012-01-13  6:55 [Bug target/51843] New: ICE with LTO and attribute `dllimport' d.g.gorbachev at gmail dot com
@ 2012-01-13  9:58 ` rguenth at gcc dot gnu.org
  2014-08-07  2:27 ` d.g.gorbachev at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-13  9:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51843

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-13
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-13 09:55:44 UTC ---
Yep.  This is because of the weird

    case VAR_DECL:
      if (((TREE_STATIC (op) || DECL_EXTERNAL (op))
           && !DECL_DLLIMPORT_P (op))

in tree.c:staticp and decl_address_ip_invariant_p which both do not make
any sense to me.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug target/51843] ICE with LTO and attribute `dllimport'
  2012-01-13  6:55 [Bug target/51843] New: ICE with LTO and attribute `dllimport' d.g.gorbachev at gmail dot com
  2012-01-13  9:58 ` [Bug target/51843] " rguenth at gcc dot gnu.org
@ 2014-08-07  2:27 ` d.g.gorbachev at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: d.g.gorbachev at gmail dot com @ 2014-08-07  2:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51843

--- Comment #2 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> ---
No ICE with GCC 4.9/4.10, the attribute is silently ignored.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-07  2:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-13  6:55 [Bug target/51843] New: ICE with LTO and attribute `dllimport' d.g.gorbachev at gmail dot com
2012-01-13  9:58 ` [Bug target/51843] " rguenth at gcc dot gnu.org
2014-08-07  2:27 ` d.g.gorbachev at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).