This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC warnings for unused global variables
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Mike Stump <mrs at apple dot com>
- Cc: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>, Richard Henderson <rth at redhat dot com>, Geoff Keating <geoffk at geoffk dot org>, jbuck at synopsys dot com, espie at quatramaran dot ens dot fr, gcc at gcc dot gnu dot org
- Date: 09 May 2003 10:11:51 +0200
- Subject: Re: GCC warnings for unused global variables
- Organization: Integrable Solutions
- References: <B8A47338-81A0-11D7-BD07-003065A77310@apple.com>
Mike Stump <mrs@apple.com> writes:
| On Friday, May 2, 2003, at 07:56 AM, Gabriel Dos Reis wrote:
| > They can be optimized out if the program cannot tell the difference.
|
| Disagree. I think the above is probably either confusing, or wrong.
| We can better well what you mean if you tell us if, in:
|
| Given:
|
| extern volatile int i;
| int main() {
| i = 1;
| i = 2;
| }
|
| can the program tell the difference?
Obviously, with no information about the definition of "i", the
compiler does not have any information necessary to infer that the
optimization is legit. Where is the problem?
-- Gaby