aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-08-27 21:37:53 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-08-27 14:37:53 -0700
commit412f898605314d3c2eac39fc5e9774ea9a134f1c (patch)
treeb36e7c770eb95bb27062a0aa0a4a320f647f0343 /gcc/gimplify.c
parent147a8fb1ca28372e8beb030b1ca91b59f7be42b0 (diff)
downloadgcc-412f898605314d3c2eac39fc5e9774ea9a134f1c.zip
gcc-412f898605314d3c2eac39fc5e9774ea9a134f1c.tar.gz
gcc-412f898605314d3c2eac39fc5e9774ea9a134f1c.tar.bz2
re PR middle-end/23463 (va-arg-22.c execution fails)
2005-08-27 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/23463 * gimplify.c (gimplify_modify_expr_rhs): Remove check for zero sized types. (gimplify_modify_expr): Check for zero sized types and gimplify the rhs and lhs as statements. 2005-08-27 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/23463 * gcc.c-torture/execute/zero-struct-1.c: New test. From-SVN: r103571
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 9b34970..7d76d66 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2965,12 +2965,6 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p,
tree *post_p, bool want_value)
{
enum gimplify_status ret = GS_OK;
- tree type = TREE_TYPE (*from_p);
- if (zero_sized_type (type))
- {
- *expr_p = NULL_TREE;
- return GS_ALL_DONE;
- }
while (ret != GS_UNHANDLED)
switch (TREE_CODE (*from_p))
@@ -3164,6 +3158,18 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
/* The distinction between MODIFY_EXPR and INIT_EXPR is no longer useful. */
if (TREE_CODE (*expr_p) == INIT_EXPR)
TREE_SET_CODE (*expr_p, MODIFY_EXPR);
+
+ /* For zero sized types only gimplify the left hand side and right hand side
+ as statements and throw away the assignment. */
+ if (zero_sized_type (TREE_TYPE (*from_p)))
+ {
+ gimplify_stmt (from_p);
+ gimplify_stmt (to_p);
+ append_to_statement_list (*from_p, pre_p);
+ append_to_statement_list (*to_p, pre_p);
+ *expr_p = NULL_TREE;
+ return GS_ALL_DONE;
+ }
/* See if any simplifications can be done based on what the RHS is. */
ret = gimplify_modify_expr_rhs (expr_p, from_p, to_p, pre_p, post_p,