This is the mail archive of the
mailing list for the GCC project.
Re: [tree-ssa] bootstrap problem on powerpc-apple-darwin6.6
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: jason at redhat dot com (Jason Merrill)
- Cc: dberlin at dberlin dot org (Daniel Berlin), law at redhat dot com, pinskia at physics dot uc dot edu (Andrew Pinski), gcc at gcc dot gnu dot org
- Date: Thu, 21 Aug 2003 20:01:03 -0400 (EDT)
- Subject: Re: [tree-ssa] bootstrap problem on powerpc-apple-darwin6.6
> On Thu, 21 Aug 2003 16:53:04 -0400, Daniel Berlin <firstname.lastname@example.org> wrote:
> > This stripping you do undoes what gimple_boolify_expr did to convert it to
> > a boolean_type.
> > Then invert_truthop aborts when it tries to invert a non-boolean_type tree.
> > So either
> > 1. The conversion isn't useless, but gimplify_boolify_expr is not
> > generating the conversion in a way that makes it seem un-useless.
> > 2. The conversion isn't useless, and the above is not working like it
> > should.
> I think the conversion isn't useless, because BOOLEAN_TYPE has a (much)
> smaller range of values, which matters to invert_truthop, at least, and
> should be useful to optimizers.
Would this patch be acceptable?
It gets my by the part where I was failing.
* tree-ssa.c (tree_ssa_useless_type_conversion): Types are only equal
if they have the same min and max values.
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 220.127.116.11
diff -u -p -r18.104.22.168 tree-ssa.c
--- tree-ssa.c 20 Aug 2003 03:43:02 -0000 22.214.171.124
+++ tree-ssa.c 21 Aug 2003 23:57:51 -0000
@@ -2448,10 +2448,12 @@ tree_ssa_useless_type_conversion (tree e
/* If both the inner and outer types are integral types, then
we can enter the equivalence if they have the same mode
- and signedness. */
+ and signedness and min and max. */
else if (INTEGRAL_TYPE_P (inner_type) && INTEGRAL_TYPE_P (outer_type)
&& TYPE_MODE (inner_type) == TYPE_MODE (outer_type)
- && TREE_UNSIGNED (inner_type) == TREE_UNSIGNED (outer_type))
+ && TREE_UNSIGNED (inner_type) == TREE_UNSIGNED (outer_type)
+ && TYPE_MIN_VALUE (inner_type) == TYPE_MIN_VALUE (outer_type)
+ && TYPE_MAX_VALUE (inner_type) == TYPE_MAX_VALUE (outer_type))