This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix pr23046
- From: Richard Henderson <rth at redhat dot com>
- To: "James A. Morrison" <ja2morri at csclub dot uwaterloo dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 9 Aug 2005 11:03:05 -0700
- Subject: Re: [patch] Fix pr23046
- References: <kfh7jeztxyc.fsf@csclub.uwaterloo.ca>
On Sat, Aug 06, 2005 at 01:51:23AM -0400, James A. Morrison wrote:
> PR middle-end/23046
> * fold-const.c (fold_binary): Return 0 for X > TYPE_MAX_VALUE or
> X < TYPE_MIN_VALUE.
We've just discussed that it'll break Ada.
Have you tried the patch I suggested to fix this bug?
r~
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.615
diff -u -p -d -r1.615 fold-const.c
--- fold-const.c 4 Aug 2005 18:55:14 -0000 1.615
+++ fold-const.c 9 Aug 2005 18:02:40 -0000
@@ -9172,7 +9172,7 @@ fold_binary (enum tree_code code, tree t
/* Comparisons with the highest or lowest possible integer of
the specified size will have known values. */
{
- int width = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (arg1)));
+ int width = TYPE_PRECISION (TREE_TYPE (arg1));
if (TREE_CODE (arg1) == INTEGER_CST
&& ! TREE_CONSTANT_OVERFLOW (arg1)