This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix build failure for mipsisa64-elf
- From: Adam Nemet <anemet at caviumnetworks dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zadeck at naturalbridge dot com
- Date: Tue, 13 May 2008 11:52:18 -0700
- Subject: Fix build failure for mipsisa64-elf
Kenneth's patch to clean up handling of pure and constant functions
(http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01796.html) leads to a crash on
mipsisa64-elf because we call end_sequence without a matching start_sequence
in emit_library_call_value_1:
...
if (flags & ECF_LIBCALL_BLOCK)
start_sequence ();
...
for (; count < nargs; count++)
{
...
/* loop.c won't look at CALL_INSN_FUNCTION_USAGE of const/pure
functions, so we have to pretend this isn't such a function. */
if (flags & ECF_LIBCALL_BLOCK)
{
rtx insns = get_insns ();
end_sequence ();
emit_insn (insns);
}
flags &= ~(ECF_CONST | ECF_PURE | ECF_LIBCALL_BLOCK);
This last line was removed which used to ensure that the code above it was
only run once and not for all arguments.
The patch below restores this without the const/pure bits.
Build and testing on mipsisa64-elf and x86_64-linux-gnu is still in progress
but if successful, is this OK to check in? Maybe obvious?
Adam
* calls.c (emit_library_call_value_1): Restore code clearing
ECF_LIBCALL_BLOCK to ensure that we only call end_sequence
once.
Index: calls.c
===================================================================
--- calls.c (revision 135252)
+++ calls.c (working copy)
@@ -3495,6 +3495,7 @@ emit_library_call_value_1 (int retval, r
end_sequence ();
emit_insn (insns);
}
+ flags &= ~ECF_LIBCALL_BLOCK;
/* If this was a CONST function, it is now PURE since it now
reads memory. */