[Bug target/54457] [x32] Fail to combine 64bit index + constant

ubizjak at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 24 18:39:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54457

--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2012-09-24 18:38:46 UTC ---
(In reply to comment #0)

> combine fails on:
> 
> Trying 6 -> 8:
> Failed to match this instruction:
> (set (reg:QI 66)
>     (mem/j:QI (plus:SI (subreg:SI (plus:DI (reg/v:DI 62 [ position ])
>                     (const_int 1 [0x1])) 0)
>             (symbol_ref:SI ("array") [flags 0x40]  <var_decl 0x7ffff19ad260
> arra
> y>)) [0 array S1 A8]))
> 
> This should be a valid address.

In principle yes, but the RTX is not accepted in ix86_decompose_address since
we have two displacements here. Combine should simplify this RTX to:

(set (reg:QI 68)
    (mem/j:QI (plus:SI (subreg:SI (reg/v:DI 62 [ position ]) 0)
            (const:SI (plus:SI (symbol_ref:SI ("array") [flags 0x40]  <var_decl
0x7f8d1bc41390 array>)
                    (const_int 1 [0x1])))) [0 array S1 A8]))


as is the case with -m32 (but rejected in ix86_address_subreg_operand):

  /* Don't allow SUBREGs that span more than a word.  It can lead to spill
     failures when the register is one word out of a two word structure.  */
  if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
    return false;



More information about the Gcc-bugs mailing list