This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix up cmove expansion (PR target/58864)


> 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


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