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: pinskia at physics dot uc dot edu (Andrew Pinski), dberlin at dberlin dot org (Daniel Berlin), law at redhat dot com, gcc at gcc dot gnu dot org
- Date: Thu, 21 Aug 2003 22:30:55 -0400 (EDT)
- Subject: Re: [tree-ssa] bootstrap problem on powerpc-apple-darwin6.6
> On Thu, 21 Aug 2003 20:01:03 -0400 (EDT), Andrew Pinski <email@example.com> wrote:
> > + && TYPE_MIN_VALUE (inner_type) == TYPE_MIN_VALUE (outer_type)
> > + && TYPE_MAX_VALUE (inner_type) == TYPE_MAX_VALUE (outer_type))
> These are trees, which can't be reliably compared with ==. It's probably
> simpler to just compare TYPE_PRECISION.
You are right I should have checked to make sure that they were not trees.
Here is a newer patch which compares the TYPE_PRECISION and it adds some commentary
about the problem so this part will not be reverted or if we see another place we
can point them to here.
* tree-ssa.c (tree_ssa_useless_type_conversion): Check also the precision of
the type to make sure they are really useless type conversions.
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 22 Aug 2003 02:27:07 -0000
@@ -2448,10 +2448,15 @@ 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 precision (The type _Bool can have size of 4
+ (only happens on powerpc-darwin right now but can happen on any
+ target that defines BOOL_TYPE_SIZE to be INT_TYPE_SIZE) and a
+ precision of 1 while unsigned int is the same expect for a
+ precision of 4 so testing of precision is nessary). */
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_PRECISION (inner_type) == TYPE_PRECISION (outer_type))