[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2024-07-29 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 --- Comment #7 from Jan Hubicka --- The idea is to help developers to annotate i.e. binary tree search function, which he clearly knows is always to be finite, but compiler can not prove it. Intentional infinite loops with no side effects writte

[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2024-05-26 Thread eggert at cs dot ucla.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 --- Comment #6 from Paul Eggert --- (In reply to Jan Hubicka from comment #5) > yes, however both const and pure attributes allows compiler to also > remove the call if return value is unused. So here finiteness matters. Thanks for mentioning t

[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2024-05-26 Thread hubicka at ucw dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 --- Comment #5 from Jan Hubicka --- > (In reply to Jan Hubicka from comment #2) > > The reason why gcc warns is that it is unable to prove that the function is > > always finite. > > I don't see why finiteness matters. If a pure function return

[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2024-05-25 Thread eggert at cs dot ucla.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 Paul Eggert changed: What|Removed |Added CC||eggert at cs dot ucla.edu --- Comment #4

[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2023-05-28 Thread bruno at clisp dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 --- Comment #3 from Bruno Haible --- (In reply to Jan Hubicka from comment #2) > The reason why gcc warns is that it is unable to prove that the function is > always finite. This means that it can not auto-detect pure attribute since > optimizin

[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2023-05-28 Thread hubicka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 --- Comment #2 from Jan Hubicka --- The reason why gcc warns is that it is unable to prove that the function is always finite. This means that it can not auto-detect pure attribute since optimizing the call out may turn infinite program to finit

[Bug ipa/109914] --suggest-attribute=pure misdiagnoses static functions

2023-05-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109914 --- Comment #1 from Andrew Pinski --- *** Bug 109915 has been marked as a duplicate of this bug. ***