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

Cross-compile bug in sparc64



There seems to be a bug when cross-compiling from sparc to sparc64.  The
code in sparc_emit_set_const32() checks to see if the values can be
generated by SPARC_SETHI_P() or SPARC_SIMM13_P(), in which case getting
here is an error because this could have been generated by a single
instruction.  

Except on a 64-bit target if that constant is negative and can be
generated by a sethi, it still needs to be sign-extended.  Here's my fix
for the problem:

Index: sparc.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/sparc/sparc.c,v
retrieving revision 1.50
diff -c -r1.50 sparc.c
*** sparc.c     1998/08/28 20:13:44     1.50
--- sparc.c     1998/08/29 18:33:55
***************
*** 1152,1158 ****
      {
        HOST_WIDE_INT value = INTVAL (op1);
  
!       if (SPARC_SETHI_P (value)
          || SPARC_SIMM13_P (value))
        abort ();
      }
--- 1152,1159 ----
      {
        HOST_WIDE_INT value = INTVAL (op1);
  
!       if (!(TARGET_ARCH64 &&
!         SPARC_SETHI_P (value))
          || SPARC_SIMM13_P (value))
        abort ();
      }


=========================================================================
Eduardo Horvath				eeh@one-o.com
	"I need to find a pithy new quote." -- me



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