diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-10-23 11:34:48 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-10-23 11:34:48 +0000 |
commit | 149a3e4d4e3aacdbfee165f0efea4d6327327265 (patch) | |
tree | a5e9a1583b05e48192d0ae53cbf87ffd5acdb8a7 /gcc/testsuite/gcc.c-torture | |
parent | 8d509fb6686cf55c8a7ff8297ad9d75a719d8fa6 (diff) | |
download | gcc-149a3e4d4e3aacdbfee165f0efea4d6327327265.zip gcc-149a3e4d4e3aacdbfee165f0efea4d6327327265.tar.gz gcc-149a3e4d4e3aacdbfee165f0efea4d6327327265.tar.bz2 |
re PR tree-optimization/92131 (incorrect assumption that (ao >= 0) is always false)
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.
From-SVN: r277314
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20191023-1.c | 73 |
1 files changed, 73 insertions, 0 deletions
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 0000000..3811ebc --- /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; +} |