[PATCH] incorrect __vxworks__ usage in longlong.h

David Edelsohn dje@watson.ibm.com
Wed, 30 Jul 2003 13:45:19 -0400


	Bug report appended.  Patch applied to GCC below.

David


        * longlong.h (PowerPC umul_ppmm): Do not test __vxworks__.

Index: longlong.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/longlong.h,v
retrieving revision 1.36
diff -c -p -r1.36 longlong.h
*** longlong.h	2 Apr 2003 19:33:22 -0000	1.36
--- longlong.h	30 Jul 2003 17:38:58 -0000
*************** UDItype __umulsidi3 (USItype, USItype);
*** 647,653 ****
    __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 (__vxworks__)
  #define umul_ppmm(ph, pl, m0, m1) \
    do {									\
      USItype __m0 = (m0), __m1 = (m1);					\
--- 647,653 ----
    __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);					\

------- Forwarded Message

From: "Zack Weinberg" <zack@codesourcery.com>
To: Ken Faiczak <kfaiczak@sandvine.com>
Cc: "'gcc@gnu.org'" <gcc@gnu.org>
Subject: Re: incorrect __vxworks__ usage in longlong.h (3.3) was ok in 3.2.3
References: <FE045D4D9F7AED4CBFF1B3B813C8533702857267@mail.sandvine.com>
Date: Wed, 30 Jul 2003 10:24:00 -0700
In-Reply-To: <FE045D4D9F7AED4CBFF1B3B813C8533702857267@mail.sandvine.com> (Ken
 Faiczak's message of "Wed, 30 Jul 2003 12:20:43 -0400")

Ken Faiczak <kfaiczak@sandvine.com> writes:

> Not sure how this creeped in but it breaks all vxworks builds
> for anything else other than PPC (in my case MIPS)
>
> it really needs to be removed.
> better to force the vxworks build to define __powerpc__ or something like
> that
> than to break the compiler for all vxworks builds that define stuff
> before this point in the file..

GCC 3.3 defines _ARCH_PPC for a vxworks/ppc compiler, so you should be
able to just remove the reference to __vxworks__ from the second
#ifdef.  A patch to that effect is pre-approved.

The bug was introduced by this change:

  revision 1.30
  date: 2002/08/27 14:55:41;  author: dje;  state: Exp;  lines: +88 -80
  branches:  1.30.2;  1.30.4;
        * longlong.h: Import current PowerPC defintion from GMP-4.1.

so I would encourage you to raise this issue with the GMP maintainers
as well; they probably have the bug in their version of this file.

zw

------- End of Forwarded Message