]> gcc.gnu.org Git - gcc.git/commitdiff
re PR tree-optimization/17749 (ICE with recursive function)
authorZdenek Dvorak <dvorakz@suse.cz>
Thu, 7 Oct 2004 14:21:15 +0000 (16:21 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Thu, 7 Oct 2004 14:21:15 +0000 (14:21 +0000)
PR tree-optimization/17749
* tree-tailcall.c (find_tail_calls): Check that parameter is
a gimple_reg.

From-SVN: r88689

gcc/ChangeLog
gcc/tree-tailcall.c

index 64241c1608c386c271200e8e28f4bf47c6feb0c0..1b6cb7cf11606dfe018e076c69fc48c6b523de07 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-07  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       PR tree-optimization/17749
+       * tree-tailcall.c (find_tail_calls): Check that parameter is
+       a gimple_reg.
+
 2004-10-07  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/ia64/ia64.c: Fix a comment typo.
index a6c44933f79e634265721f772c6cdcfcbffbdf9b..158a2d1d6fb2f2e71086020f344c4b24a9755316 100644 (file)
@@ -431,15 +431,27 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
           param = TREE_CHAIN (param), args = TREE_CHAIN (args))
        {
          tree arg = TREE_VALUE (args);
-         if (param != arg
-             /* Make sure there are no problems with copying.  Note we must
+         if (param != arg)
+           {
+             /* Make sure there are no problems with copying.  The parameter
                 have a copyable type and the two arguments must have reasonably
                 equivalent types.  The latter requirement could be relaxed if
                 we emitted a suitable type conversion statement.  */
-             && (!is_gimple_reg_type (TREE_TYPE (param))
+             if (!is_gimple_reg_type (TREE_TYPE (param))
                  || !lang_hooks.types_compatible_p (TREE_TYPE (param),
-                                                    TREE_TYPE (arg))))
-           break;
+                                                    TREE_TYPE (arg)))
+               break;
+
+             /* The parameter should be a real operand, so that phi node
+                created for it at the start of the function has the meaning
+                of copying the value.  This test implies is_gimple_reg_type
+                from the previous condition, however this one could be
+                relaxed by being more careful with copying the new value
+                of the parameter (emitting appropriate MODIFY_EXPR and
+                updating the virtual operands).  */
+             if (!is_gimple_reg (param))
+               break;
+           }
        }
       if (!args && !param)
        tail_recursion = true;
This page took 0.077019 seconds and 5 git commands to generate.