+2019-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/90095
+ * internal-fn.c (expand_mul_overflow): Don't set SUBREG_PROMOTED_VAR_P
+ on lowpart SUBREGs.
+
2019-04-17 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_init): Format diagnostic string.
/* If both op0 and op1 are sign (!uns) or zero (uns) extended from
hmode to mode, the multiplication will never overflow. We can
do just one hmode x hmode => mode widening multiplication. */
- rtx lopart0s = lopart0, lopart1s = lopart1;
- if (GET_CODE (lopart0) == SUBREG)
- {
- lopart0s = shallow_copy_rtx (lopart0);
- SUBREG_PROMOTED_VAR_P (lopart0s) = 1;
- SUBREG_PROMOTED_SET (lopart0s, uns ? SRP_UNSIGNED : SRP_SIGNED);
- }
- if (GET_CODE (lopart1) == SUBREG)
- {
- lopart1s = shallow_copy_rtx (lopart1);
- SUBREG_PROMOTED_VAR_P (lopart1s) = 1;
- SUBREG_PROMOTED_SET (lopart1s, uns ? SRP_UNSIGNED : SRP_SIGNED);
- }
tree halfstype = build_nonstandard_integer_type (hprec, uns);
- ops.op0 = make_tree (halfstype, lopart0s);
- ops.op1 = make_tree (halfstype, lopart1s);
+ ops.op0 = make_tree (halfstype, lopart0);
+ ops.op1 = make_tree (halfstype, lopart1);
ops.code = WIDEN_MULT_EXPR;
ops.type = type;
rtx thisres
+2019-04-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/90095
+ * gcc.dg/pr90095-1.c: New test.
+ * gcc.dg/pr90095-2.c: New test.
+
2019-04-17 Thomas Schwinge <thomas@codesourcery.com>
PR fortran/90048
--- /dev/null
+/* PR middle-end/90095 */
+/* { dg-do run } */
+/* { dg-options "-Os -fno-tree-bit-ccp" } */
+
+unsigned long long a;
+unsigned int b;
+
+int
+main ()
+{
+ unsigned int c = 255, d = c |= b;
+ if (__CHAR_BIT__ != 8 || __SIZEOF_INT__ != 4 || __SIZEOF_LONG_LONG__ != 8)
+ return 0;
+ d = __builtin_mul_overflow (-(unsigned long long) d, (unsigned char) - c, &a);
+ if (d != 0)
+ __builtin_abort ();
+ return 0;
+}