PR sanitizer/80932
* fold-const.c (extract_muldiv_1) <case MINUS_EXPR>: Add
TYPE_OVERFLOW_WRAPS check.
* c-c++-common/ubsan/pr80932.c: New test.
From-SVN: r248961
+2017-06-07 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/80932
+ * fold-const.c (extract_muldiv_1) <case MINUS_EXPR>: Add
+ TYPE_OVERFLOW_WRAPS check.
+
2017-06-07 Bin Cheng <bin.cheng@arm.com>
* tree-vect-loop-manip.c (vect_do_peeling): Don't skip vector loop
t1 = extract_muldiv (op0, c, code, wide_type, &sub_strict_overflow_p);
t2 = extract_muldiv (op1, c, code, wide_type, &sub_strict_overflow_p);
if (t1 != 0 && t2 != 0
+ && TYPE_OVERFLOW_WRAPS (ctype)
&& (code == MULT_EXPR
/* If not multiplication, we can only do this if both operands
are divisible by c. */
+2017-06-07 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/80932
+ * c-c++-common/ubsan/pr80932.c: New test.
+
2017-06-07 Bin Cheng <bin.cheng@arm.com>
* gcc.target/i386/l_fma_double_1.c: Adjust test strings.
--- /dev/null
+/* PR sanitizer/80932 */
+/* { dg-do run } */
+/* { dg-options "-fsanitize=undefined -fsanitize-undefined-trap-on-error" } */
+
+int x = 1;
+
+long int
+foo (void)
+{
+ return ((long) (13801962912760474560ULL * x) - (long) (15334142073106273231ULL * x)) * -6;
+}
+
+int
+main ()
+{
+ foo ();
+}