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: use crtstuff.c on alpha


Richard Henderson wrote:

>  /* S/390 constant pool breaks the devices in crtstuff.c to control
section
>     in where code resides.  We have to write it as asm code.  */
>  #ifndef __s390x__
>! #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
>!     asm (SECTION_OP "\n\
>!       bras\t%%r2,1f\n\
>! 0:    .long\t" USER_LABEL_PREFIX #FUNC " - 0b\n\
>  1:    l\t%%r3,0(%%r2)\n\
>!       bas\t%%r14,0(%%r3,%%r2)\n\
>!       .previous");
>  #endif

Unfortunately, this breaks s390, as in regular (non-extended) asm,
register names must be given with a single %, not %% ...

Fixed with the patch below.

Bye,
Ulrich


ChangeLog:

     * gcc/config/s390/s390.h (CRT_CALL_STATIC_FUNCTION): Fixed
     register names for regular asm () construct.


Index: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.19
diff -c -p -r1.19 s390.h
*** s390.h     2002/01/27 04:18:11 1.19
--- s390.h     2002/02/04 15:35:42
*************** extern struct rtx_def *s390_compare_op0,
*** 1301,1310 ****
  #ifndef __s390x__
  #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
      asm (SECTION_OP "\n\
!    bras\t%%r2,1f\n\
  0: .long\t" USER_LABEL_PREFIX #FUNC " - 0b\n\
! 1: l\t%%r3,0(%%r2)\n\
!    bas\t%%r14,0(%%r3,%%r2)\n\
     .previous");
  #endif

--- 1301,1310 ----
  #ifndef __s390x__
  #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
      asm (SECTION_OP "\n\
!    bras\t%r2,1f\n\
  0: .long\t" USER_LABEL_PREFIX #FUNC " - 0b\n\
! 1: l\t%r3,0(%r2)\n\
!    bas\t%r14,0(%r3,%r2)\n\
     .previous");
  #endif


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


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