From ccd88fb795b3f133ca2bc4b9fd41e5143b5a95a8 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 6 May 2016 17:23:56 +0200 Subject: [PATCH] re PR target/70941 (Test miscompiled with -O2.) PR middle-end/70941 * gcc.dg/torture/pr70941.c (abort): Remove prototype. (a, b, c, d): Change type from char to signed char. (main): Compare against (signed char) -1634678893 instead of hardcoded -109. Use __builtin_abort instead of abort. From-SVN: r235978 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/pr70941.c | 8 +++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 75fa9c6d94e..31a65a410e3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2016-05-06 Jakub Jelinek + PR middle-end/70941 + * gcc.dg/torture/pr70941.c (abort): Remove prototype. + (a, b, c, d): Change type from char to signed char. + (main): Compare against (signed char) -1634678893 instead of + hardcoded -109. Use __builtin_abort instead of abort. + * gcc.target/i386/avx512bw-vpsraw-3.c: New test. * gcc.target/i386/avx512vl-vpsrad-3.c: New test. diff --git a/gcc/testsuite/gcc.dg/torture/pr70941.c b/gcc/testsuite/gcc.dg/torture/pr70941.c index 3a57081abc7..eb37a1fb293 100644 --- a/gcc/testsuite/gcc.dg/torture/pr70941.c +++ b/gcc/testsuite/gcc.dg/torture/pr70941.c @@ -1,14 +1,12 @@ /* { dg-do run } */ /* { dg-require-effective-target int32plus } */ -extern void abort (void); - -char a = 0, b = 0, c = 0, d = 0; +signed char a = 0, b = 0, c = 0, d = 0; int main() { a = -(b - 405418259) - ((d && c) ^ 2040097152); - if (a != -109) - abort(); + if (a != (signed char) -1634678893) + __builtin_abort (); return 0; } -- 2.30.2