This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

frv flow crash on direct returns

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)

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?

Index: gcc/ChangeLog
from  Alexandre Oliva  <>

	2003-11-19  Richard Sandiford <>
	* 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_HANDLER_RTX   RETURN_ADDR_RTX (0, frame_pointer_rtx)
 /* 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
Alexandre Oliva   
Red Hat Compiler Engineer   aoliva@{,}
Free Software Evangelist  oliva@{,}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]