public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR target/48240
@ 2020-04-08 14:18 Andrea Corallo
  2020-04-08 16:26 ` Richard Sandiford
  2020-04-08 16:33 ` Kyrylo Tkachov
  0 siblings, 2 replies; 16+ messages in thread
From: Andrea Corallo @ 2020-04-08 14:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

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

Hi all,

I'd like to submit this for PR48240.

Bootstrapped on aarch64-unknown-linux-gnu.
Okay for trunk when finished with regression?

Andrea

gcc/ChangeLog

2020-??-??  Andrea Corallo  <andrea.corallo@arm.com>

	PR target/48240
	* gcc/config/aarch64/falkor-tag-collision-avoidance.c
	(valid_src_p): Fix missing rtx type check.

gcc/testsuite/ChangeLog

2020-??-??  Andrea Corallo  <andrea.corallo@arm.com>

	* gcc.target/aarch64/pr48240.c: New test.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-pr48240.patch --]
[-- Type: text/x-diff, Size: 1633 bytes --]

From 246337341a8b58c61dc29d2198b244da737b3ef0 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>
Date: Wed, 8 Apr 2020 13:38:28 +0100
Subject: [PATCH] pr48240

---
 gcc/config/aarch64/falkor-tag-collision-avoidance.c | 9 ++++++---
 gcc/testsuite/gcc.target/aarch64/pr48240.c          | 9 +++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/aarch64/pr48240.c

diff --git a/gcc/config/aarch64/falkor-tag-collision-avoidance.c b/gcc/config/aarch64/falkor-tag-collision-avoidance.c
index 719df484ee61..4e07a43282f7 100644
--- a/gcc/config/aarch64/falkor-tag-collision-avoidance.c
+++ b/gcc/config/aarch64/falkor-tag-collision-avoidance.c
@@ -538,9 +538,12 @@ valid_src_p (rtx src, rtx_insn *insn, struct loop *loop, bool *pre_post,
   if (!aarch64_classify_address (&addr, XEXP (x, 0), mode, true))
     return false;
 
-  unsigned regno = REGNO (addr.base);
-  if (global_regs[regno] || fixed_regs[regno])
-    return false;
+  if (REG_P (addr.base))
+    {
+      unsigned regno = REGNO (addr.base);
+      if (global_regs[regno] || fixed_regs[regno])
+	return false;
+    }
 
   if (addr.type == ADDRESS_REG_WB)
     {
diff --git a/gcc/testsuite/gcc.target/aarch64/pr48240.c b/gcc/testsuite/gcc.target/aarch64/pr48240.c
new file mode 100644
index 000000000000..012af6afeca7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr48240.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-v -Os -mcpu=falkor -mpc-relative-literal-loads -mcmodel=large" } */
+
+extern void bar(const char *);
+
+void foo(void) {
+  for (;;)
+    bar("");
+}
-- 
2.17.1


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

end of thread, other threads:[~2020-04-20 12:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-08 14:18 [PATCH] PR target/48240 Andrea Corallo
2020-04-08 16:26 ` Richard Sandiford
2020-04-09  7:26   ` Andrea Corallo
2020-04-08 16:33 ` Kyrylo Tkachov
2020-04-09  7:55   ` Andrea Corallo
2020-04-09  8:57     ` [committed] PR target/94530 (was [PATCH] PR target/48240) Andrea Corallo
2020-04-10 20:05       ` Christophe Lyon
2020-04-14 10:00         ` [PATCH]aarch64: falkor-tag-collision-avoidance.c fix valid_src_p for use of uninitialized value Andrea Corallo
2020-04-14 16:55           ` Kyrylo Tkachov
2020-04-14 17:02             ` Andrea Corallo
2020-04-15  8:46               ` [PATCH V2]aarch64: " Andrea Corallo
2020-04-15 11:23                 ` Kyrylo Tkachov
2020-04-15 13:09                   ` Andrea Corallo
2020-04-16  8:01                     ` Andrea Corallo
2020-04-20  8:04                       ` Kyrylo Tkachov
2020-04-20 12:32                         ` Andrea Corallo

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