[Bug c/109393] Very trivial address calculation does not fold

2023-09-08 Thread manolis.tsamis at vrull dot eu via Gcc-bugs
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

[Bug c/109393] Very trivial address calculation does not fold

2023-09-04 Thread philipp.tomsich at vrull dot eu via Gcc-bugs
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

[Bug c/109393] Very trivial address calculation does not fold

2023-09-04 Thread manolis.tsamis at vrull dot eu via Gcc-bugs
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

[Bug c/109393] Very trivial address calculation does not fold

2023-05-11 Thread manolis.tsamis at vrull dot eu via Gcc-bugs
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

[Bug c/109393] Very trivial address calculation does not fold

2023-05-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
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

[Bug c/109393] Very trivial address calculation does not fold

2023-05-10 Thread manolis.tsamis at vrull dot eu via Gcc-bugs
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: > > /*

[Bug c/109393] Very trivial address calculation does not fold

2023-04-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109393 Richard Biener changed: What|Removed |Added Component|tree-optimization |c Status|UNCONFIRMED