From: Aldy Hernandez <aldyh@redhat.com>
To: Dale Johannesen <dalej@apple.com>
Cc: gcc@gcc.gnu.org
Subject: Re: subreg question
Date: Thu, 13 Dec 2001 10:33:00 -0000 [thread overview]
Message-ID: <m37krr2dfl.fsf@litecycle.cc.andrews.edu> (raw)
In-Reply-To: <112A6238-EF6C-11D5-86F6-003065C86F94@apple.com>
>>>>> "Dale" == Dale Johannesen <dalej@apple.com> writes:
> What cases of subreg are supposed to be handled exactly?
> double x(float y) {
> double z;
> *((float *)&z) = y; <-- boo!
> return z; }
i believe this is invalid code, hence implementation dependent. You
can't access an lvalue as a different type as it was declared.
Try unions.
> On ppc, the rtl for the store after purge_addressof looks like:
> (insn 36 12 17 (set (subreg:SF (reg/v:DF 118) 0)
> (reg:SF 121)) -1 (nil)
> (nil))
> This seems to work (118 eventually gets resolved to memory) despite
> an explicit statement in rtl.texi that it is invalid. Is it really?
> The original case involved Altivec vectors, which as you recall are
> 16 bytes:
> vector signed char v;
> int i;
> *((int *)&v) = i;
ditto here. I don't think you can do this.-- well, should.
Aldy
next prev parent reply other threads:[~2001-12-13 18:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-12 18:13 Dale Johannesen
2001-12-13 1:39 ` Jan Hubicka
2001-12-13 10:33 ` Aldy Hernandez [this message]
2001-12-13 12:26 ` Dale Johannesen
2001-12-13 12:39 ` Daniel Jacobowitz
2001-12-13 12:45 ` Dale Johannesen
2001-12-13 12:51 ` Daniel Jacobowitz
2001-12-13 13:04 ` Dale Johannesen
2001-12-13 13:33 ` Daniel Jacobowitz
2001-12-13 13:34 ` Aldy Hernandez
2001-12-13 14:56 ` Richard Henderson
2001-12-13 13:04 ` Aldy Hernandez
2001-12-13 14:57 ` Joe Buck
2008-03-25 14:56 Jan Hoogerbrugge
2008-03-25 15:58 ` Paul Brook
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=m37krr2dfl.fsf@litecycle.cc.andrews.edu \
--to=aldyh@redhat.com \
--cc=dalej@apple.com \
--cc=gcc@gcc.gnu.org \
/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).