public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/48437] New: LTO crashes with block-local function declarations
@ 2011-04-04 18:21 uweigand at gcc dot gnu.org
  2011-04-05 11:36 ` [Bug lto/48437] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: uweigand at gcc dot gnu.org @ 2011-04-04 18:21 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: LTO crashes with block-local function declarations
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: uweigand@gcc.gnu.org
                CC: rguenther@suse.de


The following program:

int
test (void)
{
  int f (void);
  return 0;
}

int
main (void)
{
  int f (void);
  int test (void);

  return test ();
}

crashes lto1 when compiled with "gcc -g -O -flto -fwhole-program".

What seems to happen is that the FUNCTION_DECL for "f" is added by the LTO
reader into the BLOCK_VARS list of both test and main, which causes its
DECL_CHAIN to be clobbered and the two lists to be cross-entangled.  This in
turn causes an endless recursive descent in set_block_abstract_flags, resulting
in a stack overflow ...

Seen on 4.6.0 (ppc64) and current mainline (i386).


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

* [Bug lto/48437] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
@ 2011-04-05 11:36 ` rguenth at gcc dot gnu.org
  2011-05-24 18:17 ` [Bug lto/48437] [4.6/4.7 Regression] " hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-05 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.04.05 11:34:38
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-05 11:34:38 UTC ---
The problem is we merge those function decls.  We shouldn't even enter
them into the merging process though.

Mine.


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

* [Bug lto/48437] [4.6/4.7 Regression] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
  2011-04-05 11:36 ` [Bug lto/48437] " rguenth at gcc dot gnu.org
@ 2011-05-24 18:17 ` hjl.tools at gmail dot com
  2011-06-12 13:06 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2011-05-24 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.1
            Summary|LTO crashes with            |[4.6/4.7 Regression] LTO
                   |block-local function        |crashes with block-local
                   |declarations                |function declarations

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-05-24 17:58:41 UTC ---
It is caused by revision 170321:

http://gcc.gnu.org/ml/gcc-cvs/2011-02/msg00866.html


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

* [Bug lto/48437] [4.6/4.7 Regression] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
  2011-04-05 11:36 ` [Bug lto/48437] " rguenth at gcc dot gnu.org
  2011-05-24 18:17 ` [Bug lto/48437] [4.6/4.7 Regression] " hjl.tools at gmail dot com
@ 2011-06-12 13:06 ` rguenth at gcc dot gnu.org
  2011-06-27 15:42 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-12 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug lto/48437] [4.6/4.7 Regression] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-06-12 13:06 ` rguenth at gcc dot gnu.org
@ 2011-06-27 15:42 ` jakub at gcc dot gnu.org
  2011-10-26 17:17 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-06-27 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.1                       |4.6.2

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-27 12:32:45 UTC ---
GCC 4.6.1 is being released.


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

* [Bug lto/48437] [4.6/4.7 Regression] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-06-27 15:42 ` jakub at gcc dot gnu.org
@ 2011-10-26 17:17 ` jakub at gcc dot gnu.org
  2011-12-08  8:52 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-10-26 17:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.2                       |4.6.3

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-10-26 17:13:30 UTC ---
GCC 4.6.2 is being released.


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

* [Bug lto/48437] [4.6/4.7 Regression] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-10-26 17:17 ` jakub at gcc dot gnu.org
@ 2011-12-08  8:52 ` rguenth at gcc dot gnu.org
  2011-12-08  8:56 ` [Bug lto/48437] [4.6 " rguenth at gcc dot gnu.org
  2011-12-15  9:45 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-08  8:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-08 08:50:40 UTC ---
Author: rguenth
Date: Thu Dec  8 08:50:35 2011
New Revision: 182100

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

    PR lto/48437
    * lto-streamer-out.c (tree_is_indexable): Exclude block-local
    extern declarations.

    * gcc.dg/lto/20111207-2_0.c: New testcase.
    * gcc.dg/guality/pr48437.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/guality/pr48437.c
    trunk/gcc/testsuite/gcc.dg/lto/20111207-2_0.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-out.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug lto/48437] [4.6 Regression] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-12-08  8:52 ` rguenth at gcc dot gnu.org
@ 2011-12-08  8:56 ` rguenth at gcc dot gnu.org
  2011-12-15  9:45 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-08  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |4.7.0
         Resolution|                            |FIXED
   Target Milestone|4.6.3                       |4.7.0
            Summary|[4.6/4.7 Regression] LTO    |[4.6 Regression] LTO
                   |crashes with block-local    |crashes with block-local
                   |function declarations       |function declarations
      Known to fail|                            |4.6.2

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-08 08:51:54 UTC ---
Fixed on trunk, I'll not backport this kind of patches (for -flto -g, that is).


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

* [Bug lto/48437] [4.6 Regression] LTO crashes with block-local function declarations
  2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-12-08  8:56 ` [Bug lto/48437] [4.6 " rguenth at gcc dot gnu.org
@ 2011-12-15  9:45 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-15  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-15 09:44:17 UTC ---
Author: rguenth
Date: Thu Dec 15 09:44:11 2011
New Revision: 182358

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

    Revert
    PR lto/48437
    * lto-streamer-out.c (tree_is_indexable): Exclude block-local
    extern declarations.

    PR lto/48508
    PR lto/48437
    * tree-streamer-out.c (streamer_write_chain): Stream DECL_EXTERNAL
    VAR_DECLs and FUNCTION_DECLs locally.

    * g++.dg/lto/pr48508-1_0.C: New testcase.
    * g++.dg/lto/pr48508-1_1.C: Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/lto/pr48508-1_0.C
    trunk/gcc/testsuite/g++.dg/lto/pr48508-1_1.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-out.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-streamer-out.c


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

end of thread, other threads:[~2011-12-15  9:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-04 18:21 [Bug lto/48437] New: LTO crashes with block-local function declarations uweigand at gcc dot gnu.org
2011-04-05 11:36 ` [Bug lto/48437] " rguenth at gcc dot gnu.org
2011-05-24 18:17 ` [Bug lto/48437] [4.6/4.7 Regression] " hjl.tools at gmail dot com
2011-06-12 13:06 ` rguenth at gcc dot gnu.org
2011-06-27 15:42 ` jakub at gcc dot gnu.org
2011-10-26 17:17 ` jakub at gcc dot gnu.org
2011-12-08  8:52 ` rguenth at gcc dot gnu.org
2011-12-08  8:56 ` [Bug lto/48437] [4.6 " rguenth at gcc dot gnu.org
2011-12-15  9:45 ` 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).