Hi,
I noticed, that this wrong code bug is caused by two insns which are created by the function process_addr_reg in lra-constraints.c, which share a common sub expression. The fix is rather simple, use copy_rtx when the memory reference is used twice. The patch was boot-strapped and regression-tested on x86_64-pc-linux-gnu and arm-linux-gnueabihf. OK for trunk? Thanks Bernd.
gcc: 2015-09-30 Bernd Edlinger <bernd.edlin...@hotmail.de> PR rtl-optimization/67037 * lra-constraints.c (process_addr_reg): Use copy_rtx when necessary. testsuite: 2015-09-30 Bernd Edlinger <bernd.edlin...@hotmail.de> PR rtl-optimization/67037 * gcc.c-torture/execute/pr67037.c: New test.
patch-pr67037.diff
Description: Binary data