aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-18 22:43:56 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-18 22:43:56 +0000
commit0c19b89f87e1770f6cea6b50276ca0ce7dd77391 (patch)
tree100de43ef20c296303e2563a41d437fa97cfb44f
parent74e5d51875e372a0a76363df72be7236da377a76 (diff)
* Makefile.in (tree-tailcall.o): Depend on langhooks.h.
* tree-tailcall.c: Include langhooks.h. (find_tail_calls): Use types_compatible_p langhook instead of equality test of TYPE_MAIN_VARIANT. * tree-nested.c (get_chain_decl): Mark the chain decl with TREE_NO_WARNING. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@79644 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.tree-ssa10
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/tree-nested.c5
-rw-r--r--gcc/tree-tailcall.c22
4 files changed, 29 insertions, 10 deletions
diff --git a/gcc/ChangeLog.tree-ssa b/gcc/ChangeLog.tree-ssa
index a9a306e8955..a1c70ab897a 100644
--- a/gcc/ChangeLog.tree-ssa
+++ b/gcc/ChangeLog.tree-ssa
@@ -1,3 +1,13 @@
+2003-03-18 Jeff Law <law@redhat.com>
+
+ * Makefile.in (tree-tailcall.o): Depend on langhooks.h.
+ * tree-tailcall.c: Include langhooks.h.
+ (find_tail_calls): Use types_compatible_p langhook instead of
+ equality test of TYPE_MAIN_VARIANT.
+
+ * tree-nested.c (get_chain_decl): Mark the chain decl with
+ TREE_NO_WARNING.
+
2003-03-18 Devang Patel <dpatel@apple.com>
* tree-ssa-live.c (new_tree_live_info): Set num_blocks to
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index d0f0b228e3f..a10a7ce4aea 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1603,7 +1603,7 @@ tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_DUMP_H) except.h langhooks.h cfgloop.h gt-tree-cfg.h tree-pass.h
tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) function.h $(TM_H) coretypes.h \
- $(TREE_DUMP_H) diagnostic.h except.h tree-pass.h flags.h
+ $(TREE_DUMP_H) diagnostic.h except.h tree-pass.h flags.h langhooks.h
tree-nested.o: tree-nested.c $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) \
$(RTL_H) $(TM_P_H) function.h tree-dump.h tree-inline.h tree-iterator.h \
tree-simple.h cgraph.h $(EXPR_H) langhooks.h $(GGC_H) gt-tree-nested.h
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 9f5331cea17..ce4af40673f 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -307,6 +307,11 @@ get_chain_decl (struct nesting_info *info)
DECL_CONTEXT (decl) = info->context;
decl->decl.seen_in_bind_expr = 1;
+ /* The initialization of CHAIN is not visible to the tree-ssa
+ analyzers and optimizers. Thus we do not want to issue
+ warnings for CHAIN. */
+ TREE_NO_WARNING (decl) = 1;
+
/* Tell tree-inline.c that we never write to this variable, so
it can copy-prop the replacement value immediately. */
TREE_READONLY (decl) = 1;
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index b32f8998ad5..65657da250b 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "tree-pass.h"
#include "flags.h"
+#include "langhooks.h"
/* The file implements the tail recursion elimination. It is also used to
analyse the tail calls in general, passing the results to the rtl level
@@ -406,15 +407,18 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
for (param = DECL_ARGUMENTS (func), args = TREE_OPERAND (call, 1);
param && args;
param = TREE_CHAIN (param), args = TREE_CHAIN (args))
- if (param != TREE_VALUE (args)
- /* Make sure there are no problems with copying. Note we must
- have a copyable type and the two arguments must have reasonably
- equivalent types. The latter requirement could be relaxed if
- we emitted a suitable type conversion statement. */
- && (!is_gimple_reg_type (TREE_TYPE (param))
- || (TYPE_MAIN_VARIANT (TREE_TYPE (param))
- != TYPE_MAIN_VARIANT (TREE_TYPE (TREE_VALUE (args))))))
- break;
+ {
+ tree arg = TREE_VALUE (args);
+ if (param != arg
+ /* Make sure there are no problems with copying. Note we must
+ have a copyable type and the two arguments must have reasonably
+ equivalent types. The latter requirement could be relaxed if
+ we emitted a suitable type conversion statement. */
+ && (!is_gimple_reg_type (TREE_TYPE (param))
+ || !lang_hooks.types_compatible_p (TREE_TYPE (param),
+ TREE_TYPE (arg))))
+ break;
+ }
if (!args && !param)
tail_recursion = true;
}