diff options
author | Richard Biener <rguenther@suse.de> | 2022-12-21 12:27:58 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-12-21 13:12:52 +0100 |
commit | 845b514e8a150447ba041294586af76a6ac05158 (patch) | |
tree | cf2873d5099c18606c4e9a380edfdd7f91c01ca9 /gcc/gimplify.cc | |
parent | 89ba8366fe12fd2d04535c99ba67f33d7e305132 (diff) | |
download | gcc-845b514e8a150447ba041294586af76a6ac05158.zip gcc-845b514e8a150447ba041294586af76a6ac05158.tar.gz gcc-845b514e8a150447ba041294586af76a6ac05158.tar.bz2 |
middle-end/107994 - ICE after error with comparison gimplification
The following avoids passing down error_mark_node to fold_convert.
PR middle-end/107994
* gimplify.cc (gimplify_expr): Catch errorneous comparison
operand.
Diffstat (limited to 'gcc/gimplify.cc')
-rw-r--r-- | gcc/gimplify.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 250782b..c9c800a 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -17098,6 +17098,9 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, Compare scalar mode aggregates as scalar mode values. Using memcmp for them would be very inefficient at best, and is plain wrong if bitfields are involved. */ + if (error_operand_p (TREE_OPERAND (*expr_p, 1))) + ret = GS_ERROR; + else { tree type = TREE_TYPE (TREE_OPERAND (*expr_p, 1)); @@ -17122,9 +17125,8 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, ret = gimplify_scalar_mode_aggregate_compare (expr_p); else ret = gimplify_variable_sized_compare (expr_p); - - break; } + break; /* If *EXPR_P does not need to be special-cased, handle it according to its class. */ |