https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
--- Comment #9 from Manolis Tsamis ---
Created attachment 55856
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55856=edit
Address calculation pattern v1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
--- Comment #8 from philipp.tomsich at vrull dot eu ---
On Mon, 4 Sept 2023 at 13:38, manolis.tsamis at vrull dot eu <
gcc-bugzi...@gcc.gnu.org> wrote:
> My current match.pd pattern to do that is below; any feedback or
> improvements
> are
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
--- Comment #7 from Manolis Tsamis ---
After some attempts to improve on this, my current solution is:
1) Do not change pointer_int_sum in c-common (otherwise codegen regressions
are observed)
2) Introduce a pattern that folds (unsigned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
--- Comment #6 from manolis.tsamis at vrull dot eu ---
(In reply to Richard Biener from comment #5)
> (In reply to manolis.tsamis from comment #4)
> > Given the original transform it should be valid to propagate the constant
> > addition through
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
--- Comment #5 from Richard Biener ---
(In reply to manolis.tsamis from comment #4)
> Given the original transform it should be valid to propagate the constant
> addition through the cast?
Yes. Note doing so loses information, we know i + 1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
--- Comment #4 from manolis.tsamis at vrull dot eu ---
(In reply to Richard Biener from comment #3)
> It's probably a mismatch of GENERIC/GIMPLE folding. In this case it's
> pointer_int_sum prematurely distributing the multiplication:
>
> /*
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393
Richard Biener changed:
What|Removed |Added
Component|tree-optimization |c
Status|UNCONFIRMED