aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.cc
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2022-11-19 12:48:27 -0800
committerAndrew Pinski <apinski@marvell.com>2022-11-21 07:40:17 +0000
commitb03ad138a61f64d8a77876d6864aad5103fff498 (patch)
tree1e2718340f90bca09f078d7b6132fd25170d4171 /gcc/gimplify.cc
parent183db4fb73a64bc4641604c30cdbbd9d9e8a6ed6 (diff)
downloadgcc-b03ad138a61f64d8a77876d6864aad5103fff498.zip
gcc-b03ad138a61f64d8a77876d6864aad5103fff498.tar.gz
gcc-b03ad138a61f64d8a77876d6864aad5103fff498.tar.bz2
Fix PR 106560: Another ICE after conflicting types of redeclaration
This another one of these ICE after error issues with the gimplifier and a fallout from r12-3278-g823685221de986af. The problem here is gimplify_modify_expr does not check if either from or to was an error operand. This adds the check and fixes the ICE. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * gimplify.cc (gimplify_modify_expr): If either *from_p or *to_p were error_operand return early. gcc/testsuite/ChangeLog: * gcc.dg/redecl-23.c: New test. * gcc.dg/redecl-24.c: New test. * gcc.dg/redecl-25.c: New test.
Diffstat (limited to 'gcc/gimplify.cc')
-rw-r--r--gcc/gimplify.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index c62a966..02415cb 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -6054,6 +6054,9 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
location_t loc = EXPR_LOCATION (*expr_p);
gimple_stmt_iterator gsi;
+ if (error_operand_p (*from_p) || error_operand_p (*to_p))
+ return GS_ERROR;
+
gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
|| TREE_CODE (*expr_p) == INIT_EXPR);