Combine will put CLOBBER (with a non-void mode) anywhere in a pattern to poison it. reg_overlap_mentioned_p did not handle this. This patch fixes that.
Tested on the PR testcase on x86_64-linux; also bootstrapped and regression checked on powerpc64-linux {-m32,-m64}. Is this okay for trunk and backports? What should I do with the testcase? I don't think tool-generated testcases are useful at all (instead, we should ship the tool!); but if people want it anyway, should this be gcc.target/x86_64, or more general somehow? Segher 2018-09-18 Segher Boessenkool <seg...@kernel.crashing.org> PR rtl-optimization/86882 * rtlanal.c (reg_overlap_mentioned_p): Handle CLOBBER. --- gcc/rtlanal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 6c620a4..e8b6b9c 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1815,6 +1815,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in) recurse: switch (GET_CODE (x)) { + case CLOBBER: case STRICT_LOW_PART: case ZERO_EXTRACT: case SIGN_EXTRACT: -- 1.8.3.1