This is the mail archive of the gcc@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: c-decl.c broken on 64-bit platforms


Andreas Jaeger <aj@suse.de> writes:

> Geoff,
>
> on x86_64-gnu-linux I get with current CVS:
>
> stage1/xgcc -Bstage1/ -B/opt/gcc/3.4-devel/x86_64-suse-linux-gnu/bin/ -c   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Werror -fno-common   -DHAVE_CONFIG_H    -I. -I. -I/usr/src/aj/cvs/gcc/gcc -I/usr/src/aj/cvs/gcc/gcc/. -I/usr/src/aj/cvs/gcc/gcc/config -I/usr/src/aj/cvs/gcc/gcc/../include  /usr/src/aj/cvs/gcc/gcc/c-common.c -o c-common.o
> /usr/src/aj/cvs/gcc/gcc/c-decl.c: In function `link_hash_hash':
> /usr/src/aj/cvs/gcc/gcc/c-decl.c:6797: warning: cast from pointer to integer of different size
> make[2]: *** [c-decl.o] Error 1
>
> The problem is this statement:
>   return (hashval_t) DECL_ASSEMBLER_NAME (x);
>
> Do you really want to use DECL_ASSEMBLER_NAME (x) and not
> IDENTIFIER_HASH_VALUE(DECL_ASSEMBLER_NAME (x)) (this might need
> link_hash_eq also?
>
> Otherwise you should cast this correctly.  Can you look into this,
> please?

To fix this I propose the appended patch.  It was
bootstrapped/regtested on x86_64-linux-gnu and I'll commit it now as
obvious to get this platform working again :-(

Andreas

2003-07-13  Andreas Jaeger  <aj@suse.de>

	* c-decl.c (link_hash_hash): Avoid warning about casting pointer
	to integer of different size.

============================================================
Index: gcc/c-decl.c
--- gcc/c-decl.c	11 Jul 2003 08:33:03 -0000	1.404
+++ gcc/c-decl.c	13 Jul 2003 20:19:16 -0000
@@ -6794,7 +6794,7 @@ static hashval_t
 link_hash_hash (const void *x_p)
 {
   tree x = (tree)x_p;
-  return (hashval_t) DECL_ASSEMBLER_NAME (x);
+  return (hashval_t) (long)DECL_ASSEMBLER_NAME (x);
 }
 
 static int

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Deutschherrnstr. 15-19, 90429 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126


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