This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
optimization/964: missed warning and optimization
- To: gcc-gnats at gcc dot gnu dot org
- Subject: optimization/964: missed warning and optimization
- From: bh at techhouse dot brown dot edu
- Date: 3 Dec 2000 00:55:02 -0000
- Reply-To: bh at techhouse dot brown dot edu
>Number: 964
>Category: optimization
>Synopsis: missed warning and optimization
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Sat Dec 02 16:56:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: bh@techhouse.brown.edu
>Release: 2.95.2
>Organization:
>Environment:
>Description:
In the code in how-to-repeat, gcc -O2 -Wall doesn't warn
about the unused variable x. It does optimize it
away.
However, it does not optimize away the entire loop, which
would be slightly nice.
>How-To-Repeat:
void foo(int n) {
int i, x;
for(i=0; i<n; i++) {
x = 1;
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: