public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: Catherine Moore <clm@codesourcery.com>,  binutils@sourceware.org
Subject: Re: [PATCH 2.5/4 v2] GAS: Make new fake labels when cloning a symbol
Date: Mon, 01 Nov 2010 21:32:00 -0000	[thread overview]
Message-ID: <87r5f4d92p.fsf@firetop.home> (raw)
In-Reply-To: <alpine.DEB.1.10.1011011201550.27998@tp.orcam.me.uk> (Maciej	W. Rozycki's message of "Mon, 1 Nov 2010 12:23:15 +0000 (GMT)")

"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> On Sat, 30 Oct 2010, Richard Sandiford wrote:
>> Looks good.  However, 
>> 
>> gcc (Debian 4.4.4-8) 4.4.5 20100728 (prerelease)
>> 
>> complains about so-called aliasing violations on these calls:
>> 
>> > +  S_SET_NAME (&dot_symbol, ".");
>> > +  S_SET_FORWARD_REF (&dot_symbol);
>> 
>> It's inlining the calls and warning about the local case, which obviously
>> doesn't apply here.  I know it's not usually good practice to recode to
>> avoid bogus warnings, but let's use:
>> 
>>   dot_symbol.bsym->name = ".";
>>   dot_symbol.sy_forward_ref = 1;
>> 
>> anyway.
>
>  Hmm, TBH I didn't like the way these structs are type-punned from the 
> very first moment I realised what was going on here, but GCC 4.3.2 doesn't 
> seem as picky, so I let it be.  The complaint about the risk of alias 
> violations with these structs is IMO legitimate; if not here, then 
> elsewhere.  And since this is 2.22 material anyway, how about we do this 
> properly and convert symbolS to make it a union of the two cases: local 
> and external?  I mean:
>
> union symbol
> {
>   struct local_symbol l;
>   struct external_symbol e;
> };
> typedef union symbol symbolS;
>
> where "struct local_symbol" would remain unchanged and the current "struct 
> symbol" would become "struct external_symbol".
>
>  I realise syntactically that's going to be an extensive change, but 
> mostly if not entirely mechanical and will improve the overall quality of 
> code involved.  And if anytime, freshly after a release branch has been 
> forked off is I think the best moment to make such changes.  What do you 
> think?

Sounds good, but please don't let it get in the way of applying this patch
(when the time comes).  The change above seems entirely in keeping with
the way that abs_symbol is initialised.

Richard

  reply	other threads:[~2010-11-01 21:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 10:47 [PATCH 2/4] " Maciej W. Rozycki
2010-07-31  8:59 ` Richard Sandiford
2010-08-27 12:11   ` Maciej W. Rozycki
2010-08-30 17:53     ` Richard Sandiford
2010-10-29 14:37 ` [PATCH 2.0/4 v2] GAS: Only clone equated symbols on a final reference Maciej W. Rozycki
2010-10-30  9:56   ` Richard Sandiford
2010-12-01 20:35     ` Maciej W. Rozycki
2010-10-29 14:38 ` [PATCH 2.5/4 v2] GAS: Make new fake labels when cloning a symbol Maciej W. Rozycki
2010-10-30 10:01   ` Richard Sandiford
2010-11-01 12:23     ` Maciej W. Rozycki
2010-11-01 21:32       ` Richard Sandiford [this message]
2010-12-01 21:34         ` Maciej W. Rozycki
2010-12-02 10:00           ` Jie Zhang
2010-12-02 17:01           ` Richard Earnshaw
2010-12-02 23:19             ` Maciej W. Rozycki
2010-12-03 10:58               ` Richard Sandiford
2010-12-03 16:20                 ` Maciej W. Rozycki
2010-12-03 16:47                   ` Richard Sandiford

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=87r5f4d92p.fsf@firetop.home \
    --to=rdsandiford@googlemail.com \
    --cc=binutils@sourceware.org \
    --cc=clm@codesourcery.com \
    --cc=macro@codesourcery.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).