This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Invalid address after reload


Hello,

I'd like to get some help on a new port I'm trying to put together. The
problem seems to be in the reload phase (where else? :-) ).

The register 176 is spilled in the following instruction (dump just
before reload):

(insn 364 363 365 57 decode_macroblock.c:280 (set (mem:SI (plus:SI
(reg/v/f:SI 176 [ dc_dct_pred ])
                (const_int 8 [0x8])) [0 S4 A32])
        (const_int 0 [0x0])) 12 {movsi} (nil))

This changes the instruction to: 

(insn 364 363 365 57 decode_macroblock.c:280 (set (mem:SI (plus:SI
(mem/f/c/i:SI (plus:SI (reg/f:SI 141 mac:AP)
                        (const_int 8 [0x8])) [0 dc_dct_pred+0 S4 A32])
                (const_int 8 [0x8])) [0 S4 A32])
        (const_int 0 [0x0])) 12 {movsi} (nil))

This fails the "legitimate address" constraint since I'm not allowing a
mem inside another mem.
Thus I get this error after the reload:

decode_macroblock.c:324: error: insn does not satisfy its constraints:
(insn 364 363 365 57 decode_macroblock.c:280 (set (mem:SI (plus:SI
(mem/f/c/i:SI (plus:SI (reg/f:SI 141 mac:AP)
                        (const_int 8 [0x8])) [0 dc_dct_pred+0 S4 A32])
                (const_int 8 [0x8])) [0 S4 A32])
        (const_int 0 [0x0])) 12 {movsi} (nil))
decode_macroblock.c:324: internal compiler error: in
reload_cse_simplify_operands, at postreload.c:395

The relevant part of the .md-file looks like this:

(define_mode_iterator GPR [HI SI QI])
(define_mode_attr size [(HI "c2") (SI "i") (QI "c")])
(define_insn "mov<mode>"
  [(set (match_operand:GPR 0 "nonimmediate_operand" "=r,=m,=m,=r")
	(match_operand:GPR 1 "general_operand" "m,r,i,g"))]
  ""
  { 
    switch (which_alternative)
    {
    case 0:
      return "ld_<size>\t%0 <- %1";
    case 1:
      return "st_<size>\t%0, %1";
    case 2:
      return "st_<size>\t%0, %1";
    case 3:
      return "mov\t%0 <- %1";
    default:
      gcc_unreachable();
    }
  }
)

What could be the problem? Where should I start looking?

I am using a checkout from the trunk from somewhere last week.

Thanks for the help,
Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]