public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Cc: ebotcazou@adacore.com, richard.sandiford@arm.com
Subject: [PATCH][RFC] target/61810 - disable init-regs pass on targets using LRA
Date: Wed, 11 Aug 2021 16:33:15 +0200 (CEST)	[thread overview]
Message-ID: <6n3q8srs-o88-qpo5-834q-r42493o06pr@fhfr.qr> (raw)

This patch disables the init-regs pass on targets using LRA.
It's not clear as to what issue the init-regs papers over and
most definitely LRA should get it right.  This leaves targets
still using reload unaffected but will expose any such LRA
bug if it exists, allowing it to be identified and fixed.

The change can cause testsuite fallout since the explicit
initializations can have an effect on passes like combine.
For example on x86_64 this results in

+FAIL: gcc.target/i386/extract-insert-combining.c scan-assembler-times (?:vmovd|
movd)[ \\\\t]+[^{\\n]*%xmm[0-9] 3
+FAIL: gcc.target/i386/extract-insert-combining.c scan-assembler-times (?:vpinsr
d|pinsrd)[ \\\\t]+[^{\\n]*%xmm[0-9] 1

it also results in yet unanalyzed

+FAIL: gnat.dg/sso8.adb execution test

I welcome trying this change on other architectures, like
for example 'arm' that's singled out in the init-regs comments
as affected architecture.

Bootstrapped and tested on x86_64-unknown-linux-gnu with all languages
and {,-m32} with the above remaining fallout (I fixed another
testism already).

2021-08-11  Richard Biener  <rguenther@suse.de>

	PR target/61810
	* init-regs.c (pass_initialize_regs::gate): Gate on
	targetm.lra_p ().
---
 gcc/init-regs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/init-regs.c b/gcc/init-regs.c
index 72e898f3e33..8f038f54fff 100644
--- a/gcc/init-regs.c
+++ b/gcc/init-regs.c
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "memmodel.h"
 #include "emit-rtl.h"
 #include "expr.h"
+#include "target.h"
 #include "tree-pass.h"
 
 /* Check all of the uses of pseudo variables.  If any use that is MUST
@@ -153,7 +154,7 @@ public:
   {}
 
   /* opt_pass methods: */
-  virtual bool gate (function *) { return optimize > 0; }
+  virtual bool gate (function *) { return optimize > 0 && !targetm.lra_p (); }
   virtual unsigned int execute (function *)
     {
       initialize_uninitialized_regs ();
-- 
2.31.1

                 reply	other threads:[~2021-08-11 14:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6n3q8srs-o88-qpo5-834q-r42493o06pr@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    /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).