From 49ec778e046ff6d8e23392355126aed3f2b2a98c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 24 Nov 2011 16:23:18 +0100 Subject: re PR rtl-optimization/50290 (ICE: in distribute_notes, at combine.c:13282 with -O2 -fwhole-program -fno-tree-loop-optimize -fno-tree-vrp -funroll-loops) PR rtl-optimization/50290 * gcc.dg/pr50290.c: New test. From-SVN: r181694 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr50290.c | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr50290.c (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5674c28..bb8baba 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-11-24 Jakub Jelinek + + PR rtl-optimization/50290 + * gcc.dg/pr50290.c: New test. + 2011-11-24 Paolo Carlini PR c++/51290 diff --git a/gcc/testsuite/gcc.dg/pr50290.c b/gcc/testsuite/gcc.dg/pr50290.c new file mode 100644 index 0000000..47680fd --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr50290.c @@ -0,0 +1,27 @@ +/* PR rtl-optimization/50290 */ +/* { dg-do run } */ +/* { dg-options "-O2 -fno-tree-loop-optimize -fno-tree-vrp -funroll-loops" } */ + +static int +bar (int t[], int b) +{ + int i; + for (i = 0; i < b; i++) + t[i] = i + (i > 0 ? t[i - 1] : 0); + return t[b - 1]; +} + +static int +foo (int b) +{ + int x[b]; + return bar (x, b); +} + +int +main () +{ + if (foo (6) != 15) + __builtin_abort (); + return 0; +} -- cgit v1.1