]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/37024 (bad tail call from tuples merge)
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Tue, 5 Aug 2008 18:23:07 +0000 (18:23 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 5 Aug 2008 18:23:07 +0000 (11:23 -0700)
2008-08-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/37024
        * tree-tailcall.c (process_assignment): Use gimple_assign_cast_p
        instead of IS_CONVERT_EXPR_CODE_P for seeing if the assignment
        is a conversion.

2008-08-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/37024
        * gcc.dg/tree-ssa/tailcall-4.c: New testcase.

From-SVN: r138735

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c [new file with mode: 0644]
gcc/tree-tailcall.c

index 7884fa833b6e96e9f2c41ee635537c9b33b58ab3..cdc4d87d10749e5cabcf8306356b905659313eb5 100644 (file)
@@ -1,3 +1,10 @@
+2008-08-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR tree-opt/37024
+       * tree-tailcall.c (process_assignment): Use gimple_assign_cast_p
+       instead of IS_CONVERT_EXPR_CODE_P for seeing if the assignment
+       is a conversion.
+
 2008-08-05  Richard Henderson  <rth@redhat.com>
 
        * Makefile.in (c-cppbuiltin.o): Depend on debug.h.
index dda2c2a34f8846b2270bcace3b49689868455c81..aae61b48eabc0688ea51e6bfc7d8d72f5ed5c62d 100644 (file)
@@ -1,3 +1,8 @@
+2008-08-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR tree-opt/37024
+       * gcc.dg/tree-ssa/tailcall-4.c: New testcase.
+
 2008-08-05  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/37026
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c
new file mode 100644 (file)
index 0000000..e7983da
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-tailc-details" } */
+/* PR tree-opt/37024 */
+
+double doubleValue();
+
+long
+longValue ()
+{
+ return (long) doubleValue ();
+}
+
+/* We should not tail call doubleValue in longValue as the mode changes. */
+/* { dg-final { scan-tree-dump-times "Found tail call" 0 "tailc"} } */
+/* { dg-final { cleanup-tree-dump "tailc" } } */
+
index 78bf1550d2b4dc245518b0e329f633051fac231e..935b41941a02655c6a54392a4c9a899b3e1c6f5a 100644 (file)
@@ -283,7 +283,7 @@ process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
     {
       /* Reject a tailcall if the type conversion might need
         additional code.  */
-      if (IS_CONVERT_EXPR_CODE_P (code)
+      if (gimple_assign_cast_p (stmt)
          && TYPE_MODE (TREE_TYPE (dest)) != TYPE_MODE (TREE_TYPE (src_var)))
        return false;