public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression
@ 2011-11-17 23:45 reichelt at gcc dot gnu.org
  2011-11-17 23:48 ` [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers reichelt at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-11-17 23:45 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51198
           Summary: [c++0x] [4.7 Regression] ICE with throw expression
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: reichelt@gcc.gnu.org


The following code snippet triggers an ICE on trunk if it is compiled with
"-flto -std=c++0x":

===========================
struct A
{
  int i = 0 ? 0 : throw 1;
};

A a;
===========================

bug.cc:6:4: internal compiler error: tree code 'throw_expr' is not supported in
LTO streams
Please submit a full bug report, [etc.]

Without "-flto" the code compiles fine.
On the 4.6 branch the code is rejected without ICE.


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

* [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers
  2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
@ 2011-11-17 23:48 ` reichelt at gcc dot gnu.org
  2011-11-17 23:58 ` reichelt at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-11-17 23:48 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[c++0x] [4.7 Regression]    |[c++0x] [4.7 Regression]
                   |ICE with throw expression   |ICE with -flto and
                   |                            |non-static data member
                   |                            |initializers

--- Comment #1 from Volker Reichelt <reichelt at gcc dot gnu.org> 2011-11-17 23:35:47 UTC ---
Here's another one with a function call:

==================
struct A
{
  int f();
  int i = f();
};

A a;
==================

bug15.cc:7:4: internal compiler error: tree code 'call_expr' is not supported
in LTO streams
Please submit a full bug report, [etc.]


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

* [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers
  2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
  2011-11-17 23:48 ` [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers reichelt at gcc dot gnu.org
@ 2011-11-17 23:58 ` reichelt at gcc dot gnu.org
  2011-11-18  1:05 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2011-11-17 23:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Volker Reichelt <reichelt at gcc dot gnu.org> 2011-11-17 23:45:23 UTC ---
And another ICE with 'target_expr':

===========
struct A
{
  A(int);
};

struct B
{
  A a = 0;
};

B b;
===========

bug.cc:11:4: internal compiler error: tree code 'target_expr' is not supported
in LTO streams
Please submit a full bug report, [etc.]


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

* [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers
  2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
  2011-11-17 23:48 ` [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers reichelt at gcc dot gnu.org
  2011-11-17 23:58 ` reichelt at gcc dot gnu.org
@ 2011-11-18  1:05 ` pinskia at gcc dot gnu.org
  2011-11-18  1:41 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-18  1:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-18 00:26:25 UTC ---
Maybe LTO stream should ignore DECL_INITIAL for FIELD_DECLs.


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

* [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers
  2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-11-18  1:05 ` pinskia at gcc dot gnu.org
@ 2011-11-18  1:41 ` pinskia at gcc dot gnu.org
  2011-11-29 22:47 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-18  1:41 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-18
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-18 01:17:12 UTC ---
Something like:
Index: lto-streamer-out.c
===================================================================
--- lto-streamer-out.c    (revision 181464)
+++ lto-streamer-out.c    (working copy)
@@ -350,6 +350,9 @@ lto_write_tree (struct output_block *ob,
                                   vnode))
         initial = NULL;
     }
+      /*  NULLify the initial for field decls which show up in C++0x code. */
+      if (TREE_CODE (expr) == FIELD_DECL)
+    initial = NULL;

       stream_write_tree (ob, initial, ref_p);
     }


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

* [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers
  2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-11-18  1:41 ` pinskia at gcc dot gnu.org
@ 2011-11-29 22:47 ` pinskia at gcc dot gnu.org
  2011-12-01 17:13 ` pinskia at gcc dot gnu.org
  2011-12-01 17:14 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-29 22:47 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-29 22:31:20 UTC ---
A better patch which I am testing:
Index: tree.c
===================================================================
--- tree.c    (revision 181815)
+++ tree.c    (working copy)
@@ -4651,7 +4651,8 @@ free_lang_data_in_decl (tree decl)
       || (decl_function_context (decl) && !TREE_STATIC (decl)))
     DECL_INITIAL (decl) = NULL_TREE;
     }
-  else if (TREE_CODE (decl) == TYPE_DECL)
+  else if (TREE_CODE (decl) == TYPE_DECL
+       || TREE_CODE (decl) == FIELD_DECL)
     DECL_INITIAL (decl) = NULL_TREE;
   else if (TREE_CODE (decl) == TRANSLATION_UNIT_DECL
            && DECL_INITIAL (decl)

--- CUT ---
This also should reduce peak memory usage when using the non-static data member
initialization feature.


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

* [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers
  2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-11-29 22:47 ` pinskia at gcc dot gnu.org
@ 2011-12-01 17:13 ` pinskia at gcc dot gnu.org
  2011-12-01 17:14 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-01 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-01 17:13:10 UTC ---
Author: pinskia
Date: Thu Dec  1 17:13:05 2011
New Revision: 181886

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181886
Log:
2011-12-01  Andrew Pinski  <apinski@cavium.com>

    PR lto/51198
    * tree.c (free_lang_data_in_decl): Clear FIELD_DECL's
    DECL_INITIAL also.

2011-12-01  Andrew Pinski  <apinski@cavium.com>

    PR lto/51198
    * g++.dg/torture/pr51198.C: New testcase.


Added:
    trunk/gcc/testsuite/g++.dg/torture/pr51198.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c


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

* [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers
  2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-12-01 17:13 ` pinskia at gcc dot gnu.org
@ 2011-12-01 17:14 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-01 17:14 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-01 17:13:41 UTC ---
Fixed.


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

end of thread, other threads:[~2011-12-01 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 23:45 [Bug lto/51198] New: [c++0x] [4.7 Regression] ICE with throw expression reichelt at gcc dot gnu.org
2011-11-17 23:48 ` [Bug lto/51198] [c++0x] [4.7 Regression] ICE with -flto and non-static data member initializers reichelt at gcc dot gnu.org
2011-11-17 23:58 ` reichelt at gcc dot gnu.org
2011-11-18  1:05 ` pinskia at gcc dot gnu.org
2011-11-18  1:41 ` pinskia at gcc dot gnu.org
2011-11-29 22:47 ` pinskia at gcc dot gnu.org
2011-12-01 17:13 ` pinskia at gcc dot gnu.org
2011-12-01 17:14 ` pinskia 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).