From: Ulrich Weigand <uweigand@de.ibm.com>
To: rth@redhat.com
Cc: gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org,
ebotcazou@libertysurf.fr, jh@suse.cz
Subject: Re: [cft] subreg validation patch
Date: Tue, 16 Nov 2004 14:03:00 -0000 [thread overview]
Message-ID: <200411161345.iAGDjm7R023667@53v30g15.boeblingen.de.ibm.com> (raw)
I wrote:
>Richard Henderson <rth@redhat.com> wrote on 11/15/2004 11:02:32 PM:
>
>> Hmm. How about lowpart_subreg? At least then we won't wind up
>> with nested subregs.
>
>src is guaranteed to satisfy REG_P at this point, so this shouldn't
>be an issue. (Also, regmove.c already uses gen_lowpart_SUBREG at
>another similar location.)
On second thought, you're probably right: gen_lowpart_SUBREG may
abort (with your change), and we certainly don't want that here.
So I've changed the patch to use lowpart_subreg, and just ignore
that move if the subreg cannot be generated.
Bootstraped/regtested on s390-ibm-linux and s390x-ibm-linux
(with your patch applied as well).
OK for mainline?
Bye,
Ulrich
ChangeLog:
* regmove.c (regmove_optimize): Use lowpart_subreg instead of
gen_rtx_SUBREG with incorrect offset to compute SRC_SUBREG.
Index: gcc/regmove.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
retrieving revision 1.164
diff -c -p -r1.164 regmove.c
*** gcc/regmove.c 9 Oct 2004 19:19:24 -0000 1.164
--- gcc/regmove.c 16 Nov 2004 11:44:46 -0000
*************** regmove_optimize (rtx f, int nregs, FILE
*** 1150,1159 ****
&& GET_MODE_SIZE (GET_MODE (dst))
>= GET_MODE_SIZE (GET_MODE (SUBREG_REG (dst))))
{
- src_subreg
- = gen_rtx_SUBREG (GET_MODE (SUBREG_REG (dst)),
- src, SUBREG_BYTE (dst));
dst = SUBREG_REG (dst);
}
if (!REG_P (dst)
|| REGNO (dst) < FIRST_PSEUDO_REGISTER)
--- 1150,1160 ----
&& GET_MODE_SIZE (GET_MODE (dst))
>= GET_MODE_SIZE (GET_MODE (SUBREG_REG (dst))))
{
dst = SUBREG_REG (dst);
+ src_subreg = lowpart_subreg (GET_MODE (dst),
+ src, GET_MODE (src));
+ if (!src_subreg)
+ continue;
}
if (!REG_P (dst)
|| REGNO (dst) < FIRST_PSEUDO_REGISTER)
--
Dr. Ulrich Weigand
Linux on zSeries Development
Ulrich.Weigand@de.ibm.com
next reply other threads:[~2004-11-16 13:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-16 14:03 Ulrich Weigand [this message]
2004-11-16 21:02 ` Richard Henderson
2004-11-17 1:01 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
2004-11-14 18:03 Ulrich Weigand
2004-11-15 20:12 ` Richard Henderson
2004-11-15 22:02 ` Ulrich Weigand
2004-11-15 22:08 ` Richard Henderson
2004-11-15 23:22 ` Ulrich Weigand
2004-11-13 13:17 Non-representable subregs of subword pseudoregs Eric Botcazou
2004-11-13 23:06 ` [cft] subreg validation patch Richard Henderson
2004-11-13 23:50 ` Eric Botcazou
2004-11-14 0:02 ` Richard Henderson
2004-11-14 0:21 ` Eric Botcazou
2004-11-14 4:41 ` Richard Henderson
2004-11-14 5:12 ` Richard Henderson
2004-11-14 6:14 ` Geert Bosch
2004-11-14 7:46 ` Richard Henderson
2004-11-14 10:50 ` Eric Botcazou
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=200411161345.iAGDjm7R023667@53v30g15.boeblingen.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=ebotcazou@libertysurf.fr \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=jh@suse.cz \
--cc=rth@redhat.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).