This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix up cmove expansion (PR target/58864)
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Steven Bosscher <stevenb dot gcc at gmail dot com>, Richard Biener <rguenther at suse dot de>
- Date: Sat, 30 Nov 2013 12:38:30 +0100
- Subject: Re: [PATCH] Fix up cmove expansion (PR target/58864)
- Authentication-results: sourceware.org; auth=none
- References: <20131129215630 dot GG892 at tucnak dot redhat dot com>
> Rather than adding do_pending_stack_adjust () in all the places, especially
> when it isn't clear whether emit_conditional_move will be called at all and
> whether it will actually do do_pending_stack_adjust (), I chose to add
> two new functions to save/restore the pending stack adjustment state,
> so that when instruction sequence is thrown away (either by doing
> start_sequence/end_sequence around it and not emitting it, or
> delete_insns_since) the state can be restored, and have changed all the
> places that IMHO need it for emit_conditional_move.
Why not do it in emit_conditional_move directly then? The code thinks it's
clever to do:
do_pending_stack_adjust ();
last = get_last_insn ();
prepare_cmp_insn (XEXP (comparison, 0), XEXP (comparison, 1),
GET_CODE (comparison), NULL_RTX, unsignedp, OPTAB_WIDEN,
&comparison, &cmode);
[...]
delete_insns_since (last);
return NULL_RTX;
but apparently not, so why not delete the stack adjustment as well and restore
the state afterwards?
--
Eric Botcazou