diff options
author | Andrew Pinski <andrew_pinski@playstation.sony.com> | 2008-08-05 18:23:07 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2008-08-05 11:23:07 -0700 |
commit | 7352e27c3c4fd7992b858d9395c62c422ce798a9 (patch) | |
tree | 8ef4ec677c22f7569e7770bf72c3cc4a2a6bed5d /gcc | |
parent | d4ea462245cd9d967dce805b8b97ffe10ee30c3e (diff) | |
download | gcc-7352e27c3c4fd7992b858d9395c62c422ce798a9.zip gcc-7352e27c3c4fd7992b858d9395c62c422ce798a9.tar.gz gcc-7352e27c3c4fd7992b858d9395c62c422ce798a9.tar.bz2 |
re PR tree-optimization/37024 (bad tail call from tuples merge)
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c | 16 | ||||
-rw-r--r-- | gcc/tree-tailcall.c | 2 |
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7884fa8..cdc4d87 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dda2c2a..aae61b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..e7983da --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/tailcall-4.c @@ -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" } } */ + diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index 78bf155..935b419 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -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; |