aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.cc
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2023-07-21 20:37:59 +0100
committerRoger Sayle <roger@nextmovesoftware.com>2023-07-21 20:37:59 +0100
commitcfe53af09364d94fb86013f85ef598a1d47e0657 (patch)
treee03398cf9c1a718077ae9a52d51d0ed2be08334e /gcc/gimplify.cc
parent77d0f9ec3809b4d2e32c36069b6b9239d301c030 (diff)
downloadgcc-cfe53af09364d94fb86013f85ef598a1d47e0657.zip
gcc-cfe53af09364d94fb86013f85ef598a1d47e0657.tar.gz
gcc-cfe53af09364d94fb86013f85ef598a1d47e0657.tar.bz2
PR c/110699: Defend against error_mark_node in gimplify.cc.
This patch resolves PR c/110669, an ICE-after-error regression, by adding a check that the array type isn't error_mark_node in gimplify_compound_lval. 2023-07-21 Roger Sayle <roger@nextmovesoftware.com> Richard Biener <rguenther@suse.de> gcc/ChangeLog PR c/110699 * gimplify.cc (gimplify_compound_lval): If the array's type is error_mark_node then return GS_ERROR. gcc/testsuite/ChangeLog PR c/110699 * gcc.dg/pr110699.c: New test case.
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 36e5df0..320920e 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -3209,6 +3209,9 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
{
tree t = expr_stack[i];
+ if (error_operand_p (TREE_OPERAND (t, 0)))
+ return GS_ERROR;
+
if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF)
{
/* Deal with the low bound and element type size and put them into