Article View: comp.unix.programmer
Article #3680Re: gcc -O2 bug
From: Orc
Date: Sat, 10 Aug 1996 00:00
Date: Sat, 10 Aug 1996 00:00
50 lines
3048 bytes
3048 bytes
In article <839695541snz@genesis.demon.co.uk>,
Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
>In article <4uhp4i$pmu@pell.pell.chi.il.us> orc@pell.chi.il.us "Orc" writes:
>
>...
>
>>... but not smart enough to know that flag can be manipulated by a
>>signal driven function while the loop is running.
>
>It is smart enough to know that the language says it doesn't have to
>worry about this. Instead it can concentrate on generatingh efficient
>code.
It's a matter of opinion. I happen to agree with the ANSI committee
that it's not something that happens enough to worry about, but you'll
have to quote chapter and verse if you're going to say that the
'language says it doesn't have to worry about this' when you attempt
to agree with me as your crushing rebuttal.
>> Isn't optimization
>>fun? My first reaction, if I was still writing compilers, to assigning
>>a variable's address to a global would be to treat the variable as a
>>volatile from there on in, but I'm sure I could independently come up
>>with pretty much the same reasons as the ANSI committee did for why
>>that's not necessarily a good thing.
>
>This simply comes down to knowing the language that you are programming
>in.
Don't be stupid. Read up on 'noalias' if you want to see some of the
thinking that's gone into what's allowable and not; and when you're
done with that, please reread the quoted section of my post again,
paying careful attention this time to the phrases '... My first reaction
...' and '... but I'm sure I could independently come up with ...' The
business of developing a standard isn't just sitting around waiting for
the Hand Of God to deliver the first draft to you on neatly typed
parchment; people do, as I pointed out in my post, need to think about
the consequences of allowing and disallowing certain types of behavior.
>C is quite clear about what you are allowed to do in signal handlers.
In a ANSI conformant run-time library, possibly. Pity none of them
exist, isn't it? (*)
____
david parsons \bi/ (* And this is why the damned standard was written in
\/ the first place.)
Technical Details
Message-ID:
<4ujuup$4aq@pell.pell.chi.il.us>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<4ubnat$75u@freeside.fc.net> <danpop.839541415@news.cern.ch> <4uhp4i$pmu@pell.pell.chi.il.us> <839695541snz@genesis.demon.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,7d30cae02ba9b089 X-Google-Attributes: gid11318c,public X-Google-Thread: 10c696,7d30cae02ba9b089 X-Google-Attributes: gid10c696,public X-Google-Thread: fc89c,7d30cae02ba9b089 X-Google-Attributes: gidfc89c,public X-Google-Thread: 1014db,7d30cae02ba9b089 X-Google-Attributes: gid1014db,public From: orc@pell.chi.il.us (Orc) Subject: Re: gcc -O2 bug Date: 1996/08/10 Message-ID: <4ujuup$4aq@pell.pell.chi.il.us> X-Deja-AN: 173479194 references: <4ubnat$75u@freeside.fc.net> <danpop.839541415@news.cern.ch> <4uhp4i$pmu@pell.pell.chi.il.us> <839695541snz@genesis.demon.co.uk> followup-to: comp.lang.c summary: Is there a comp.lang.c.flames group yet? organization: Fluffiness is the true Tao newsgroups: comp.unix.programmer,gnu.gcc.help,comp.os.linux.development.apps,comp.lang.c