summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-04 23:03:50 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2003-09-04 23:03:50 +0000
commit6812c89ed980d45f4988cd8e8382a54b00997bcd (patch)
tree7dc61157497f53d5f447813963c6e1bc1df6e6b4
parent08d04508a47db318960beba768d56eae1f6c5df2 (diff)
downloadgcc-6812c89ed980d45f4988cd8e8382a54b00997bcd.tar.gz
* builtins.c (apply_args_size): Guard against a NULL cfun.
(expand_builtin_apply_args_1): Likewise. (expand_builtin_apply_args_1): Likewise. (expand_builtin_apply): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71095 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/builtins.c8
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 73c0dd57727..7d2b73a5cba 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2003-09-04 DJ Delorie <dj@redhat.com>
+
+ * builtins.c (apply_args_size): Guard against a NULL cfun.
+ (expand_builtin_apply_args_1): Likewise.
+ (expand_builtin_apply_args_1): Likewise.
+ (expand_builtin_apply): Likewise.
+
2003-09-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* configure.in (gcc_cv_as_ix86_cmov_sun_syntax): Check if
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 6fa03503a9e..290fac49e8c 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -941,7 +941,7 @@ apply_args_size (void)
/* The second value is the structure value address unless this is
passed as an "invisible" first argument. */
- if (targetm.calls.struct_value_rtx (TREE_TYPE (cfun->decl), 0))
+ if (targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 0))
size += GET_MODE_SIZE (Pmode);
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
@@ -1116,7 +1116,7 @@ expand_builtin_apply_args_1 (void)
rtx registers;
int size, align, regno;
enum machine_mode mode;
- rtx struct_incoming_value = targetm.calls.struct_value_rtx (TREE_TYPE (cfun->decl), 1);
+ rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1);
/* Create a block where the arg-pointer, structure value address,
and argument registers can be saved. */
@@ -1124,7 +1124,7 @@ expand_builtin_apply_args_1 (void)
/* Walk past the arg-pointer and structure value address. */
size = GET_MODE_SIZE (Pmode);
- if (targetm.calls.struct_value_rtx (TREE_TYPE (cfun->decl), 0))
+ if (targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 0))
size += GET_MODE_SIZE (Pmode);
/* Save each register used in calling a function to the block. */
@@ -1211,7 +1211,7 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
rtx incoming_args, result, reg, dest, src, call_insn;
rtx old_stack_level = 0;
rtx call_fusage = 0;
- rtx struct_value = targetm.calls.struct_value_rtx (TREE_TYPE (cfun->decl), 0);
+ rtx struct_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 0);
#ifdef POINTERS_EXTEND_UNSIGNED
if (GET_MODE (arguments) != Pmode)