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: [PATCH] Small vxWorks fixes for 3.3.3 branch (bug #13873) (nowagainst 3.4 branch)


Mark Haigh wrote:


2004-03-04 Mark F. Haigh <mfhaigh@acm.org>


   * longlong.h: vxWorks-related fixes.
   * config/rs6000/vxppc.h:  Add __ppc_vxworks builtin define.

<snip>


Here's a better patch (against 3.4 branch, this time) suggested by Sean McNeil. Instead of adding __ppc_vxworks to the rs6000 vxworks.h (or vxppc.h), __ppc is used for vxWorks in longlong.h, and all ocurrances of defined(PPC) have been changed to defined(__PPC__). It appears that the author of longlong.h did not realize that builtin_define_std ("PPC") surrounds the macro with __ if the macro is in the user namespace.

A couple of preprocessor conditionals in testcases that use defined(PPC) have been removed (since the test already tested for defined(__PPC__))

Once again, if there's another, better way, let me know.

Mark F. Haigh
mfhaigh@acm.org

2004-03-04 Mark F. Haigh <mfhaigh@acm.org <mailto:mfhaigh@acm.org>>

  * longlong.h: PPC macro cleanup (fixes vxWorks targets)
  * gcc/testsuite/gcc.dg/20020103-1.c: PPC macro usage changed to __PPC__
  * gcc/testsuite/gcc.dg/20020919-1.c: Same as 20020103-1.c



Index: gcc/gcc/longlong.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/longlong.h,v
retrieving revision 1.39
diff -c -3 -p -r1.39 longlong.h
*** gcc/gcc/longlong.h	21 Aug 2003 01:11:41 -0000	1.39
--- gcc/gcc/longlong.h	5 Mar 2004 05:14:02 -0000
*************** UDItype __umulsidi3 (USItype, USItype);
*** 637,652 ****
  #endif /* __ns32000__ */
  
  /* FIXME: We should test _IBMR2 here when we add assembly support for the
!    system vendor compilers.
!    FIXME: What's needed for gcc PowerPC VxWorks?  __vxworks__ is not good
!    enough, since that hits ARM and m68k too.  */
  #if (defined (_ARCH_PPC)	/* AIX */				\
       || defined (_ARCH_PWR)	/* AIX */				\
       || defined (_ARCH_COM)	/* AIX */				\
       || defined (__powerpc__)	/* gcc */				\
       || defined (__POWERPC__)	/* BEOS */				\
       || defined (__ppc__)	/* Darwin */				\
!      || defined (PPC)		/* GNU/Linux, SysV */			\
       ) && W_TYPE_SIZE == 32
  #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
    do {									\
--- 637,651 ----
  #endif /* __ns32000__ */
  
  /* FIXME: We should test _IBMR2 here when we add assembly support for the
!    system vendor compilers.  */
  #if (defined (_ARCH_PPC)	/* AIX */				\
       || defined (_ARCH_PWR)	/* AIX */				\
       || defined (_ARCH_COM)	/* AIX */				\
       || defined (__powerpc__)	/* gcc */				\
       || defined (__POWERPC__)	/* BEOS */				\
       || defined (__ppc__)	/* Darwin */				\
!      || defined (__PPC__)	/* GNU/Linux, SysV */			\
!      || defined (__ppc)		/* vxWorks */				\
       ) && W_TYPE_SIZE == 32
  #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
    do {									\
*************** UDItype __umulsidi3 (USItype, USItype);
*** 684,690 ****
    __asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
  #define COUNT_LEADING_ZEROS_0 32
  #if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
!   || defined (__ppc__) || defined (PPC)
  #define umul_ppmm(ph, pl, m0, m1) \
    do {									\
      USItype __m0 = (m0), __m1 = (m1);					\
--- 683,689 ----
    __asm__ ("{cntlz|cntlzw} %0,%1" : "=r" (count) : "r" (x))
  #define COUNT_LEADING_ZEROS_0 32
  #if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
!   || defined (__ppc__) || defined (__PPC__) || defined (__ppc)
  #define umul_ppmm(ph, pl, m0, m1) \
    do {									\
      USItype __m0 = (m0), __m1 = (m1);					\
Index: gcc/gcc/testsuite/gcc.dg/20020103-1.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/gcc.dg/20020103-1.c,v
retrieving revision 1.6
diff -c -3 -p -r1.6 20020103-1.c
*** gcc/gcc/testsuite/gcc.dg/20020103-1.c	2 Oct 2002 08:26:39 -0000	1.6
--- gcc/gcc/testsuite/gcc.dg/20020103-1.c	5 Mar 2004 05:14:07 -0000
***************
*** 8,14 ****
  #if defined(__i386__)
  #define clobber \
    asm volatile("#asm" : : : "si", "di")
! #elif defined(__powerpc__) || defined(__PPC__) || defined(__ppc__) || defined(__POWERPC__) || defined(PPC) || defined (_IBMR2)
  #define clobber \
    asm volatile("#asm" : : : "14", "15", "16", "17", "18", "19", "20", \
  	       "21", "22", "23", "24", "25", "26", "27", "28", "29")
--- 8,14 ----
  #if defined(__i386__)
  #define clobber \
    asm volatile("#asm" : : : "si", "di")
! #elif defined(__powerpc__) || defined(__PPC__) || defined(__ppc__) || defined(__POWERPC__) || defined (_IBMR2)
  #define clobber \
    asm volatile("#asm" : : : "14", "15", "16", "17", "18", "19", "20", \
  	       "21", "22", "23", "24", "25", "26", "27", "28", "29")
Index: gcc/gcc/testsuite/gcc.dg/20020919-1.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/testsuite/gcc.dg/20020919-1.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 20020919-1.c
*** gcc/gcc/testsuite/gcc.dg/20020919-1.c	2 Oct 2002 08:26:39 -0000	1.2
--- gcc/gcc/testsuite/gcc.dg/20020919-1.c	5 Mar 2004 05:14:07 -0000
***************
*** 37,43 ****
  # define REG1 "$8"
  # define REG2 "$9"
  #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
! 	|| defined (__POWERPC__) || defined (PPC) || defined (_IBMR2)
  # define REG1 "6"
  # define REG2 "7"
  # define REG3 "8"
--- 37,43 ----
  # define REG1 "$8"
  # define REG2 "$9"
  #elif defined (__powerpc__) || defined (__PPC__) || defined (__ppc__) \
! 	|| defined (__POWERPC__) || defined (_IBMR2)
  # define REG1 "6"
  # define REG2 "7"
  # define REG3 "8"

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