aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@st.com>2005-07-22 12:15:37 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2005-07-22 13:15:37 +0100
commit475a3eef78ce1a81c2eb9e391327d4163a4f7556 (patch)
tree363ae1ad1f346c2e619e649976ddbde63a75a5f6 /gcc/calls.c
parent29c1846ba31b9d54b8b784143b14a9e93efabdb8 (diff)
downloadgcc-475a3eef78ce1a81c2eb9e391327d4163a4f7556.zip
gcc-475a3eef78ce1a81c2eb9e391327d4163a4f7556.tar.gz
gcc-475a3eef78ce1a81c2eb9e391327d4163a4f7556.tar.bz2
re PR rtl-optimization/21848 (load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError)
PR rtl-optimization/21848 * calls.c (emit_library_call_value_1): For const functions, add USEs of the stack slots to CALL_INSN_FUNCTION_USAGE. From-SVN: r102281
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index f21426f..8e87886 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -3623,6 +3623,28 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
stack_usage_map[i] = 1;
NO_DEFER_POP;
+
+ if (flags & ECF_CONST)
+ {
+ rtx use;
+
+ /* Indicate argument access so that alias.c knows that these
+ values are live. */
+ if (argblock)
+ use = plus_constant (argblock,
+ argvec[argnum].locate.offset.constant);
+ else
+ /* When arguemnts are pushed, trying to tell alias.c where
+ exactly this argument is won't work, because the
+ auto-increment causes confusion. So we merely indicate
+ that we access something with a known mode somewhere on
+ the stack. */
+ use = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx,
+ gen_rtx_SCRATCH (Pmode));
+ use = gen_rtx_MEM (argvec[argnum].mode, use);
+ use = gen_rtx_USE (VOIDmode, use);
+ call_fusage = gen_rtx_EXPR_LIST (VOIDmode, use, call_fusage);
+ }
}
}