public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][AArch64] LR register not used in leaf functions
@ 2014-09-22 15:43 Kugan
  2014-09-22 15:58 ` Jiong Wang
  0 siblings, 1 reply; 12+ messages in thread
From: Kugan @ 2014-09-22 15:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Marcus Shawcroft, Richard Earnshaw

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

AArch64 has the same issue ARM had where the LR register was not used in
leaf functions. This was reported in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017. In AArch64, this
test-case need to be added with more live ranges for the need for the
LR_REGNUM. i.e test-case in the PR needs additional loops up to r31 for
the case AArch64 to see this.

The same fix (from the thread
https://gcc.gnu.org/ml/gcc-patches/2011-04/msg02191.html) which went
into ARM should apply to AArch64 as well. Regression tested on qemu for
aarch64-none-linux-gnu with no new regressions. Is this OK for trunk?

Thanks,
Kugan


gcc/ChangeLog:

2014-09-23  Kugan Vivekanandarajah  <kuganv@linaro.org>

	* config/aarch64/aarch64.h (EPILOGUE_USES): Return true only after
	epilogue_completed is true.

[-- Attachment #2: p.txt --]
[-- Type: text/plain, Size: 549 bytes --]

diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index db950da..b3e4585 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -309,7 +309,7 @@ extern unsigned long aarch64_tune_flags;
    considered live at the start of the called function.  */
 
 #define EPILOGUE_USES(REGNO) \
-  ((REGNO) == LR_REGNUM)
+  (epilogue_completed && (REGNO) == LR_REGNUM)
 
 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
    the stack pointer does not matter.  The value is tested only in

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-11-15 19:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22 15:43 [PATCH][AArch64] LR register not used in leaf functions Kugan
2014-09-22 15:58 ` Jiong Wang
2014-09-27 21:20   ` Kugan
2014-09-30 15:00     ` Jiong Wang
2014-10-01  8:00       ` Kugan
2014-11-04 10:56         ` Jiong Wang
2014-11-11 14:52       ` Marcus Shawcroft
2014-11-15  0:52       ` Andrew Pinski
2014-11-15 15:27         ` Jiong Wang
2014-11-15 15:49           ` Andrew Pinski
2014-11-15 16:37             ` Andrew Pinski
2014-11-15 20:29               ` Jiong Wang

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).