https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
--- Comment #12 from Andrew Pinski ---
So basically the biggest issue is we do the sign extend and then do the
multiply in an unsigned type; this causes all negative values causing a
wrapping which is not correct really but we don't know any bett
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
Andrew Pinski changed:
What|Removed |Added
Status|ASSIGNED|NEW
--- Comment #11 from Andrew Pinski
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
--- Comment #10 from Andrew Pinski ---
Created attachment 55303
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55303&action=edit
Better patch
This is a better patch, operand_equal_p already does the integer cst check too.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
--- Comment #9 from Andrew Pinski ---
Created attachment 55302
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55302&action=edit
Patch which I will be testing
This extends the pattern that already handles `(t * 2) / 2) -> t`.
The one thing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
--- Comment #8 from Andrew Pinski ---
_14 = _13 * 32;
_15 = (long int) _14;
_2 = _15 /[ex] 32;
I think this will work
(simplify
(exact_div (nop_convert (mult @0 INTEGER_CST@1)) INTEGER_CST@2)
(if (!TYPE_UNSIGNED (@0)
&& wi::t
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
Andrew Pinski changed:
What|Removed |Added
Status|NEW |ASSIGNED
Assignee|unassigned a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
--- Comment #6 from Andrew Pinski ---
Here are some better testcases as the power of 2 case can be handled on the rtl
level as it is just a shift.
extern struct s{
int a, b, c, d, e, f, g, h;
} data[];
int find(int i, int j)
{
struct s *a =
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
--- Comment #5 from Marc Glisse ---
If we write &data[i] - &data[0] instead of &data[i] - data, we hit the special
case in fold_binary_loc /* Fold &a[i] - &a[j] to i-j. */ which leads to
fold_addr_of_array_ref_difference.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
--- Comment #4 from Marc Glisse ---
(In reply to Andrew Pinski from comment #3)
> On the trunk (on aarch64) we get:
Yes, on I32P64 platforms we still have a chance to prove that the
multiplication doesn't overflow.
> long int _4;
> long int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
Andrew Pinski changed:
What|Removed |Added
Last reconfirmed|2009-09-03 14:12:37 |2016-9-3
--- Comment #3 from Andrew Pins
--- Comment #2 from rguenth at gcc dot gnu dot org 2009-09-03 14:12 ---
Because the index arithmetic is done unsigned.
return (int) ((unsigned int) i * 212) /[ex] 212;
We lost the information that i * 212 cannot overflow.
Simpler testcase:
extern int data[];
int find(int i)
{
re
--- Comment #1 from zsojka at seznam dot cz 2009-09-03 13:50 ---
Created an attachment (id=18475)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18475&action=view)
preprocessed source
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41244
12 matches
Mail list logo