From: Richard Biener Date: Wed, 1 Sep 2021 06:06:48 +0000 (+0200) Subject: tree-optimization/102149 - add testcase for fixed bug X-Git-Tag: basepoints/gcc-13~5034 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6bd9c42b0ad0cc4a615135612599adb829f2d9c;p=thirdparty%2Fgcc.git tree-optimization/102149 - add testcase for fixed bug This adds the testcase from the PR. 2021-09-01 Richard Biener PR tree-optimization/102149 * gcc.dg/torture/pr102149.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/torture/pr102149.c b/gcc/testsuite/gcc.dg/torture/pr102149.c new file mode 100644 index 000000000000..34a8c213133c --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr102149.c @@ -0,0 +1,19 @@ +/* { dg-do run } */ +/* { dg-additional-options "-fno-vect-cost-model" } */ + +int a[8]; +int *b = &a[6]; +char c; +int main() +{ + int d = 7; + for (; d >= 0; d--) + { + *b = 1; + c = a[d] >> 3; + a[d] = c; + } + if (a[6] != 1) + __builtin_abort (); + return 0; +}