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]

[PATCH] Fix casting in get_ref_base_and_extent


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.

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:


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