This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix pr57637
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Zhenqiang Chen <zhenqiang dot chen at linaro dot org>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Earnshaw <rearnsha at arm dot com>
- Date: Thu, 11 Jul 2013 12:31:35 +0200
- Subject: Re: [PATCH] Fix pr57637
- References: <CACgzC7Cab2ke3L0AqGUvqdxg-PEf2r-xkwHq=OYu4UviEhyw6g at mail dot gmail dot com>
> 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