From 842afc4e289ed3fe69583672c1a180f268d73799 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 20 Jan 2021 16:27:34 -0500 Subject: [PATCH] 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. --- gcc/testsuite/gcc.dg/torture/ftrapv-2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.30.2