Patchwork Fix casting in get_ref_base_and_extent

login
register
mail settings
Submitter Richard Guenther
Date Nov. 7, 2013, 11:25 a.m.
Message ID <alpine.LNX.2.00.1311071224530.4261@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/289295/
State New
Headers show

Comments

Richard Guenther - Nov. 7, 2013, 11:25 a.m.
As noticed by Richard.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2013-11-07  Richard Biener  <rguenther@suse.de>

	* tree-dfa.c (get_ref_base_and_extent): Fix casting.

Patch

Index: gcc/tree-dfa.c
===================================================================
--- gcc/tree-dfa.c	(revision 204458)
+++ gcc/tree-dfa.c	(working copy)
@@ -569,7 +569,7 @@  get_ref_base_and_extent (tree exp, HOST_
 	      && (!bit_offset.fits_shwi ()
 		  || !host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
 		  || (bit_offset.to_shwi () + maxsize
-		      == (signed) TREE_INT_CST_LOW
+		      == (HOST_WIDE_INT) TREE_INT_CST_LOW
 		            (TYPE_SIZE (TREE_TYPE (exp))))))
 	    maxsize = -1;
 
@@ -606,7 +606,8 @@  get_ref_base_and_extent (tree exp, HOST_
       && (!bit_offset.fits_shwi ()
 	  || !host_integerp (TYPE_SIZE (TREE_TYPE (exp)), 1)
 	  || (bit_offset.to_shwi () + maxsize
-	      == (signed) TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (exp))))))
+	      == (HOST_WIDE_INT) TREE_INT_CST_LOW
+	           (TYPE_SIZE (TREE_TYPE (exp))))))
     maxsize = -1;
 
  done: