Add a testcase for the bug fixed by this patch.
From-SVN: r61509
+2003-01-20 Nick Clifton <nickc@redhat.com>
+
+ * config/arm/arm.md (sibcall_epilogue): Add an
+ UNSPEC_PROLOGUE_USE to prevent the link register from being
+ considered dead.
+
Mon Jan 20 14:36:23 CET 2003 Jan Hubicka <jh@suse.cz>
* i386.md (SSE cmov splitter): Handle memory operand in operand 5.
"
)
+;; Note - although unspec_volatile's USE all hard registers,
+;; USEs are ignored after relaod has completed. Thus we need
+;; to add an unspec of the link register to ensure that flow
+;; does not think that it is unused by the sibcall branch that
+;; will replace the standard function epilogue.
(define_insn "sibcall_epilogue"
- [(unspec_volatile [(const_int 0)] VUNSPEC_EPILOGUE)]
+ [(parallel [(unspec:SI [(reg:SI LR_REGNUM)] UNSPEC_PROLOGUE_USE)
+ (unspec_volatile [(return)] VUNSPEC_EPILOGUE)])]
"TARGET_ARM"
"*
if (USE_RETURN_INSN (FALSE))
+2003-01-20 Nick Clifton <nickc@redhat.com>
+
+ * gcc.c-torture/execute/20030117-1.c: New test case. Exposes
+ problem with ARM sibcall code generation.
+
2003-01-20 Kazu Hirata <kazu@cs.umass.edu>
* gcc.c-torture/execute/20030120-1.c: New.
--- /dev/null
+int foo (int, int, int);
+int bar (int, int, int);
+
+int main (void)
+{
+ if (foo (5, 10, 21) != 12)
+ abort ();
+
+ if (bar (9, 12, 15) != 150)
+ abort ();
+
+ exit (0);
+}
+
+int foo (int x, int y, int z)
+{
+ return (x + y + z) / 3;
+}
+
+int bar (int x, int y, int z)
+{
+ return foo (x * x, y * y, z * z);
+}