Skip to content

Commit d3904a3

Browse files
rguenthstefan-sf-ibm
authored andcommitted
tree-optimization/117119 - ICE with int128 IV in dataref analysis
Here's another fix for a missing check that an IV value fits in a HIW. It's originally from Stefan. PR tree-optimization/117119 * tree-data-ref.cc (initialize_matrix_A): Check whether an INTEGER_CST fits in HWI, otherwise return chrec_dont_know. * gcc.dg/torture/pr117119.c: New testcase. Co-Authored-By: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
1 parent c0c47fc commit d3904a3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* { dg-do compile } */
2+
/* { dg-require-effective-target int128 } */
3+
4+
unsigned __int128 g_728;
5+
int func_1_l_5011[8];
6+
void func_1() {
7+
for (;; g_728 += 1)
8+
func_1_l_5011[g_728] ^= func_1_l_5011[g_728 + 5];
9+
}
10+
void main() {}

gcc/tree-data-ref.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4088,7 +4088,7 @@ initialize_matrix_A (lambda_matrix A, tree chrec, unsigned index, int mult)
40884088
}
40894089

40904090
case INTEGER_CST:
4091-
return chrec;
4091+
return cst_and_fits_in_hwi (chrec) ? chrec : chrec_dont_know;
40924092

40934093
default:
40944094
gcc_unreachable ();

0 commit comments

Comments
 (0)