aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2018-03-19 12:49:30 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2018-03-19 12:49:30 +0000
commit25f91fda52f88f4a639a30ec33d821f1acb9c058 (patch)
tree079838dd79a6c0a620fc0d836864307e975318b8 /gcc/tree-data-ref.c
parent8455b50eccdeac648fd0ebd0b7dd60b0e8bbffbb (diff)
downloadgcc-25f91fda52f88f4a639a30ec33d821f1acb9c058.zip
gcc-25f91fda52f88f4a639a30ec33d821f1acb9c058.tar.gz
gcc-25f91fda52f88f4a639a30ec33d821f1acb9c058.tar.bz2
re PR tree-optimization/84929 (ICE at -O3 on valid code on x86_64-linux-gnu: tree check: expected polynomial_chrec, have nop_expr in analyze_siv_subscript_cst_affine, at tree-data-ref.c:3018)
2018-03-19 Richard Biener <rguenther@suse.de> PR tree-optimization/84929 * tree-data-ref.c (analyze_siv_subscript_cst_affine): Guard chrec_is_positive against non-chrec arg. * gcc.dg/torture/pr84929.c: New testcase. From-SVN: r258643
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index a886329..af35e41 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -3015,7 +3015,8 @@ analyze_siv_subscript_cst_affine (tree chrec_a,
{
if (value0 == false)
{
- if (!chrec_is_positive (CHREC_RIGHT (chrec_b), &value1))
+ if (TREE_CODE (chrec_b) != POLYNOMIAL_CHREC
+ || !chrec_is_positive (CHREC_RIGHT (chrec_b), &value1))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "siv test failed: chrec not positive.\n");
@@ -3096,7 +3097,8 @@ analyze_siv_subscript_cst_affine (tree chrec_a,
}
else
{
- if (!chrec_is_positive (CHREC_RIGHT (chrec_b), &value2))
+ if (TREE_CODE (chrec_b) != POLYNOMIAL_CHREC
+ || !chrec_is_positive (CHREC_RIGHT (chrec_b), &value2))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "siv test failed: chrec not positive.\n");