Fix casting in get_ref_base_and_extent

Submitted by Richard Guenther on Nov. 7, 2013, 11:25 a.m.

Details

Message ID alpine.LNX.2.00.1311071224530.4261@zhemvz.fhfr.qr
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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: