Fix RTL checking failure in return value code

Eric Botcazou
Sat Mar 23 11:14:00 GMT 2013

We ran into RTL checking failure on the 4.7 branch for ARM (BE/VFPv3/ARM):

FAIL: gcc.c-torture/execute/vector-subscript-1.c compilation,  -O0  (internal 
compiler error)
UNRESOLVED: gcc.c-torture/execute/vector-subscript-1.c execution,  -O0 
FAIL: gcc.c-torture/execute/vector-subscript-2.c compilation,  -O0  (internal 
compiler error)
UNRESOLVED: gcc.c-torture/execute/vector-subscript-2.c execution,  -O0 

The code in expand_function_end:

          /* If a non-BLKmode return value should be padded at the least
             significant end of the register, shift it left by the appropriate
             amount.  BLKmode results are handled using the group load/store
             machinery.  */
          if (TYPE_MODE (TREE_TYPE (decl_result)) != BLKmode
              && targetm.calls.return_in_msb (TREE_TYPE (decl_result)))
              emit_move_insn (gen_rtx_REG (GET_MODE (decl_rtl),
                                           REGNO (real_decl_rtl)),
              shift_return_value (GET_MODE (decl_rtl), true, real_decl_rtl);

is taking REGNO of a PARALLEL:

(parallel/i:TI [
        (expr_list:REG_DEP_TRUE (reg:DI 63 s0)
            (const_int 0 [0]))
        (expr_list:REG_DEP_TRUE (reg:DI 65 s2)
            (const_int 8 [0x8]))

Fixed thusly, tested on x86_64-suse-linux, applied on the mainline as obvious.

2013-03-23  Eric Botcazou  <>

	* calls.c (expand_call): Add missing guard to code handling return
	of non-BLKmode structures in MSB.
	* function.c (expand_function_end): Likewise.

Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 1027 bytes
Desc: not available
URL: <>

More information about the Gcc-patches mailing list