Commit 08330ec2 by Andrew Pinski Committed by Andrew Pinski

re PR middle-end/24589 (wrong code with zero sized structs on CONSTRUCTOR)

2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/24589
        * gimplify.c (gimplify_expr) <case CONSTRUCTOR>: Add the
        expressions to a statement list instead of gimplifying them.

2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/24589
        * gcc.c-torture/execute/zero-struct-2.c: New test.

From-SVN: r106436
parent b88b7ced
2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/24589
* gimplify.c (gimplify_expr) <case CONSTRUCTOR>: Add the
expressions to a statement list instead of gimplifying them.
2005-11-03 Eric Botcazou <ebotcazou@libertysurf.fr>
PR rtl-optimization/23585
......
......@@ -4312,18 +4312,19 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
{
unsigned HOST_WIDE_INT ix;
constructor_elt *ce;
tree temp = NULL_TREE;
for (ix = 0;
VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (*expr_p),
ix, ce);
ix++)
if (TREE_SIDE_EFFECTS (ce->value))
gimplify_expr (&ce->value, pre_p, post_p,
gimple_test_f, fallback);
append_to_statement_list (ce->value, &temp);
*expr_p = NULL_TREE;
*expr_p = temp;
ret = GS_OK;
}
ret = GS_ALL_DONE;
else
ret = GS_ALL_DONE;
break;
/* The following are special cases that are not handled by the
......
2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/24589
* gcc.c-torture/execute/zero-struct-2.c: New test.
2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/24582
* g++.dg/init/switch1.C: New test.
void abort (void);
int ii;
typedef struct {} raw_spinlock_t;
typedef struct {
raw_spinlock_t raw_lock;
} spinlock_t;
raw_spinlock_t one_raw_spinlock (void)
{
raw_spinlock_t raw_lock;
ii++;
return raw_lock;
}
int main(void)
{
spinlock_t lock = (spinlock_t) { .raw_lock = one_raw_spinlock() };
if (ii != 1)
abort ();
return 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