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

--- Comment #17 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Ok, so what we do about this bug then if it ought to be combine.c that needs
> changing?  For REG_EQUAL notes in combine_instructions check for the
> auto-incdec side-effects in the pattern (I'd hope we don't have them in
> REG_EQUAL notes content) and if there are any, punt?  At least for
> backporting that seems like the right solution, and given that it seems
> try_combine also punts on these if we remove or add any in the patterns, it
> seems in line with what the rest of combiner does.

At least the fix for the branches seems to be clear: do not do the temporary
replacement in combine_instructions if the SET_SRC has side effects; there are
a bunch of similar side_effects_p tests in the combiner.

> Or, shall it e.g. queue the side-effects in some new argument to try_combine
> and if the combination would succeed, add the side-effect as yet another 
> instruction (if it can match and is cheaper than what we have previously)?

That seems overkill to me, even on the mainline, but others might disagree.

Reply via email to