On Tue, Jun 06, 2006 at 10:39:46AM +0100, Richard Sandiford wrote:
> Wolfgang Mües <[EMAIL PROTECTED]> writes:
> >> ../../../gcc-4.0.2/gcc/unwind-dw2-fde.c: In function
> >> __register_frame_info_table_bases':

> >> ../../../gcc-4.0.2/gcc/unwind-dw2-fde.c:146: error: insn does not
> >> satisfy its constraints:
[cut]
> >> ../../../gcc-4.0.2/gcc/unwind-dw2-fde.c:146: internal compiler error:
> >> in reload_ cse_simplify_operands, at postreload.c:391
> 
> This is just a guess, but the insn above might be an output reload.

It is, in a peculiar (and not useful) way. Diffing the greg dump against
the lreg dump shows (using the example code I posted):

+(insn:HI 25 17 38 2 (set (reg:QI 3 r3)
+        (reg:QI 3 r3 [110])) 158 {*arm_movqi_insn_swp} (nil)
+    (nil))

-(insn:HI 25 17 36 2 (set (mem/s:QI (plus:SI (reg/v/f:SI 101 [ x ])
+(insn 38 25 36 2 (set (mem/s:QI (plus:SI (reg/v/f:SI 0 r0 [orig:101 x ]
+ [101])
                 (const_int 5 [0x5])) [0 <variable>.c2+0 S1 A8])
-        (subreg:QI (reg:SI 110) 0)) 158 {*arm_movqi_insn_swp} (nil)
-    (expr_list:REG_DEAD (reg:SI 110)
-        (expr_list:REG_DEAD (reg/v/f:SI 101 [ x ])
-            (nil))))
+        (reg:QI 3 r3)) 158 {*arm_movqi_insn_swp} (nil)
+    (nil))

I.e. change insn 25 to a nop and then add insn 38 as essentially a duplicate
of the original insn 25. I don't think reload was supposed to do that. The
documentation as well as comments in reload.c suggest that the address would
be loaded into a register. I'm running the code in a debugger to find out
why it doesn't happen.

> Reload instructions are not themselves reloaded.  In other words,
> if gcc needs to reload a QImode register out to a memory location,
> it will assume that any m<-r move is OK; it will not restrict the
> reload to Q<-r.  This is by design.  You can:
> 
>   (1) Trap this in the movqi expander, if you can fix up the general
>       case without clobbering additional registers (unlikely).
>   (2) Define a reload_outqi pattern to handle general m<-r moves.
>       You then get a scratch register to play with.  (This interface
>       has changed (and improved) since I last used it.)

This option stands a reasonable chance of being the end result. It just adds
more hair than I'd like to. It is one more thing that could go wrong, and so
on.

>   (3) Modify reload so that output memory operands are legitimised
>       differently (only if you're brave).
>   (4) Restrict QImode addresses to 'Q'.
> 
> It looks downthread like you've already decided to do (4).

Only as a temporary measure.

> I just
> wasn't sure from the thread whether you realised that output reloads
> might be a specific problem.

I was not aware of this. It is only the second time I've seen postreload
complain about unsatisfied constraints. Thanks for pointing out this
problem.

-- 
Rask Ingemann Lambertsen

Reply via email to