🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3679

Re: gcc -O2 bug

#3679
From: Lawrence Kirby
Date: Sat, 10 Aug 1996 00:00
27 lines
1971 bytes
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.

>  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. C is quite clear about what you are allowed to do in signal handlers.

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Technical Details
Message-ID: <839695541snz@genesis.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4ubnat$75u@freeside.fc.net> <danpop.839504721@news.cern.ch> <vkohklaizj.fsf@atari.connectinc.com> <danpop.839541415@news.cern.ch> <4uhp4i$pmu@pell.pell.chi.il.us>

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: Lawrence Kirby <fred@genesis.demon.co.uk>
Subject: Re: gcc -O2 bug
Date: 1996/08/10
Message-ID: <839695541snz@genesis.demon.co.uk>
X-Deja-AN: 173391329
x-nntp-posting-host: genesis.demon.co.uk
references: <4ubnat$75u@freeside.fc.net> <danpop.839504721@news.cern.ch> <vkohklaizj.fsf@atari.connectinc.com> <danpop.839541415@news.cern.ch> <4uhp4i$pmu@pell.pell.chi.il.us>
x-mail2news-path: genesis.demon.co.uk
organization: none
reply-to: fred@genesis.demon.co.uk
newsgroups: comp.unix.programmer,gnu.gcc.help,comp.os.linux.development.apps,comp.lang.c