[Bug middle-end/40026] [4.5 Regression] ICE during gimplify_init_constructor

2009-05-09 Thread jsm28 at gcc dot gnu dot org


--- Comment #4 from jsm28 at gcc dot gnu dot org  2009-05-09 18:09 ---
gimplify_init_constructor does

  tree ctor = TREE_OPERAND (*expr_p, 1);
...
  new_ctor = optimize_compound_literals_in_ctor (ctor);
  elts = CONSTRUCTOR_ELTS (new_ctor);
...
gimplify_init_ctor_preeval (&TREE_OPERAND (*expr_p, 1),
pre_p, post_p, &preeval_data);
(which changes a COND_EXPR to have void type, updating the pointer to
that COND_EXPR in TREE_OPERAND (*expr_p, 1) - the old constructor -
to point to the gimplifier-generated temorary instead)
...
if (!cleared || num_nonzero_elements > 0)
  gimplify_init_ctor_eval (object, elts, pre_p, cleared);
(which goes through the elements of the new constructor, finds the
modified COND_EXPR and ends up segfaulting because of that).

This looks like the compound literal changes must be responsible and
that it is a gimplifier bug.


-- 

jsm28 at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||bonzini at gnu dot org
 Status|UNCONFIRMED |NEW
  Component|c   |middle-end
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-05-09 18:09:03
   date||


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



[Bug middle-end/40026] [4.5 Regression] ICE during gimplify_init_constructor

2009-05-11 Thread bonzini at gnu dot org


--- Comment #5 from bonzini at gnu dot org  2009-05-11 07:02 ---
I have a patch.  It's just that TREE_OPERAND (*expr, 1) must be changed to
new_ctor.


-- 

bonzini at gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |bonzini at gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-05-09 18:09:03 |2009-05-11 07:02:26
   date||


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



[Bug middle-end/40026] [4.5 Regression] ICE during gimplify_init_constructor

2009-05-11 Thread bonzini at gnu dot org


--- Comment #6 from bonzini at gnu dot org  2009-05-11 09:04 ---
Created an attachment (id=17850)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17850&action=view)
patch to fix the bug


-- 


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



[Bug middle-end/40026] [4.5 Regression] ICE during gimplify_init_constructor

2009-05-11 Thread bonzini at gcc dot gnu dot org


--- Comment #7 from bonzini at gnu dot org  2009-05-11 16:06 ---
Subject: Bug 40026

Author: bonzini
Date: Mon May 11 16:05:45 2009
New Revision: 147386

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147386
Log:
2009-05-11  Paolo Bonzini  

PR tree-optimization/40026
* gimplify.c (gimplify_init_constructor): Change initial conditional
to assertion.  Rewrite TREE_OPERAND (*expr_p, 1) after
optimize_compound_literals_in_ctor.

testsuite:
2009-05-11  Paolo Bonzini  

* gcc.c-torture/compile/pr40026.c: New testcase.


Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr40026.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug middle-end/40026] [4.5 Regression] ICE during gimplify_init_constructor

2009-05-21 Thread rguenth at gcc dot gnu dot org


--- Comment #8 from rguenth at gcc dot gnu dot org  2009-05-21 10:29 ---
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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