[Bug tree-optimization/113703] ivopts miscompiles loop

2024-02-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113703 --- Comment #5 from Richard Biener --- It's going wrong in iv_elimination_compare_lt which tries to exactly handle this kind of loop: We aim to handle the following situation: sometype *base, *p; int a, b, i; i = a; p = p_0 = b

[Bug tree-optimization/113703] ivopts miscompiles loop

2024-02-05 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113703 Richard Biener changed: What|Removed |Added Ever confirmed|0 |1 Keywords|

[Bug tree-optimization/113703] ivopts miscompiles loop

2024-02-01 Thread kristerw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113703 --- Comment #3 from Krister Walfridsson --- Oops. I messed up the test case... It "works", but the actual values does not make sense... The following is better: int main() { long pgsz = sysconf (_SC_PAGESIZE); void *p = mmap (NULL, pgsz *

[Bug tree-optimization/113703] ivopts miscompiles loop

2024-02-01 Thread kristerw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113703 --- Comment #2 from Krister Walfridsson --- Here is a runtime testcase: #include #include #include __attribute__((noipa)) void f1 (char *p, uintptr_t i, uintptr_t n) { p += i; do { *p = '\0'; p += 1; i++; } w

[Bug tree-optimization/113703] ivopts miscompiles loop

2024-02-01 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113703 Richard Biener changed: What|Removed |Added Keywords||wrong-code CC|