This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/53539: Different __WCHAR_TYPE__/wchar_t for gcc -m32 on Linux/i386 and Linux/x86-64
- From: Jakub Jelinek <jakub at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Uros Bizjak <ubizjak at gmail dot com>
- Date: Thu, 31 May 2012 15:50:49 +0200
- Subject: Re: PATCH: PR target/53539: Different __WCHAR_TYPE__/wchar_t for gcc -m32 on Linux/i386 and Linux/x86-64
- References: <20120531133519.GA7948@intel.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, May 31, 2012 at 06:35:19AM -0700, H.J. Lu wrote:
> This patch makes __WCHAR_TYPE__/wchar_t the same for gcc -m32 on
> Linux/i386 and Linux/x86-64. OK for trunk?
That looks wrong. For Linux/i386, the 32-bit only compiler should be
the standard, rather than x86_64 -m32 if they differ.
So, IMHO you should keep gnu-user.h as is, and just use
#define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
in gcc/config/i386/x86-64.h.
> 2012-05-31 H.J. Lu <hongjiu.lu@intel.com>
>
> PR target/53539
> * config/i386/gnu-user.h (WCHAR_TYPE): Use "int".
> (WCHAR_TYPE_SIZE): Set to 32.
>
> diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
> index 9020be9..f88cbad 100644
> --- a/gcc/config/i386/gnu-user.h
> +++ b/gcc/config/i386/gnu-user.h
> @@ -53,10 +53,10 @@ along with GCC; see the file COPYING3. If not see
> #define PTRDIFF_TYPE "int"
>
> #undef WCHAR_TYPE
> -#define WCHAR_TYPE "long int"
> +#define WCHAR_TYPE "int"
>
> #undef WCHAR_TYPE_SIZE
> -#define WCHAR_TYPE_SIZE BITS_PER_WORD
> +#define WCHAR_TYPE_SIZE 32
>
> /* Provide a LINK_SPEC appropriate for GNU userspace. Here we provide support
> for the special GCC options -static and -shared, which allow us to
Jakub