This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] regcprop fix for PR rtl-optimization/54300
- From: Jeff Law <law at redhat dot com>
- To: Richard Earnshaw <rearnsha at arm dot com>, Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Nov 2013 11:46:41 -0700
- Subject: Re: [patch] regcprop fix for PR rtl-optimization/54300
- Authentication-results: sourceware.org; auth=none
- References: <528B9527 dot 2050800 at arm dot com>
On 11/19/13 09:43, Richard Earnshaw wrote:
PR 54300 is a problem in regcprop where the compiler sees
(parallel [(set (x) (y)
(set (y) (x)]) (REG_UNUSED (y))
as a single-set insn (since the other operand, y, is not used) and
replaces a use of x with a use of y. However, it fails to take into
account that y has been clobbered in the insn itself.
I considered changing single_set() to not return this case, but then
decided that would potentially cause missed optimization opportunities
in passes like combine which do know how to deal with cases like this.
The fix consists of two parts:
a) Spotting the unused sets and ensuring that their values are killed in
the value chains
b) Disabling the simple-move optimization when we've killed something in a).
The test is unfortunately ARM specific -- I'm not aware of any generic
code that triggers this.
gcc/
PR rtl-optimization/54300
* regcprop.c (copyprop_hardreg_forward_1): Ensure any unused
outputs in a single-set are killed from the value chains.
gcc/testsuite:
PR rtl-optimization/54300
* gcc.target/arm/pr54300.C: New test.
Bootstrapped/tested on x86_64 and tested on arm-eabi.
This is good. Please install.
Thanks,
Jeff