🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3671

Re: gcc -O2 bug

#3671
From: Danette & Murray Root
Date: Fri, 09 Aug 1996 00:00
24 lines
1640 bytes
On 8 Aug 1996 21:51:37 +0100, guenter@castle.dinoco.de (Heinz Guenter
Scharf) wrote in comp.lang.c:


=>I have had a look at the assembler output of the optimized and the
unoptimized
=>compiler run. The optimization puts the flag into a register and
tests if it is
=>zero, the non optimized versions look into the stackmemory, so if
the signal-
=>routine changes the contents of the memory, the optimized version
doesn't
=>notify anything. The calling of an external function forces the
compiler to
=>reload the contents of the flag because the compiler cannot assume,
that the
=>register sare all saved. A solution could be to create a sourcefile
with a dummy
=>function with a parameter, or to disable temporarely the
optimization.

Why not just use the keyword 'volatile' ? Does gcc not support it?
(pardon me - I don't [currently] use gcc).
Technical Details
Message-ID: <4uej66$14rg@mule0.mindspring.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4ubnat$75u@freeside.fc.net> <4udk0p$3li@castle.dinoco.de>

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: mroot@atl.mindspring.com (Danette & Murray Root)
Subject: Re: gcc -O2 bug
Date: 1996/08/09
Message-ID: <4uej66$14rg@mule0.mindspring.com>
X-Deja-AN: 173072198
references: <4ubnat$75u@freeside.fc.net> <4udk0p$3li@castle.dinoco.de>
organization: MindSpring Enterprises
reply-to: mroot@atl.mindspring.com
newsgroups: comp.unix.programmer,gnu.gcc.help,comp.os.linux.development.apps,comp.lang.c