re PR tree-optimization/16864 (Segmentation fault during tree tail call elimination)
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
Thu, 5 Aug 2004 08:41:57 +0000 (10:41 +0200)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Thu, 5 Aug 2004 08:41:57 +0000 (08:41 +0000)
PR tree-optimization/16864
* tree-tailcall.c (eliminate_tail_call): Do not create phi nodes
for ssa names without default_def.

From-SVN: r85597

gcc/ChangeLog
gcc/tree-tailcall.c

index 5df219577c69351729c78607fec008b8953ca11a..f0e761752649ec4a0617056722ccf9d2af1e5e84 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-05  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+
+       PR tree-optimization/16864
+       * tree-tailcall.c (eliminate_tail_call): Do not create phi nodes
+       for ssa names without default_def.
+
 2004-08-05  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/i386/i386.c (ix86_expand_prologue): If the function uses a
index 6599cbd09e2c30c2db875937807258608e481ff6..6e1957c597d3c9b1684ac2f6ca969f83bb9be87d 100644 (file)
@@ -730,7 +730,17 @@ eliminate_tail_call (struct tailcall *t)
       if (!phi)
        {
          tree name = var_ann (param)->default_def;
-         tree new_name = make_ssa_name (param, SSA_NAME_DEF_STMT (name));
+         tree new_name;
+
+         if (!name)
+           {
+             /* It may happen that the tag does not have a default_def in case
+                when all uses of it are dominated by a MUST_DEF.  This however
+                means that it is not necessary to add a phi node for this
+                tag.  */
+             continue;
+           }
+         new_name = make_ssa_name (param, SSA_NAME_DEF_STMT (name));
 
          var_ann (param)->default_def = new_name;
          phi = create_phi_node (name, first);