From: Alexandre Oliva <aoliva@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: frv flow crash on direct returns
Date: Fri, 28 May 2004 11:25:00 -0000 [thread overview]
Message-ID: <ory8nddoal.fsf@livre.redhat.lsd.ic.unicamp.br> (raw)
[-- Attachment #1: Type: text/plain, Size: 595 bytes --]
When tree-ssa was merged, frv-elf stopped building. cmovh.c for
libgcc was what failed to build. Here's a minimized testcase:
void f(int a, int b, int c) {
if (a < b || a > b + 1)
while (c)
--c;
}
This crashed when flow for sched2 realized LR, that wasn't live
before, had become live because a direct return (that uses LR) was
inserted in postreload.
Richard Sandiford had already written a patch for what I believe to be
an earlier occurrence of this problem, back when he introduced
conditional returns. Here's the patch. I'm tempted to install it as
obvious, but... Ok?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gcc-frv-epilogue-uses-lr.patch --]
[-- Type: text/x-patch, Size: 941 bytes --]
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
2003-11-19 Richard Sandiford <rsandifo@redhat.com>
* config/frv/frv.h (EPILOGUE_USES): New. Use LR.
Index: gcc/config/frv/frv.h
===================================================================
RCS file: /cvs/uberbaum/gcc/config/frv/frv.h,v
retrieving revision 1.47
diff -u -p -r1.47 frv.h
--- gcc/config/frv/frv.h 21 May 2004 01:03:17 -0000 1.47
+++ gcc/config/frv/frv.h 28 May 2004 06:52:49 -0000
@@ -959,6 +959,8 @@ extern int target_flags;
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (SImode, STACKADJ_REGNO)
#define EH_RETURN_HANDLER_RTX RETURN_ADDR_RTX (0, frame_pointer_rtx)
+#define EPILOGUE_USES(REGNO) ((REGNO) == LR_REGNO)
+
/* An initializer that says which registers are used for fixed purposes all
throughout the compiled code and are therefore not available for general
allocation. These would include the stack pointer, the frame pointer
[-- Attachment #3: Type: text/plain, Size: 188 bytes --]
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
next reply other threads:[~2004-05-28 7:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-28 11:25 Alexandre Oliva [this message]
2004-07-29 11:34 ` Aldy Hernandez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ory8nddoal.fsf@livre.redhat.lsd.ic.unicamp.br \
--to=aoliva@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).