commit e5ab9ee234cb7f4b25e5aa56e64cf3a8a0e56f58
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Tue Nov 17 15:33:58 2015 +0000
[combine] PR rtl-optimization/68381: Only restrict pure simplification in mult-extend subst case, allow other substitutions
new file mode 100644
@@ -0,0 +1,22 @@
+/* { dg-options "-O -fexpensive-optimizations -fno-tree-bit-ccp" } */
+
+__attribute__ ((noinline, noclone))
+int
+foo (unsigned short x, unsigned short y)
+{
+ int r;
+ if (__builtin_mul_overflow (x, y, &r))
+ __builtin_abort ();
+ return r;
+}
+
+int
+main (void)
+{
+ int x = 1;
+ int y = 2;
+ if (foo (x, y) != x * y)
+ __builtin_abort ();
+ return 0;
+}
+