public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/4919: gcse inhibits loop optimization
@ 2001-11-16 23:39 ottoni
0 siblings, 0 replies; 3+ messages in thread
From: ottoni @ 2001-11-16 23:39 UTC (permalink / raw)
To: gcc-gnats
>Number: 4919
>Category: optimization
>Synopsis: gcse inhibits loop optimization
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Wed Nov 21 06:26:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Guilherme Ottoni
>Release: gcc version 3.1 20011029 (experimental)
>Organization:
>Environment:
RedHat Linux 6.2 running on a PC (K6-II)
>Description:
Compiling with gcc -O2 the source attached, the loop optimizer fails to detect
BIVs, and so misses the opportunity to apply all the loop
optimizations. If you add the -no-gcse flag to the command line,
the loop optimizer works properly.
To check what the loop optimizer is doing, I'm looking at
the debug file generated by -dL.
>How-To-Repeat:
Simply compile the source attached, with -O2, and with and
without the -fno-gcse. Then look at the .loop debug files to
check the problem.
I'm using a dsp16xx target, but I think this problem will occur
with any target, as it is before the backend.
>Fix:
Maybe enhancing the BIV detection method to get the BIVs in
these cases. Another (dirty) solution would be to inhibit the
GCSE to optimize the code in the LOOP_CONT.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="cc2001.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="cc2001.c"
bWFpbigpCnsKICBpbnQgIGksIGF2ZywgYVsxMDBdLCBlcnJvcjsKICBmb3IgKGk9MDsgaSA8IDkw
OyBpKyspCiAgewogICAgaWYgKGklMikKICAgIHsgCiAgICAgIGF2ZyArPSBhW2krMV0gPDwgMjsK
ICAgICAgYVtpKzJdID0gYXZnICogMzsKICAgIH0KICAgIGlmIChhdmcgPCBlcnJvcikKICAgICAg
YXZnIC09IGFbaSsxXSAtIGVycm9yLzI7CiAgICBlbHNlCiAgICAgIGF2ZyAtPSBhW2krMl0gLSBl
cnJvcjsKICB9Cn0KCg==
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: optimization/4919: gcse inhibits loop optimization
@ 2001-11-21 3:43 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2001-11-21 3:43 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR optimization/4919; it has been noted by GNATS.
From: rth@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, ottoni@ic.unicamp.br
Cc:
Subject: Re: optimization/4919: gcse inhibits loop optimization
Date: 27 Nov 2001 07:03:49 -0000
Synopsis: gcse inhibits loop optimization
State-Changed-From-To: open->suspended
State-Changed-By: rth
State-Changed-When: Mon Nov 26 23:03:48 2001
State-Changed-Why:
GCSE did exactly what it was supposed to do -- the expression
I+1, which appears twice in the body of the loop, is partially
redundant with the increment of I at the end of the loop.
This isn't really a problem with GCSE, but with the extreme lameness
of our loop optimizer. Hopefully we'll have time to rewrite it from
scratch for gcc 3.2; Jan Hubicka has already volunteered to try.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4919&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: optimization/4919: gcse inhibits loop optimization
@ 2001-11-21 3:36 rth
0 siblings, 0 replies; 3+ messages in thread
From: rth @ 2001-11-21 3:36 UTC (permalink / raw)
To: gcc-bugs, gcc-gnats, gcc-prs, nobody, ottoni
Synopsis: gcse inhibits loop optimization
State-Changed-From-To: open->suspended
State-Changed-By: rth
State-Changed-When: Mon Nov 26 23:03:48 2001
State-Changed-Why:
GCSE did exactly what it was supposed to do -- the expression
I+1, which appears twice in the body of the loop, is partially
redundant with the increment of I at the end of the loop.
This isn't really a problem with GCSE, but with the extreme lameness
of our loop optimizer. Hopefully we'll have time to rewrite it from
scratch for gcc 3.2; Jan Hubicka has already volunteered to try.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=4919&database=gcc
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-11-27 7:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-16 23:39 optimization/4919: gcse inhibits loop optimization ottoni
2001-11-21 3:36 rth
2001-11-21 3:43 rth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).