From: Andrew MacLeod Date: Wed, 20 Jan 2021 21:27:34 +0000 (-0500) Subject: Re: trapv question X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=842afc4e289ed3fe69583672c1a180f268d73799;p=gcc.git Re: trapv question Adjust testcase to so the ADD that is expected to overflow cannot be optimized. gcc/testsuite * gcc.dg/torture/ftrapv-2.c: Make overflow instruction unremovable. --- diff --git a/gcc/testsuite/gcc.dg/torture/ftrapv-2.c b/gcc/testsuite/gcc.dg/torture/ftrapv-2.c index 75e464fe557..4d746c9ce5c 100644 --- a/gcc/testsuite/gcc.dg/torture/ftrapv-2.c +++ b/gcc/testsuite/gcc.dg/torture/ftrapv-2.c @@ -12,7 +12,7 @@ /* Verify SImode operations properly trap. PR middle-end/68046 */ -int i = 0x7fffffff; +volatile int i = 0x7fffffff; int main(void) { @@ -20,7 +20,7 @@ int main(void) int status = 0; if (child == 0) { - volatile int x = i + 1 < i; + i = i + 1; exit (0); } else if (child == -1)