This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/81741] Misoptimisation : replacing a constant field read access by a function call


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81741

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |law at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I see the same behavior with 4.9, as well as older (e.g. 4.8 or 4.4).
The thing is that __builtin_constant_p is (at -O1 and above) a check whether
some expression is constant after optimizations, and here FRE or DOM passes
figure out (due to jump threading?) that it is constant.
Abusing __builtin_constant_p this way is always going to be risky.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]