public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] lower-bitint: Force some arrays corresponding to large/huge _BitInt SSA_NAMEs to BLKmode
Date: Thu, 18 Jan 2024 12:11:43 +0100	[thread overview]
Message-ID: <ZakHb0fml5uwrdIQ@tucnak> (raw)
In-Reply-To: <ZakFFeCEv0GtG/TC@tucnak>

And
--- gcc/expr.cc.jj	2024-01-12 10:07:58.194851657 +0100
+++ gcc/expr.cc	2024-01-18 12:08:16.412147569 +0100
@@ -12382,6 +12382,21 @@ expand_expr_real_1 (tree exp, rtx target
 	  }
       }
 
+      /* Ensure non-BLKmode array VAR_DECLs VCEd to BLKmode BITINT_TYPE
+	 aren't promoted to registers.  */
+      if (op0 == NULL_RTX
+	  && mode == BLKmode
+	  && TREE_CODE (type) == BITINT_TYPE
+	  && modifier == EXPAND_NORMAL
+	  && VAR_P (treeop0)
+	  && DECL_MODE (treeop0) != BLKmode)
+	{
+	  op0 = expand_expr_real (treeop0, NULL_RTX, VOIDmode, EXPAND_MEMORY,
+				  NULL, inner_reference_p);
+	  if (MEM_P (op0))
+	    op0 = adjust_address (op0, BLKmode, 0);
+	}
+
       if (!op0)
 	op0 = expand_expr_real (treeop0, NULL_RTX, VOIDmode, modifier,
 				NULL, inner_reference_p);
helps at -O0, but doesn't at -O2, where even EXPAND_MEMORY doesn't actually
cause MEM_P result, it is still forced into a REG.

	Jakub


  reply	other threads:[~2024-01-18 11:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18  7:26 Jakub Jelinek
2024-01-18  7:27 ` Richard Biener
2024-01-18 11:01   ` Jakub Jelinek
2024-01-18 11:11     ` Jakub Jelinek [this message]
2024-01-18 12:16     ` Richard Biener
2024-01-18 12:32       ` Jakub Jelinek
2024-01-18 12:34         ` Richard Biener
2024-01-18 12:46           ` Jakub Jelinek
2024-01-18 12:57             ` Richard Biener
2024-01-18 13:13               ` Jakub Jelinek
2024-01-18 13:18                 ` Jakub Jelinek
2024-01-18 13:36                   ` Richard Biener

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=ZakHb0fml5uwrdIQ@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).