From: Hans-Peter Nilsson Date: Mon, 17 Jun 2002 22:06:34 +0000 (+0000) Subject: re PR target/7042 (cris-elf miscompiles line_hints in ghostscript - "return" delay... X-Git-Tag: releases/gcc-3.1.1~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd4858461e3a015af0265baaf5cb2fa86cea06c3;p=thirdparty%2Fgcc.git re PR target/7042 (cris-elf miscompiles line_hints in ghostscript - "return" delay slot bug) PR target/7042 * config/cris/cris.c (cris_simple_epilogue): Kludge around reorg.c bug by saing that the epilogue isn't simple if there's a non-empty current_function_epilogue_delay_list. * config/cris/cris.md ("return"): Add sanity check asserting that current_function_epilogue_delay_list is empty. From-SVN: r54721 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b370ed1c62fb..3c59ce489777 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2002-06-17 Hans-Peter Nilsson + + PR target/7042 + * config/cris/cris.c (cris_simple_epilogue): Kludge around reorg.c + bug by saing that the epilogue isn't simple if there's a + non-empty current_function_epilogue_delay_list. + * config/cris/cris.md ("return"): Add sanity check asserting that + current_function_epilogue_delay_list is empty. + 2002-06-17 Richard Henderson * config/i386/i386.h (BIGGEST_FIELD_ALIGNMENT): Define instead diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index d1200ab7fc57..b4d433bece92 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -2042,6 +2042,14 @@ cris_simple_epilogue () || current_function_outgoing_args_size || current_function_calls_eh_return + /* Kludge for 3.1: when reorg changes branches to the return label + into return insns, it does not handle the case where there's a + delay list for the epilogue: it just drops the insns in + current_function_epilogue_delay_list on the floor, resulting in + invalid code. We kludge around it in that case by saying that + we don't have a simple enough epilogue to use return insns. */ + || current_function_epilogue_delay_list != NULL + /* If we're not supposed to emit prologue and epilogue, we must not emit return-type instructions. */ || !TARGET_PROLOGUE_EPILOGUE) diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index c437764fa352..0bed750c6ab1 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -3394,6 +3394,11 @@ /* Just needs to hold a 'movem [sp+],rN'. */ char rd[sizeof (\"movem [$sp+],$r99\")]; + /* Try to avoid reorg.c surprises; avoid emitting invalid code, prefer + crashing. This test would have avoided invalid code for target/7042. */ + if (current_function_epilogue_delay_list != NULL) + abort (); + *rd = 0; /* Start from the last call-saved register. We know that we have a