------- Comment #8 from rguenth at gcc dot gnu dot org  2007-06-26 20:45 -------
So, without touching all the frontends we can try to lower constraints checked
at gimplification time to what is actually needed to avoid the ICE during
inlining.  Which is to make sure that the actual parameter is convertible to
the type of the parameter declaration using a NOP_EXPR conversion.  Which the
following (nearly) implements:

@@ -2134,15 +2134,17 @@ gimplify_call_expr (tree *expr_p, tree *

   /* Verify if the type of the argument matches that of the function
      declaration.  If we cannot verify this or there is a mismatch,
-     mark the call expression so it doesn't get inlined later.  */
+     mark the call expression so it doesn't get inlined later.
+     This is needed to make sure we can convert the call expression
+     arguments to the inlined parameter declarations using a NOP_EXPR.  */
   if (parms)
     {
       for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
        if (!p
            || TREE_VALUE (p) == error_mark_node
            || CALL_EXPR_ARG (*expr_p, i) == error_mark_node
-           || !lang_hooks.types_compatible_p
-                (TREE_TYPE (CALL_EXPR_ARG (*expr_p, i)), TREE_VALUE (p)))
+           || TREE_CODE (TREE_TYPE (CALL_EXPR_ARG (*expr_p, i)))
+              != TREE_CODE (TREE_VALUE (p)))
          {
            CALL_CANNOT_INLINE_P (*expr_p) = 1;
            break;
@@ -2155,8 +2157,8 @@ gimplify_call_expr (tree *expr_p, tree *
        if (!p
            || p == error_mark_node
            || CALL_EXPR_ARG (*expr_p, i) == error_mark_node
-           || !lang_hooks.types_compatible_p
-                (TREE_TYPE (CALL_EXPR_ARG (*expr_p, i)), TREE_TYPE (p)))
+           || TREE_CODE (TREE_TYPE (CALL_EXPR_ARG (*expr_p, i)))
+              != TREE_CODE (TREE_TYPE (p)))
          {
            CALL_CANNOT_INLINE_P (*expr_p) = 1;
            break;

I'll come up with a predicate to compute this in a more precise way, like
fold_convertible_p.  I also know Honza is working on a different approach.


-- 


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

Reply via email to