diff options
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/inline-1.c | 25 | ||||
-rw-r--r-- | gcc/tree-inline.c | 4 |
4 files changed, 42 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8d1e6d07413..39489118b60 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2006-06-19 Andrew Pinski <pinskia@gmail.com> + + PR middle-end/28075 + * tree-inline.c (setup_one_parameter): Strip useless + type conversion before adding it to the IR. + (declare_return_variable): Likewise. + 2006-06-19 Martin Michlmayr <tbm@cyrius.com> PR c/27149 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 50ead2ca946..96c86287785 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2006-06-19 Anatoly Sokolov <aesok@post.ru> +2006-06-19 Andrew Pinski <pinskia@gmail.com> + + PR middle-end/28075 + * gcc.dg/tree-ssa/inline-1.c: New test. + +2006-06-19 Anatoly Sokolov <aesok@post.ru> * gcc.dg/pr18241-1.c: Use __SIZE_TYPE__ instead of unsigned long in malloc prototype; remove XFAIL. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c new file mode 100644 index 00000000000..bbf7e83aacf --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-1.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ + + +typedef struct { + double min; + double max; +} interval; +inline interval add(interval x, interval y) __attribute__((always_inline)); +inline interval add(interval x, interval y) +{ + interval r; + r.min = x.min + y.min; + r.max = x.max + y.max; + return r; +} +interval foo (interval a, interval b, interval c) +{ + return add (a, add (b, c)); +} + + +/* { dg-final { scan-tree-dump-times "\(struct interval\)" 0 "final_cleanup"} } */ +/* { dg-final { cleanup-tree-dump "final_cleanup" } } */ + diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 3aeb7b61341..4749be519e3 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1081,6 +1081,8 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn, if (rhs == error_mark_node) return; + + STRIP_USELESS_TYPE_CONVERSION (rhs); /* We want to use MODIFY_EXPR, not INIT_EXPR here so that we keep our trees in gimple form. */ @@ -1267,6 +1269,8 @@ declare_return_variable (copy_body_data *id, tree return_slot_addr, use = var; if (!lang_hooks.types_compatible_p (TREE_TYPE (var), caller_type)) use = fold_convert (caller_type, var); + + STRIP_USELESS_TYPE_CONVERSION (use); done: /* Register the VAR_DECL as the equivalent for the RESULT_DECL; that |