aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2001-08-31 19:28:58 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2001-08-31 19:28:58 +0000
commit6268b92246a83813217648665eaf168eb02e19ba (patch)
tree8afdefe1e9cfb70759b18ad75b6e1227c520dd36 /gcc
parent78b411667a29f42bce0465466b017d06d3091f5b (diff)
downloadgcc-6268b92246a83813217648665eaf168eb02e19ba.zip
gcc-6268b92246a83813217648665eaf168eb02e19ba.tar.gz
gcc-6268b92246a83813217648665eaf168eb02e19ba.tar.bz2
calls.c (emit_library_call_value): Don't use a fixed argument after VA_CLOSE, i.e.
* calls.c (emit_library_call_value): Don't use a fixed argument after VA_CLOSE, i.e. out of scope in traditional C. * emit-rtl.c (gen_rtvec): Likewise. From-SVN: r45332
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/calls.c7
-rw-r--r--gcc/emit-rtl.c7
3 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f4037ca..8caa502 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2001-08-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * calls.c (emit_library_call_value): Don't use a fixed
+ argument after VA_CLOSE, i.e. out of scope in traditional C.
+
+ * emit-rtl.c (gen_rtvec): Likewise.
+
+2001-08-31 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
* Makefile.in (c-pragma.o): Depend on output.h.
(reorg.o): Depend on except.h.
diff --git a/gcc/calls.c b/gcc/calls.c
index 275ca1d..8d6d084 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -4227,6 +4227,8 @@ emit_library_call_value VPARAMS((rtx orgfun, rtx value,
enum libcall_type fn_type,
enum machine_mode outmode, int nargs, ...))
{
+ rtx result;
+
VA_OPEN (p, nargs);
VA_FIXEDARG (p, rtx, orgfun);
VA_FIXEDARG (p, rtx, value);
@@ -4234,11 +4236,12 @@ emit_library_call_value VPARAMS((rtx orgfun, rtx value,
VA_FIXEDARG (p, enum machine_mode, outmode);
VA_FIXEDARG (p, int, nargs);
- value = emit_library_call_value_1 (1, orgfun, value, fn_type, outmode, nargs, p);
+ result = emit_library_call_value_1 (1, orgfun, value, fn_type, outmode,
+ nargs, p);
VA_CLOSE (p);
- return value;
+ return result;
}
#if 0
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 379bfb6..d04e3d2 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -517,7 +517,7 @@ gen_rtx VPARAMS ((enum rtx_code code, enum machine_mode mode, ...))
rtvec
gen_rtvec VPARAMS ((int n, ...))
{
- int i;
+ int i, save_n;
rtx *vector;
VA_OPEN (p, n);
@@ -530,9 +530,12 @@ gen_rtvec VPARAMS ((int n, ...))
for (i = 0; i < n; i++)
vector[i] = va_arg (p, rtx);
+
+ /* The definition of VA_* in K&R C causes `n' to go out of scope. */
+ save_n = n;
VA_CLOSE (p);
- return gen_rtvec_v (n, vector);
+ return gen_rtvec_v (save_n, vector);
}
rtvec