[Bug tree-optimization/126724] The check for SIDE EFFECTS on match patterns should be using expr_no_side_effects_p instead

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 10 06:52:44 GMT 2026


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'll note that genmatch tries to automate parts of the required side-effect
queries, extending it to cover substitution into (cond ..) (or vec_cond?)
should be possible.

Note in the cited pattern making a trap conditional should be fine, we
are in other places happily sinking pointer dereferences.  We just may
not _introduce_ new traps.

So IMHO this specific case is correct.


More information about the Gcc-bugs mailing list