aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2003-03-03 16:28:23 -0500
committerJason Merrill <jason@gcc.gnu.org>2003-03-03 16:28:23 -0500
commitd1a74aa7d3e30682a3e667a92671b668115e1426 (patch)
tree741f86ca04374ed16b82d6c1d12f545600129dc5 /gcc
parentd44cc4047b5ec4cb74a77f4bc46e6438d83f1ed5 (diff)
downloadgcc-d1a74aa7d3e30682a3e667a92671b668115e1426.zip
gcc-d1a74aa7d3e30682a3e667a92671b668115e1426.tar.gz
gcc-d1a74aa7d3e30682a3e667a92671b668115e1426.tar.bz2
tree-inline.c (find_builtin_longjmp_call): Save and restore lineno and input_filename.
* tree-inline.c (find_builtin_longjmp_call): Save and restore lineno and input_filename. (find_alloca_call): Likewise. (inlinable_function_p): Run the langhook earlier. * calls.c (compute_argument_addresses): Give the new MEMs a minimum alignment of PARM_BOUNDARY. cp/ * decl.c (start_function): Clear DECL_NUM_STMTS. * class.c (get_vtable_decl): Use vtbl_type_node. (build_primary_vtable): Check for it. From-SVN: r63733
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/calls.c3
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/class.c5
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/tree-inline.c22
6 files changed, 41 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dcfe1f9..058e788 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2003-03-03 Jason Merrill <jason@redhat.com>
+
+ * tree-inline.c (find_builtin_longjmp_call): Save and restore
+ lineno and input_filename.
+ (find_alloca_call): Likewise.
+ (inlinable_function_p): Run the langhook earlier.
+
+ * calls.c (compute_argument_addresses): Give the new MEMs a
+ minimum alignment of PARM_BOUNDARY.
+
Mon Mar 3 20:45:25 2003 J"orn Rennecke <joern.rennecke@superh.com>
* config/sh/sh.h (EXTRA_SPECS): Add subtarget_asm_relax_spec and
diff --git a/gcc/calls.c b/gcc/calls.c
index 31550af..57470b2 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1634,6 +1634,7 @@ compute_argument_addresses (args, argblock, num_actuals)
addr = plus_constant (addr, arg_offset);
args[i].stack = gen_rtx_MEM (args[i].mode, addr);
+ set_mem_align (args[i].stack, PARM_BOUNDARY);
set_mem_attributes (args[i].stack,
TREE_TYPE (args[i].tree_value), 1);
@@ -1644,6 +1645,7 @@ compute_argument_addresses (args, argblock, num_actuals)
addr = plus_constant (addr, arg_offset);
args[i].stack_slot = gen_rtx_MEM (args[i].mode, addr);
+ set_mem_align (args[i].stack_slot, PARM_BOUNDARY);
set_mem_attributes (args[i].stack_slot,
TREE_TYPE (args[i].tree_value), 1);
@@ -4578,7 +4580,6 @@ store_one_arg (arg, argblock, flags, variable_size, reg_parm_stack_space)
return sibcall_failure;
}
-
/* Nonzero if we do not know how to pass TYPE solely in registers.
We cannot do so in the following cases:
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f9fb1f5..fd21b5a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2003-03-03 Jason Merrill <jason@redhat.com>
+
+ * decl.c (start_function): Clear DECL_NUM_STMTS.
+
+ * class.c (get_vtable_decl): Use vtbl_type_node.
+ (build_primary_vtable): Check for it.
+
2003-03-02 Aldy Hernandez <aldyh@redhat.com>
* decl.c (check_initializer): Check for vector_opaque_p.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 89c11e6..f5d7ec5 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -533,7 +533,7 @@ get_vtable_decl (tree type, int complete)
if (CLASSTYPE_VTABLES (type))
return CLASSTYPE_VTABLES (type);
- decl = build_vtable (type, get_vtable_name (type), void_type_node);
+ decl = build_vtable (type, get_vtable_name (type), vtbl_type_node);
CLASSTYPE_VTABLES (type) = decl;
/* At one time the vtable info was grabbed 2 words at a time. This
@@ -594,8 +594,7 @@ build_primary_vtable (tree binfo, tree type)
}
else
{
- my_friendly_assert (TREE_CODE (TREE_TYPE (decl)) == VOID_TYPE,
- 20000118);
+ my_friendly_assert (TREE_TYPE (decl) == vtbl_type_node, 20000118);
virtuals = NULL_TREE;
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 216d7fe..832a2d5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13554,6 +13554,9 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
/* Start the statement-tree, start the tree now. */
begin_stmt_tree (&DECL_SAVED_TREE (decl1));
+ /* Don't double-count statements in templates. */
+ DECL_NUM_STMTS (decl1) = 0;
+
/* Let the user know we're compiling this function. */
announce_function (decl1);
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 5b5e775..77b7baf 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -895,7 +895,12 @@ static tree
find_alloca_call (exp)
tree exp;
{
- return walk_tree (&exp, find_alloca_call_1, NULL, NULL);
+ int line = lineno;
+ const char *file = input_filename;
+ tree ret = walk_tree (&exp, find_alloca_call_1, NULL, NULL);
+ lineno = line;
+ input_filename = file;
+ return ret;
}
static tree
@@ -921,7 +926,12 @@ static tree
find_builtin_longjmp_call (exp)
tree exp;
{
- return walk_tree (&exp, find_builtin_longjmp_call_1, NULL, NULL);
+ int line = lineno;
+ const char *file = input_filename;
+ tree ret = walk_tree (&exp, find_builtin_longjmp_call_1, NULL, NULL);
+ lineno = line;
+ input_filename = file;
+ return ret;
}
/* Returns nonzero if FN is a function that can be inlined into the
@@ -942,6 +952,11 @@ inlinable_function_p (fn, id)
if (DECL_UNINLINABLE (fn))
return 0;
+ /* Check this now so that we instantiate C++ templates before reading
+ DECL_NUM_STMTS. */
+ if ((*lang_hooks.tree_inlining.cannot_inline_tree_fn) (&fn))
+ return 0;
+
/* Assume it is not inlinable. */
inlinable = 0;
@@ -1022,9 +1037,6 @@ inlinable_function_p (fn, id)
}
}
- if (inlinable && (*lang_hooks.tree_inlining.cannot_inline_tree_fn) (&fn))
- inlinable = 0;
-
/* If we don't have the function body available, we can't inline
it. */
if (! DECL_SAVED_TREE (fn))