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]

[PATCH] Fix PR target/13354 (SPARC)


Hi,

This is an ICE in sparc_emit_set_const32 on a sanity check: the function must 
not be called when the constant can be loaded with only one instruction (this 
is explicitly stated in the header).

Now sparc_output_mi_thunk calls it for all non-immediate constants.  So if 
the DELTA argument happens to be big enough and have its 10 low bits 
cleared, the compiler aborts.

The testcase is attached to the PR (1.1 MB of heavily templatized and 
multi-inheritanced C++ code).  I didn't try to reduce it, because it would 
probably make the ICE go away.

Bootstrapped/regtested on sparc-sun-solaris2.6 (3.3 branch except Ada).  Ok 
for mainline and 3.3 branch?


2003-12-09  Eric Botcazou  <ebotcazou@libertysurf.fr>

	PR target/13354
	* config/sparc/sparc.c (sparc_output_mi_thunk): Load DELTA
	manually if one can do that with only one instruction.


-- 
Eric Botcazou
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.270
diff -c -p -r1.270 sparc.c
*** config/sparc/sparc.c	26 Nov 2003 09:48:21 -0000	1.270
--- config/sparc/sparc.c	8 Dec 2003 22:32:57 -0000
*************** sparc_output_mi_thunk (FILE *file, tree 
*** 9085,9094 ****
    if (!SPARC_SIMM13_P (delta))
      {
        rtx scratch = gen_rtx_REG (Pmode, 1);
!       if (TARGET_ARCH64)
! 	sparc_emit_set_const64 (scratch, delta_rtx);
        else
! 	sparc_emit_set_const32 (scratch, delta_rtx);
        delta_rtx = scratch;
      }
  
--- 9085,9101 ----
    if (!SPARC_SIMM13_P (delta))
      {
        rtx scratch = gen_rtx_REG (Pmode, 1);
! 
!       if (input_operand (delta_rtx, GET_MODE (scratch)))
! 	emit_insn (gen_rtx_SET (VOIDmode, scratch, delta_rtx));
        else
! 	{
! 	  if (TARGET_ARCH64)
! 	    sparc_emit_set_const64 (scratch, delta_rtx);
! 	  else
! 	    sparc_emit_set_const32 (scratch, delta_rtx);
! 	}
! 
        delta_rtx = scratch;
      }
  

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