PR sanitizer/80403
* fold-const.c (fold_ternary_loc): Revert
use op0 instead of fold_convert_loc (loc, type, arg0) part of
2017-04-12 change.
* g++.dg/ubsan/pr80403-2.C: New test.
From-SVN: r246917
+2017-04-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/80403
+ * fold-const.c (fold_ternary_loc): Revert
+ use op0 instead of fold_convert_loc (loc, type, arg0) part of
+ 2017-04-12 change.
+
2017-04-13 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/80343
&& (code == VEC_COND_EXPR || !VECTOR_TYPE_P (type)))
return fold_build2_loc (loc, code == VEC_COND_EXPR ? BIT_AND_EXPR
: TRUTH_ANDIF_EXPR,
- type, op0, op1);
+ type, fold_convert_loc (loc, type, arg0), op1);
/* Convert A ? B : 1 into !A || B if A and B are truth values. */
if (code == VEC_COND_EXPR ? integer_all_onesp (op2) : integer_onep (op2)
+2017-04-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/80403
+ * g++.dg/ubsan/pr80403-2.C: New test.
+
2017-04-13 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/80343
--- /dev/null
+// PR sanitizer/80403
+// { dg-do compile }
+// { dg-options "-fsanitize=undefined" }
+
+extern const long long int v;
+extern unsigned long int w;
+
+int
+foo ()
+{
+ int a = (0 - 40U <= (0 == 8)) << !w << (0 < v) == 0;
+ int b = ((0 ^ 0) < (long) (1066066618772207110 <= 0)) / 0 << 0; // { dg-warning "division by zero" }
+ return a + b;
+}