[Bug c++/121143] FP warning from -Waggressive-loop-optimizations

2025-07-17 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121143 Richard Biener changed: What|Removed |Added Keywords||false-positive, |

[Bug c++/121143] FP warning from -Waggressive-loop-optimizations

2025-07-17 Thread tkaminsk at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121143 --- Comment #6 from Tomasz KamiƄski --- I was able to silence the warning by placing the bound on output range, instead of input: { const auto __sz = ranges::distance(__rg); if (__sz > (_Nm - size())) __throw_bad_alloc(); // Bounded on

[Bug c++/121143] FP warning from -Waggressive-loop-optimizations

2025-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121143 --- Comment #5 from Jakub Jelinek --- My bet is that before cunroll we didn't know that __n_206 is 9 and during cunroll we completely unroll the loop that computes it and when processing the next loop we use ranger to ask about __n_206 value, ge

[Bug c++/121143] FP warning from -Waggressive-loop-optimizations

2025-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121143 --- Comment #4 from Jakub Jelinek --- That first loop corresponds to struct __distance_fn final { template _Sent> requires (!sized_sentinel_for<_Sent, _It>) constexpr iter_difference_t<_It> operator()[[nodiscard]](_It _

[Bug c++/121143] FP warning from -Waggressive-loop-optimizations

2025-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121143 --- Comment #3 from Jakub Jelinek --- Before cunroll that first loop is [local count: 8680598903]: # __n_274 = PHI <__n_206(43), 0(39)> # ivtmp_255 = PHI __n_206 = __n_274 + 1; ivtmp_374 = ivtmp_255 - 1; if (ivtmp_374 != 0) got

[Bug c++/121143] FP warning from -Waggressive-loop-optimizations

2025-07-17 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121143 Jakub Jelinek changed: What|Removed |Added CC||hubicka at gcc dot gnu.org,