This is the mail archive of the gcc-patches@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]

Re: [LRA] Fix ICE on pathological testcase


On 12/06/2016 05:28 AM, Eric Botcazou wrote:
Hi,

the compiler ICEs for SPARC 64-bit with LRA on the asm-subreg-1.c test:

volatile unsigned short _const_32 [4] = {1,2,3,4};
void
evas_common_convert_yuv_420p_601_rgba()
{
  __asm__ __volatile__ ("" : : "X" (*_const_32));
}

The issue is that combine merges back the 3 instructions necessary to build
the address of _const_32 into a big MEM expression:

(insn 10 9 0 2 (asm_operands/v ("") ("") 0 [
            (mem/v/c:HI (lo_sum:DI (mult:DI (lo_sum:DI (high:DI (unspec:DI [
                                        (symbol_ref:DI ("_const_32") [flags
0x2]  <var_decl 0x7ffff7ff6630 _const_32>)
                                    ] UNSPEC_SETH44))
                            (unspec:DI [
                                    (symbol_ref:DI ("_const_32") [flags 0x2]
<var_decl 0x7ffff7ff6630 _const_32>)
                                ] UNSPEC_SETM44))
                        (const_int 4096 [0x1000]))
                    (symbol_ref:DI ("_const_32") [flags 0x2]  <var_decl
0x7ffff7ff6630 _const_32>)) [1 _const_32+0 S2 A16])
        ]
         [
            (asm_input:HI ("X") asm-subreg-1.c:13)
        ]
         [] asm-subreg-1.c:13) "asm-subreg-1.c":13 -1
     (nil))

and LRA calls decompose_mem_address on the address, which aborts out of
confusion; reload (and all subsequent passes) lets it go through unmodified.

The attached patch simply adds a bypass to process_address_1 in order to avoid
invoking decompose_mem_address in this case.

Tested on SPARC/Solaris with LRA and x86-64/Linux, OK for the mainline?


2016-12-06  Eric Botcazou  <ebotcazou@adacore.com>

	* lra-constraints.c (process_address_1): Do not attempt to decompose
	addresses for MEMs that satisfy fixed-form constraints.
Presumably the MEM isn't a valid memory address, but it's allowed through due to the use of an "X" constraint?

ISTM that LRA has to be prepared to handle an arbitrary RTX, so punting seems appropriate.

jeff


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