This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix casting in get_ref_base_and_extent
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 Nov 2013 12:25:22 +0100 (CET)
- Subject: [PATCH] Fix casting in get_ref_base_and_extent
- Authentication-results: sourceware.org; auth=none
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: