public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexandre Oliva <oliva@dcc.unicamp.br>
To: Zack Weinberg <zack@rabi.columbia.edu>
Cc: egcs@egcs.cygnus.com
Subject: Re: making aliases into the middle of a structure
Date: Fri, 30 Apr 1999 23:15:00 -0000	[thread overview]
Message-ID: <org15s33hj.fsf@lua.lbi.dcc.unicamp.br> (raw)
Message-ID: <19990430231500.6cDr5f6oxOr3Ok3Jz9MSiVKPtpIWeoRaXfdlLtL1Qg4@z> (raw)
In-Reply-To: <199904221830.OAA07523@blastula.phys.columbia.edu>

On Apr 22, 1999, Zack Weinberg <zack@rabi.columbia.edu> wrote:

> On 22 Apr 1999 15:24:46 -0300, Alexandre Oliva wrote:
>> On Apr 22, 1999, Zack Weinberg <zack@rabi.columbia.edu> wrote:
>> 
>>> extern __typeof(x.b) y __attribute__ ((alias("x.b")));
>> 
>> This can't work.  The alias attribute defines an alias to a *symbol*,
>> not to an arbitrary expression. 

> I don't see that it would be terribly hard to extend alias so it could
> handle SYMBOL_REFs and COMPONENT_REFs as well as strings.

That would probably be a good idea.  alias could accept an arbitrary
expression.  If it's an lvalue within a global symbol, it will define
an actual alias, otherwise it could just emit an error or ``construct
a temporary and bind the reference to it'', to put it in C++ terms :-) 

>> why don't you compute the offset, say, in the configure
>> script, then #define the appropriate alias string?

> Because the preprocessor can't compute offsetof() all the way down;
> I'd have to compile and run a test program.  Which loses when
> cross-compiling.

Well, you could try to extract this information from the assembly
code, or from some RTL dump (since you're bound to gcc anyway), but I
wouldn't like to be the one to implement it :-)

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Brasil
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists


  reply	other threads:[~1999-04-30 23:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-22 11:13 Zack Weinberg
1999-04-22 11:25 ` Alexandre Oliva
1999-04-22 11:30   ` Zack Weinberg
1999-04-22 11:38     ` Alexandre Oliva [this message]
1999-04-22 14:31       ` Zack Weinberg
1999-04-23 15:24         ` Richard Henderson
1999-04-23 16:27           ` Zack Weinberg
1999-04-23 16:52             ` Richard Henderson
1999-04-30 23:15               ` Richard Henderson
1999-04-30 23:15             ` Zack Weinberg
1999-04-30 23:15           ` Richard Henderson
1999-04-30 23:15         ` Zack Weinberg
1999-04-23 10:34       ` Jeffrey A Law
1999-04-23 10:40         ` Zack Weinberg
1999-04-23 15:54           ` Richard Henderson
1999-04-23 16:19             ` Zack Weinberg
1999-04-26  1:46               ` Andreas Schwab
1999-04-30 23:15                 ` Andreas Schwab
1999-04-30 23:15               ` Zack Weinberg
1999-04-30 23:15             ` Richard Henderson
1999-04-30 23:15           ` Zack Weinberg
1999-04-23 13:36         ` Jamie Lokier
1999-04-23 13:49           ` Zack Weinberg
1999-04-23 15:20             ` Jamie Lokier
1999-04-30 23:15               ` Jamie Lokier
1999-04-23 22:58             ` Andi Kleen
1999-04-30 23:15               ` Andi Kleen
1999-04-30 23:15             ` Zack Weinberg
1999-04-24 21:53           ` Jeffrey A Law
1999-04-30 23:15             ` Jeffrey A Law
1999-04-30 23:15           ` Jamie Lokier
1999-04-30 23:15         ` Jeffrey A Law
1999-04-30 23:15       ` Alexandre Oliva
1999-04-30 23:15     ` Zack Weinberg
1999-04-30 23:15   ` Alexandre Oliva
1999-04-30 23:15 ` Zack Weinberg

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=org15s33hj.fsf@lua.lbi.dcc.unicamp.br \
    --to=oliva@dcc.unicamp.br \
    --cc=egcs@egcs.cygnus.com \
    --cc=zack@rabi.columbia.edu \
    /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).