This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

optimization/964: missed warning and optimization



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]