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
This commit is contained in:
Andrew Pinski 2008-08-05 18:23:07 +00:00 committed by Andrew Pinski
parent d4ea462245
commit 7352e27c3c
4 changed files with 29 additions and 1 deletions

View 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.

View 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

View File

@ -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" } } */

View 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;