diff mbox

PATCH: PR target/53539: Different __WCHAR_TYPE__/wchar_t for gcc -m32 on Linux/i386 and Linux/x86-64

Message ID 20120531133519.GA7948@intel.com
State New
Headers show

Commit Message

H.J. Lu May 31, 2012, 1:35 p.m. UTC
Hi,

This patch makes __WCHAR_TYPE__/wchar_t the same for gcc -m32 on
Linux/i386 and Linux/x86-64.  OK for trunk?

Thanks.


H.J.
----
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.

Comments

Jakub Jelinek May 31, 2012, 1:50 p.m. UTC | #1
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
diff mbox

Patch

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