summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-11 23:39:18 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-11 23:39:18 +0000
commit3d38d682027f173c91a1d0d9bba915379fe55204 (patch)
tree1fdf08f2f933824ff175899cf21422b4eb74a5e6 /gcc
parentd84e7fa10b30d19b3b7574d1b1e2cc3dbed365ad (diff)
downloadgcc-3d38d682027f173c91a1d0d9bba915379fe55204.tar.gz
2013-01-12 Tom de Vries <tom@codesourcery.com>
PR middle-end/55890 * calls.c (expand_call): Check if arg_nr is valid. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195119 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/calls.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e5e2b8e8a4c..295e266499d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-12 Tom de Vries <tom@codesourcery.com>
+
+ PR middle-end/55890
+ * calls.c (expand_call): Check if arg_nr is valid.
+
2013-01-11 Michael Meissner <meissner@linux.vnet.ibm.com>
* doc/extend.texi (X86 Built-in Functions): Add whitespace in
diff --git a/gcc/calls.c b/gcc/calls.c
index 94628afd1e8..dd034b40099 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -3134,7 +3134,9 @@ expand_call (tree exp, rtx target, int ignore)
int arg_nr = return_flags & ERF_RETURN_ARG_MASK;
if (PUSH_ARGS_REVERSED)
arg_nr = num_actuals - arg_nr - 1;
- if (args[arg_nr].reg
+ if (arg_nr >= 0
+ && arg_nr < num_actuals
+ && args[arg_nr].reg
&& valreg
&& REG_P (valreg)
&& GET_MODE (args[arg_nr].reg) == GET_MODE (valreg))