[Bug middle-end/67442] [5/6 Regression] GCC 5.2.0 on x86_64 creates invalid address on specific array index calculation through pointer
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 15 14:21:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67442
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Testing
@@ -6166,8 +6173,12 @@ extract_muldiv_1 (tree t, tree c, enum t
&& ((sign == UNSIGNED && tcode != MULT_EXPR) || sign == SIGNED))
overflow_p = true;
if (!overflow_p)
- return fold_build2 (tcode, ctype, fold_convert (ctype, op0),
- wide_int_to_tree (ctype, mul));
+ {
+ mul = wide_int::from (mul, TYPE_PRECISION (ctype),
+ TYPE_SIGN (TREE_TYPE (op1)));
+ return fold_build2 (tcode, ctype, fold_convert (ctype, op0),
+ wide_int_to_tree (ctype, mul));
+ }
}
/* If these operations "cancel" each other, we have the main
More information about the Gcc-bugs
mailing list