Commit f5a1f0d0 by Paolo Bonzini Committed by Paolo Bonzini

re PR middle-end/40026 (ICE during gimplify_init_constructor)

2009-05-11  Paolo Bonzini  <bonzini@gnu.org>

	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  <bonzini@gnu.org>

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

From-SVN: r147386
parent c260f01f
2009-05-11 Paolo Bonzini <bonzini@gnu.org>
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.
2009-05-11 Nathan Sidwell <nathan@codesourcery.com> 2009-05-11 Nathan Sidwell <nathan@codesourcery.com>
* config/m68k/m68k-devices.def (52274, 52277, 5301x, 5225x, 51xx): * config/m68k/m68k-devices.def (52274, 52277, 5301x, 5225x, 51xx):
......
...@@ -3643,14 +3643,11 @@ static enum gimplify_status ...@@ -3643,14 +3643,11 @@ static enum gimplify_status
gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
bool want_value, bool notify_temp_creation) bool want_value, bool notify_temp_creation)
{ {
tree object, new_ctor; tree object, ctor, type;
tree ctor = TREE_OPERAND (*expr_p, 1);
tree type = TREE_TYPE (ctor);
enum gimplify_status ret; enum gimplify_status ret;
VEC(constructor_elt,gc) *elts; VEC(constructor_elt,gc) *elts;
if (TREE_CODE (ctor) != CONSTRUCTOR) gcc_assert (TREE_CODE (TREE_OPERAND (*expr_p, 1)) == CONSTRUCTOR);
return GS_UNHANDLED;
if (!notify_temp_creation) if (!notify_temp_creation)
{ {
...@@ -3661,8 +3658,10 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, ...@@ -3661,8 +3658,10 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
} }
object = TREE_OPERAND (*expr_p, 0); object = TREE_OPERAND (*expr_p, 0);
new_ctor = optimize_compound_literals_in_ctor (ctor); ctor = TREE_OPERAND (*expr_p, 1) =
elts = CONSTRUCTOR_ELTS (new_ctor); optimize_compound_literals_in_ctor (TREE_OPERAND (*expr_p, 1));
type = TREE_TYPE (ctor);
elts = CONSTRUCTOR_ELTS (ctor);
ret = GS_ALL_DONE; ret = GS_ALL_DONE;
switch (TREE_CODE (type)) switch (TREE_CODE (type))
......
2009-05-11 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/compile/pr40026.c: New testcase.
2009-05-11 Janus Weil <janus@gcc.gnu.org> 2009-05-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/40089 PR fortran/40089
......
typedef struct {
unsigned long bits;
} S;
struct T {
S span;
int flags;
};
struct T f(int x)
{
return (struct T) {
.span = (S) { 0UL },
.flags = (x ? 256 : 0),
};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment