This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

optimization/9553: No induction variable elimination


>Number:         9553
>Category:       optimization
>Synopsis:       No induction variable elimination
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 03 20:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     binsh00@hotmail.com
>Release:        gcc (GCC) 3.3 20030129 (prerelease)
>Organization:
>Environment:
Debian GNU/Linux (unstable)

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  gcc            3.2.2-0        The GNU C compiler.
>Description:
int a[20];
int b[20];
 
void
f()
{
    int i1, i2;
 
    for (i1 = 0, i2 = 0; i1 < 20; ++i1)
        a[i1] = b[i2++];
}

In the above code i2 equals i1 and can be eliminated.

% /usr/lib/gcc-snapshot/bin/gcc -Wall -O3 -S -o - bug.c

[...]
        xorl    %edx, %edx
        xorl    %ecx, %ecx
        .p2align 2,,3
.L6:
        movl    b(,%ecx,4), %eax
        movl    %eax, a(,%edx,4)
        incl    %edx
        incl    %ecx
        cmpl    $19, %edx
        jle     .L6
[...]
>How-To-Repeat:

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