diff mbox

RFA (vax): Fix PR46740

Message ID 20101206133525.2fpyk0i04k08c04g-nzlynne@webmail.spamcop.net
State New
Headers show

Commit Message

Joern Rennecke Dec. 6, 2010, 6:35 p.m. UTC
Quoting Richard Henderson <rth@redhat.com>:

> On 12/06/2010 09:21 AM, Joern Rennecke wrote:
>> +#else
>> +	      gcc_assert (hval == 0);
>
> Does it cause more problems to simply transform that #if
> into a normal C if?  Nothing in that block looks as if it
> would generate a warning on a 64-bit host...

Indeed, that builds fine too.
Although n could be larger than than 31+26 at runtime, we
wouldn't execute the out-of-range shift.
2010-12-06  Joern Rennecke  <amylaar@spamcop.net>
	    Richard Henderson  <rth@redhat.com>

	PR target/46740
	* config/vax/vax.c (vax_output_int_move): Fold #if into if.

Comments

Richard Henderson Dec. 6, 2010, 7:06 p.m. UTC | #1
On 12/06/2010 10:35 AM, Joern Rennecke wrote:
> 2010-12-06  Joern Rennecke  <amylaar@spamcop.net>
> 	    Richard Henderson  <rth@redhat.com>
> 
> 	PR target/46740
> 	* config/vax/vax.c (vax_output_int_move): Fold #if into if.

Ok.


r~
diff mbox

Patch

Index: config/vax/vax.c
===================================================================
--- config/vax/vax.c	(revision 167494)
+++ config/vax/vax.c	(working copy)
@@ -1129,18 +1129,16 @@  vax_output_int_move (rtx insn ATTRIBUTE_
 	    {
 	      lval >>= n;
 
-#if HOST_BITS_PER_WIDE_INT == 32
 	      /* On 32bit platforms, if the 6bits didn't overflow into the
 		 upper 32bit value that value better be 0.  If we have
 		 overflowed, make sure it wasn't too much.  */
-	      if (hval != 0)
+	      if (HOST_BITS_PER_WIDE_INT == 32 && hval != 0)
 		{
 		  if (n <= 26 || hval >= ((unsigned)1 << (n - 26)))
 		    n = 0;	/* failure */
 		  else
 		    lval |= hval << (32 - n);
 		}
-#endif
 	      /*  If n is 0, then ashq is not the best way to emit this.  */
 	      if (n > 0)
 		{