aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr122497-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/torture/pr122497-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr122497-1.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr122497-1.c b/gcc/testsuite/gcc.dg/torture/pr122497-1.c
new file mode 100644
index 0000000..8b027ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr122497-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* PR tree-optimization/122497 */
+
+/* This was ICEing during SCCP
+ trying to simplify a reference back to the phi
+ which was removed. */
+
+char g_2[1][2];
+int g_4, g_5;
+void main() {
+ for (; g_4; g_4 -= 1)
+ g_5 = g_2[g_4 + 2][g_4];
+}