On 10/30/2012 09:39 AM, Richard Sandiford wrote:
"H.J. Lu" <hjl.to...@gmail.com> writes:
On Tue, Oct 30, 2012 at 4:38 AM, H.J. Lu <hjl.to...@gmail.com> wrote:
On Tue, Oct 30, 2012 at 4:09 AM, Richard Sandiford
<rdsandif...@googlemail.com> wrote:
The address in this case is:

(plus:SI (mult:SI (reg/v:SI 223 [orig:154 j ] [154])
         (const_int 8 [0x8]))
     (subreg:SI (plus:DI (reg/f:DI 20 frame)
             (const_int 32 [0x20])) 0))

which after Uros's subreg simplification patch shouldn't be allowed:
the subreg ought to be on the frame register rather than the plus.

The attached patch seems to work for the testcase.  Does it work
more generally?

Richard


gcc/
         * lra-eliminations.c (lra_eliminate_regs_1): Use simplify_gen_subreg
         rather than gen_rtx_SUBREG.

Index: gcc/lra-eliminations.c
===================================================================
--- gcc/lra-eliminations.c      (revision 192983)
+++ gcc/lra-eliminations.c      (working copy)
@@ -550,7 +550,8 @@
               return x;
             }
           else
-           return gen_rtx_SUBREG (GET_MODE (x), new_rtx, SUBREG_BYTE (x));
+           return simplify_gen_subreg (GET_MODE (x), new_rtx,
+                                       GET_MODE (new_rtx), SUBREG_BYTE (x));
         }

        return x;
I am running the full test.

It works.  Can you check in your patch?  I will check in
my testcase.
Thanks.  Vlad, is the patch OK?

Sure.  Thanks.

Reply via email to