This is the mail archive of the gcc-patches@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: RFA: Fix java/46386


Quoting Andrew Haley <aph@redhat.com>:

I am always opposed to obfuscating code in order to suppress bogus warnings.

Can I suggest

temp <<= (POINTER_SIZE > 32) ? POINTER_SIZE - 32 : 0;

Yes, that also works fine for the pdp11 build.


Currently bootstrapping on i686-pc-linux-gnu.
2010-11-09  Joern Rennecke  <amylaar@spamcop.net>
	    Andrew Haley  <aph@redhat.com>

	PR java/46386
gcc/java:
	* constants.c (build_constants_constructor): Avoid negative shift.
gcc:
	* config/pdp11/t-pdp11 (java/constants.o-warn): Remove.

Index: java/constants.c
===================================================================
--- java/constants.c	(revision 166429)
+++ java/constants.c	(working copy)
@@ -540,8 +540,8 @@ build_constants_constructor (void)
 	     FIXME: This is a kludge.  The field we're initializing is
 	     not a scalar but a union, and that's how we should
 	     represent it in the compiler.  We should fix this.  */
-	  if (BYTES_BIG_ENDIAN && POINTER_SIZE > 32)
-	    temp <<= POINTER_SIZE - 32;
+	  if (BYTES_BIG_ENDIAN)
+	    temp <<= ((POINTER_SIZE > 32) ? POINTER_SIZE - 32 : 0);
 
           CONSTRUCTOR_PREPEND_VALUE (t, get_tag_node (outgoing_cpool->tags[i]));
           CONSTRUCTOR_PREPEND_VALUE (d,
Index: config/pdp11/t-pdp11
===================================================================
--- config/pdp11/t-pdp11	(revision 166429)
+++ config/pdp11/t-pdp11	(working copy)
@@ -42,7 +42,3 @@ MULTILIB_OPTIONS = msoft-float
 # We could say "-Werror -Wno-error=type-limits", alas, not all supported
 # gcc bootstrap compilers support the latter option.
 dwarf2out.o-warn = -Wno-error
-
-# Likewise, java/constants.c:build_constants_constructor has a negative shift
-# count (in never-executed code) due to the small POINTER_SIZE.
-java/constants.o-warn = -Wno-error

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