This is the mail archive of the gcc-bugs@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]

[Bug middle-end/17793] [4.0 Regression] Ada bootstrap failure


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2004-10-14 19:18 -------
> The integer_type's are not compatible by defined by the front-end, why?

The front-end generates a correct tree (with a NOP_EXPR) but it is stripped by
the gimplifier:

      /* Strip away as many useless type conversions as possible
	 at the toplevel.  */
      STRIP_USELESS_TYPE_CONVERSION (*expr_p);


A quick fix is therefore the following:

Index: gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gimplify.c,v
retrieving revision 2.82
diff -u -p -r2.82 gimplify.c
--- gimplify.c	30 Sep 2004 01:22:05 -0000	2.82
+++ gimplify.c	14 Oct 2004 15:24:57 -0000
@@ -4156,7 +4156,7 @@ gimplify_one_sizepos (tree *expr_p, tree
 static bool
 cpt_same_type (tree a, tree b)
 {
-  if (lang_hooks.types_compatible_p (a, b))
+  if (a == b || lang_hooks.types_compatible_p (a, b))
     return true;
 
   /* ??? The C++ FE decomposes METHOD_TYPES to FUNCTION_TYPES and doesn't
@@ -4179,7 +4179,8 @@ cpt_same_type (tree a, tree b)
   if (POINTER_TYPE_P (a) && POINTER_TYPE_P (b))
     return cpt_same_type (TREE_TYPE (a), TREE_TYPE (b));
 
-  return false;
+  /* STRIP_USELESS_TYPE_CONVERSION uses this predicate.  */
+  return tree_ssa_useless_type_conversion_1 (a, b);
 }
 
 /* Check for some cases of the front end missing cast expressions.


However I'm not sure it is not papering over something else.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
          Component|ada                         |middle-end
 GCC target triplet|powerpc-darwin, powerpc-    |powerpc-*, sparc-*
                   |linux                       |
            Summary|[4.0 Regression] Ada front- |[4.0 Regression] Ada
                   |end causing bootstrap       |bootstrap failure
                   |failure                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17793


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