From: Jakub Jelinek Date: Thu, 16 Jun 2016 10:20:45 +0000 (+0200) Subject: re PR target/71554 (Miscompilation of __builtin_mul_overflow on i686) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c577adb24fdab2a324a9c60d612c00c8d03a30e4;p=gcc.git re PR target/71554 (Miscompilation of __builtin_mul_overflow on i686) PR target/71554 * gcc.c-torture/execute/pr71554.c: New test. From-SVN: r237512 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e720868daa6..b93a6896463 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -4,6 +4,7 @@ 2016-06-16 Jakub Jelinek + PR target/71554 * config/i386/i386.md (setcc + movzbl peephole2): Use reg_set_p. (setcc + and peephole2): Likewise. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7362ecc111c..b4a20edf9d0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-06-16 Jakub Jelinek + PR target/71554 + * gcc.c-torture/execute/pr71554.c: New test. + PR rtl-optimization/71532 * gcc.dg/torture/pr71532.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/pr71554.c b/gcc/testsuite/gcc.c-torture/execute/pr71554.c new file mode 100644 index 00000000000..f0cb4bb0778 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr71554.c @@ -0,0 +1,28 @@ +/* PR target/71554 */ + +int v; + +__attribute__ ((noinline, noclone)) void +bar (void) +{ + v++; +} + +__attribute__ ((noinline, noclone)) +void +foo (unsigned int x) +{ + signed int y = ((-__INT_MAX__ - 1) / 2); + signed int r; + if (__builtin_mul_overflow (x, y, &r)) + bar (); +} + +int +main () +{ + foo (2); + if (v) + __builtin_abort (); + return 0; +}