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 pr57637


> Shrink-wrap optimization sinks some instructions for more
> opportunities. It uses DF_LR_BB_INFO (bb)->def to check whether BB
> clobbers SRC. But for ARM, gcc might generate cond_exec insns before
> shrink-wrapping. And DF_LR_BB_INFO (bb)->def does not include def info
> from cond_exec insns. So the check in function
> move_insn_for_shrink_wrap is not enough.

Posting a testcase would be even better, but the analysis looks plausible.
DF_REF_CONDITIONAL and DF_REF_PARTIAL defs aren't killing defs so they are not 
included in the def set for LR.

As you pointed out, they are included in the gen set for LIVE if it exists, so 
I guess we should wonder if we really want to do the scanning if LIVE doesn't 
exist, i.e. at -O1, instead of simply giving up.  In any case, the scanning 
doesn't need to be redundant with the previous work, so:

      if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL)))
	  continue;

is missing in the patch.

-- 
Eric Botcazou


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