Hello,
PR 70292 turned out to be the duplicate of PR 64411, which is already fixed
on trunk, but still the testcase from the PR is worth adding. It can be
tortured instead of being a target test, and also this PR showed that 64411
is a regression and should be backported to gcc-5-branch.
Committed the test to trunk. I don't think we need it for gcc-5 though.
Andrey
Index: gcc/testsuite/gcc.dg/pr70292.c
===================================================================
*** gcc/testsuite/gcc.dg/pr70292.c (revision 0)
--- gcc/testsuite/gcc.dg/pr70292.c (revision 234627)
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
+ /* { dg-options "-O1 -fno-inline -fno-dce -fschedule-insns -fselective-scheduling -fno-tree-dce" } */
+
+ void bar() {}
+
+ int t106_1mul(unsigned int x, unsigned int y) {
+ int r;
+ if (__builtin_mul_overflow(x, y, &r)) {
+ bar();
+ }
+ return r;
+ }
Index: gcc/testsuite/ChangeLog
===================================================================
*** gcc/testsuite/ChangeLog (revision 234626)
--- gcc/testsuite/ChangeLog (revision 234627)
***************
*** 1,3 ****
--- 1,8 ----
+ 2016-03-31 Andrey Belevantsev <a...@ispras.ru>
+
+ PR target/70292
+ * gcc.c-torture/pr70292.c: New test.
+
2016-03-31 Marek Polacek <pola...@redhat.com>
PR c/70297