public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/50601] New: [4.7 Regression] New LTO failures
@ 2011-10-03 16:39 hjl.tools at gmail dot com
  2011-10-03 16:42 ` [Bug lto/50601] " hjl.tools at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2011-10-03 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50601
           Summary: [4.7 Regression] New LTO failures
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com


On Linux/x86-64, revision 179424 gave

FAIL: g++.dg/lto/20100302 cp_lto_20100302_0.o-cp_lto_20100302_1.o link, -flto
-fabi-version=2 (internal compiler error)
FAIL: gcc.dg/lto/pr47259 c_lto_pr47259_0.o-c_lto_pr47259_1.o link,  -O2 -flto
-w 

Revision 179421 is OK.


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
@ 2011-10-03 16:42 ` hjl.tools at gmail dot com
  2011-10-10 15:17 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2011-10-03 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org
   Target Milestone|---                         |4.7.0

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-10-03 16:42:10 UTC ---
It is caused by revision 179424:

http://gcc.gnu.org/ml/gcc-cvs/2011-10/msg00017.html


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
  2011-10-03 16:42 ` [Bug lto/50601] " hjl.tools at gmail dot com
@ 2011-10-10 15:17 ` rguenth at gcc dot gnu.org
  2011-11-14 18:47 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-10 15:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-10
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-10 15:16:35 UTC ---
Confirmed.


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
  2011-10-03 16:42 ` [Bug lto/50601] " hjl.tools at gmail dot com
  2011-10-10 15:17 ` rguenth at gcc dot gnu.org
@ 2011-11-14 18:47 ` hjl.tools at gmail dot com
  2011-12-06 10:57 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2011-11-14 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2011-11-14 18:36:39 UTC ---
*** Bug 51127 has been marked as a duplicate of this bug. ***


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2011-11-14 18:47 ` hjl.tools at gmail dot com
@ 2011-12-06 10:57 ` rguenth at gcc dot gnu.org
  2011-12-06 11:04 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 10:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 10:56:50 UTC ---
FAIL: g++.dg/lto/20100302 cp_lto_20100302_0.o-cp_lto_20100302_1.o link, -flto
-fabi-version=2 (internal compiler error)

is

lto1: internal compiler error: in make_decl_rtl, at varasm.c:1141

an ICE during ltrans stage:

1136      /* A weak alias has TREE_PUBLIC set but not the other bits.  */
1137      gcc_assert (TREE_CODE (decl) != VAR_DECL
1138                  || TREE_STATIC (decl)
1139                  || TREE_PUBLIC (decl)
1140                  || DECL_EXTERNAL (decl)
1141                  || DECL_REGISTER (decl));

and the decl is the VAR_DECL _ZN1AIDv4_fE1tE (A<float __vector(4)>::t).

This ABI forward-compatibility alias the C++ frontend generates does
not honor the constraints that assert asserts:

(gdb) call debug_tree (decl)
 <var_decl 0x7ffff5a2c140 _ZN1AIDv4_fE1tE
    type <vector_type 0x7ffff5b5f888 mm128
        type <real_type 0x7ffff5a31e70 float SF
            size <integer_cst 0x7ffff5a34240 constant 32>
            unit size <integer_cst 0x7ffff5a34260 constant 4>
            align 32 symtab 0 alias set -1 canonical type 0x7ffff5a31e70
precision 32
            pointer_to_this <pointer_type 0x7ffff5a3f0a8>>
        V4SF
        size <integer_cst 0x7ffff5a34400 constant 128>
        unit size <integer_cst 0x7ffff5a34420 constant 16>
        align 128 symtab 0 alias set -1 canonical type 0x7ffff5b5f930 nunits 4
        pointer_to_this <pointer_type 0x7ffff5b5f7e0>>
    addressable used ignored V4SF file
/space/rguenther/src/svn/trunk/gcc/testsuite/g++.dg/lto/20100302_0.C line 9 col
19 size <integer_cst 0x7ffff5a34400 128> unit size <integer_cst 0x7ffff5a34420
16>
    align 128>

we create RTL for this decl because do_assemble_alias does

5452      /* We must force creation of DECL_RTL for debug info generation, even
though
5453         we don't use it here.  */
5454      make_decl_rtl (decl);

but the alias has DECL_IGNORED set, so we can fix this by not creating
RTL for DECL_IGNORED decls (hopefully).


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2011-12-06 10:57 ` rguenth at gcc dot gnu.org
@ 2011-12-06 11:04 ` rguenth at gcc dot gnu.org
  2011-12-06 11:35 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 11:03:29 UTC ---
Which shifts the error to

/space/rguenther/src/svn/trunk/gcc/testsuite/g++.dg/lto/20100302_1.C: In
function 'main':^M
/space/rguenther/src/svn/trunk/gcc/testsuite/g++.dg/lto/20100302_1.C:5:5:
error: invalid argument to gimple call^M
&_ZN1AIDv4_fE1tE^M
/space/rguenther/src/svn/trunk/gcc/testsuite/g++.dg/lto/20100302_1.C:5:5:
error: constant not recomputed when ADDR_EXPR changed^M
&_ZN1AIDv4_fE1tE^M

...


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2011-12-06 11:04 ` rguenth at gcc dot gnu.org
@ 2011-12-06 11:35 ` rguenth at gcc dot gnu.org
  2011-12-06 13:27 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 11:34:41 UTC ---
Because the decl isn't considered decl_address_invariant_p () - of course,
it is neither TREE_STATIC nor DECL_EXTERNAL ...

It _is_ both TREE_PUBLIC and TREE_STATIC when created by the C++ frontend
(and during compile stage).

We get

2
cp_lto_20100302_0.o 4
164 6cc97232062f75e0 PREVAILING_DEF_IRONLY _Z1fPU8__vectorf
177 6cc97232062f75e0 PREVAILING_DEF_IRONLY _Z1fPDv4_f
180 6cc97232062f75e0 PREVAILING_DEF_IRONLY _ZN1AIDv4_fE1tE
182 6cc97232062f75e0 PREVAILING_DEF_IRONLY _ZN1AIU8__vectorfE1tE
cp_lto_20100302_1.o 3
164 5d25700523736b18 PREVAILING_DEF main
168 5d25700523736b18 RESOLVED_IR _Z1fPDv4_f
179 5d25700523736b18 RESOLVED_IR _ZN1AIDv4_fE1tE

which is then mangled via cgraph_make_decl_local during the IPA
function and variable visibility pass.  This removes the TREE_PUBLIC
flag, the TREE_STATIC flag remains at WPA stage.  Note that the
parent, non-alias decl stays TREE_PUBLIC.

The no longer TREE_PUBLIC alias is then mangled at LTRANS stage, and
the TREE_STATIC flag is cleared in:

input_varpool_node (file_data=0x7ffff5b61000, ib=0x19ec4f0)
    at /space/rguenther/src/svn/trunk/gcc/lto-cgraph.c:1083
1083      if (node->finalized)
(gdb) l
1078      if (node->in_other_partition)
1079        {
1080          DECL_EXTERNAL (node->decl) = 1;
1081          TREE_STATIC (node->decl) = 0;
1082        }

but DECL_EXTERNAL is in turn cleared again by

assemble_alias (decl=0x7ffff5a2c140, target=0x7ffff5b5af00)
    at /space/rguenther/src/svn/trunk/gcc/varasm.c:5850
5850      if (TREE_CODE (decl) == FUNCTION_DECL)
(gdb) l
5845         note that the symbol is in fact locally defined.  */
5846      if (! is_weakref)
5847        DECL_EXTERNAL (decl) = 0;

that, of course, looks bogus in the light of LTO partitioning.  Doing

  /* A quirk of the initial implementation of aliases required that the user
     add "extern" to all of them.  Which is silly, but now historical.  Do
     note that the symbol is in fact locally defined.  */
  if (! is_weakref
      && (TREE_CODE (decl) == FUNCTION_DECL
          || !varpool_node (decl)->in_other_partition))
    DECL_EXTERNAL (decl) = 0;

instead "fixes" this bug.


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2011-12-06 11:35 ` rguenth at gcc dot gnu.org
@ 2011-12-06 13:27 ` rguenth at gcc dot gnu.org
  2011-12-06 13:29 ` rguenth at gcc dot gnu.org
  2011-12-07 13:34 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 13:26:20 UTC ---
