aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-10-23 11:34:48 +0000
committerEric Botcazou <ebotcazou@adacore.com>2019-10-23 11:34:48 +0000
commit5272626bb50175c4534a8cb46dbc40263b7798f6 (patch)
treea5e9a1583b05e48192d0ae53cbf87ffd5acdb8a7 /gcc/testsuite
parent64a0b8d72403101c92e440b7040a36f899476116 (diff)
PR tree-optimization/92131
* tree-vrp.c (extract_range_from_plus_minus_expr): If the resulting range would be symbolic, drop to varying for any explicit overflow in the constant part or if neither range is a singleton. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277314 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20191023-1.c73
2 files changed, 77 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 482ff0ccabc..c578af30ce8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2019-10-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.c-torture/execute/20191023-1.c: New test.
+
2019-10-23 Martin Liska <mliska@suse.cz>
PR ipa/91969
diff --git a/gcc/testsuite/gcc.c-torture/execute/20191023-1.c b/gcc/testsuite/gcc.c-torture/execute/20191023-1.c
new file mode 100644
index 00000000000..3811ebca151
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20191023-1.c
@@ -0,0 +1,73 @@
+/* PR tree-optimization/92131 */
+/* Testcase by Armin Rigo <arigo@tunes.org> */
+
+long b, c, d, e, f, i;
+char g, h, j, k;
+int *aa;
+
+static void error (void) __attribute__((noipa));
+static void error (void) { __builtin_abort(); }
+
+static void see_me_here (void) __attribute__((noipa));
+static void see_me_here (void) {}
+
+static void aaa (void) __attribute__((noipa));
+static void aaa (void) {}
+
+static void a (void) __attribute__((noipa));
+static void a (void) {
+ long am, ao;
+ if (aa == 0) {
+ aaa();
+ if (j)
+ goto ay;
+ }
+ return;
+ay:
+ aaa();
+ if (k) {
+ aaa();
+ goto az;
+ }
+ return;
+az:
+ if (i)
+ if (g)
+ if (h)
+ if (e)
+ goto bd;
+ return;
+bd:
+ am = 0;
+ while (am < e) {
+ switch (c) {
+ case 8:
+ goto bh;
+ case 4:
+ return;
+ }
+ bh:
+ if (am >= 0)
+ b = -am;
+ ao = am + b;
+ f = ao & 7;
+ if (f == 0)
+ see_me_here();
+ if (ao >= 0)
+ am++;
+ else
+ error();
+ }
+}
+
+int main (void)
+{
+ j++;
+ k++;
+ i++;
+ g++;
+ h++;
+ e = 1;
+ a();
+ return 0;
+}