This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] longlong: fix sh -Wundef builds
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "aoliva at redhat dot com" <aoliva at redhat dot com>, "kkojima at gcc dot gnu dot org" <kkojima at gcc dot gnu dot org>, "olegendo at gcc dot gnu dot org" <olegendo at gcc dot gnu dot org>
- Date: Fri, 8 Jan 2016 06:54:19 +0900
- Subject: Re: [PATCH] longlong: fix sh -Wundef builds
- Authentication-results: sourceware.org; auth=none
- References: <1452195588-9455-1-git-send-email-vapier at gentoo dot org>
On Jan 8, 2016, at 4:39 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> This file fails when building for SuperH as it assumes __SHMEDIA__ is
> always defined. Update the code to check if it's defined.
This is OK for trunk. Thanks for spotting it.
Cheers,
Oleg
> ---
> include/longlong.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/longlong.h b/include/longlong.h
> index d7ef671..78042d7 100644
> --- a/include/longlong.h
> +++ b/include/longlong.h
> @@ -1086,7 +1086,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
> } while (0)
> #endif
>
> -#if defined(__sh__) && !__SHMEDIA__ && W_TYPE_SIZE == 32
> +#if defined(__sh__) && (!defined (__SHMEDIA__) || !__SHMEDIA__) && W_TYPE_SIZE == 32
> #ifndef __sh1__
> #define umul_ppmm(w1, w0, u, v) \
> __asm__ ( \
> @@ -1159,7 +1159,7 @@ extern UDItype __umulsidi3 (USItype, USItype);
>
> #endif /* __sh__ */
>
> -#if defined (__SH5__) && __SHMEDIA__ && W_TYPE_SIZE == 32
> +#if defined (__SH5__) && (!defined (__SHMEDIA__) || !__SHMEDIA__) && W_TYPE_SIZE == 32
> #define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
> #define count_leading_zeros(count, x) \
> do \
> --
> 2.6.2
>