Author: rguenth
Date: Tue Dec  6 13:26:09 2011
New Revision: 182048

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182048
Log:
2011-12-06  Richard Guenther  <rguenther@suse.de>

    PR middle-end/50601
    * varasm.c (assemble_alias): Move DECL_EXTERNAL implementation
    quirk adjustjment ...
    * passes.c (rest_of_decl_compilation): ... here.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/passes.c
    trunk/gcc/varasm.c


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2011-12-06 13:27 ` rguenth at gcc dot gnu.org
@ 2011-12-06 13:29 ` rguenth at gcc dot gnu.org
  2011-12-07 13:34 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 13:29:11 UTC ---
Fixed.


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

* [Bug lto/50601] [4.7 Regression] New LTO failures
  2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
                   ` (7 preceding siblings ...)
  2011-12-06 13:29 ` rguenth at gcc dot gnu.org
@ 2011-12-07 13:34 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-07 13:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-07 13:31:35 UTC ---
*** Bug 50896 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2011-12-07 13:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 16:39 [Bug lto/50601] New: [4.7 Regression] New LTO failures hjl.tools at gmail dot com
2011-10-03 16:42 ` [Bug lto/50601] " hjl.tools at gmail dot com
2011-10-10 15:17 ` rguenth at gcc dot gnu.org
2011-11-14 18:47 ` hjl.tools at gmail dot com
2011-12-06 10:57 ` rguenth at gcc dot gnu.org
2011-12-06 11:04 ` rguenth at gcc dot gnu.org
2011-12-06 11:35 ` rguenth at gcc dot gnu.org
2011-12-06 13:27 ` rguenth at gcc dot gnu.org
2011-12-06 13:29 ` rguenth at gcc dot gnu.org
2011-12-07 13:34 ` rguenth at gcc dot gnu.org

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).