https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #35 from Richard Biener ---
Author: rguenth
Date: Wed Dec 19 11:10:08 2018
New Revision: 267262
URL: https://gcc.gnu.org/viewcvs?rev=267262=gcc=rev
Log:
2018-12-19 Richard Biener
PR tree-optimization/88533
Revert
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
Richard Biener changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Known to work|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #33 from Richard Biener ---
Author: rguenth
Date: Mon Apr 30 07:23:36 2018
New Revision: 259754
URL: https://gcc.gnu.org/viewcvs?rev=259754=gcc=rev
Log:
2018-04-30 Richard Biener
PR
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
amker at gcc dot gnu.org changed:
What|Removed |Added
CC||amker at gcc dot gnu.org
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
bin.cheng changed:
What|Removed |Added
CC||amker.cheng at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #30 from Zack Weinberg ---
It's been a very long time and I don't know exactly what changed, but GCC 7.3
generates essentially the same code for both of the functions in the "C test
case" and I would not describe that code as "bad".
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
Eric Gallager changed:
What|Removed |Added
CC||egallager at gcc dot gnu.org
---
--- Comment #28 from rakdver at gcc dot gnu dot org 2006-08-16 21:14
---
Subject: Bug 28364
Author: rakdver
Date: Wed Aug 16 21:14:11 2006
New Revision: 116189
URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=116189
Log:
PR tree-optimization/28364
*
--- Comment #27 from rakdver at gcc dot gnu dot org 2006-07-26 19:38
---
Patch for the wrong choice of induction variable:
http://gcc.gnu.org/ml/gcc-patches/2006-07/msg01125.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #26 from rakdver at gcc dot gnu dot org 2006-07-25 15:20
---
A patch for the return in the middle of the loop problem:
http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00893.html
(to be commited once mainline is open).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #25 from rakdver at gcc dot gnu dot org 2006-07-18 00:45
---
Created an attachment (id=11906)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11906action=view)
A patch for loop header selection.
I tried improving the heuristics for the selection of the loop header,
--
rakdver at gcc dot gnu dot org changed:
What|Removed |Added
AssignedTo|unassigned at gcc dot gnu |rakdver at gcc dot gnu dot
|dot org
--- Comment #18 from rakdver at atrey dot karlin dot mff dot cuni dot cz
2006-07-13 07:58 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
I-cache.
this only matters if this increase in code size will make the code go
out
--- Comment #19 from rakdver at atrey dot karlin dot mff dot cuni dot cz
2006-07-13 08:01 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
I-cache.
this only matters if this increase in code size will make the code go
out
--- Comment #20 from zackw at panix dot com 2006-07-13 08:25 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
However, ch isn't just copying the loop header; it is also
copying the *entire body of the loop*, which nothing can
--- Comment #21 from zackw at panix dot com 2006-07-13 08:28 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
on your real program, how much performance do you gain by hand-rewriting
the assembler to look the way you like?
--- Comment #22 from rguenth at gcc dot gnu dot org 2006-07-13 08:28
---
For practical purposes (determining the loop runs at least once) it needs to
duplicate the exit condition. Which happens to be difficult here, as there are
multiple loop exits.
--
--- Comment #23 from rakdver at atrey dot karlin dot mff dot cuni dot cz
2006-07-13 09:00 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
on your real program, how much performance do you gain by hand-rewriting
the
--- Comment #24 from rakdver at atrey dot karlin dot mff dot cuni dot cz
2006-07-13 09:03 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
However, ch isn't just copying the loop header; it is also
copying the *entire body
--- Comment #1 from zackw at panix dot com 2006-07-12 22:33 ---
Created an attachment (id=11874)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11874action=view)
assembly output (bad on top, hand-corrected below)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #2 from pinskia at gcc dot gnu dot org 2006-07-12 22:41 ---
Loop-Copy header is doing it Which means there is a confusion at what is the
real header of the loop here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #3 from zackw at panix dot com 2006-07-12 22:42 ---
I should mention that the exact command line flags were -O2
-fomit-frame-pointer -march=pentium4, and that I hand-tweaked the label numbers
for ease of reading.
Also, -fno-tree-ch does suppress this bad optimization, but
--- Comment #4 from zackw at panix dot com 2006-07-12 22:48 ---
I remembered that I had a build of 4.2 from last week lying around. It
generates even worse code - still with the duplication of most of the loop,
plus a bunch of unnecessary register fiddling and bad addressing mode
--- Comment #5 from pinskia at gcc dot gnu dot org 2006-07-12 22:52 ---
For me on PPC-darwin, it generates pretty good code at just -O2 even though
there is a duplicated header. The loop is pretty good at scheduling the code
too:
L9:
lbz r0,0(r3)
cmplwi cr7,r0,31
--- Comment #6 from rakdver at gcc dot gnu dot org 2006-07-12 23:13 ---
Loop header copying is OK; the result is the one I would expect, it certainly
does not make the code worse (unless you are optimizing for code size), and in
many cases may make it better.
I will have a look at the
--- Comment #7 from zackw at panix dot com 2006-07-12 23:19 ---
Created an attachment (id=11875)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11875action=view)
C test case (with interesting implications)
I've found a plain C test case. In the process, I've found that the way
--- Comment #8 from zackw at panix dot com 2006-07-12 23:21 ---
Zdenek: I don't see how you can say that what we get is optimal code unless
optimizing for size. The code generated *will* be slower than the
alternative.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #9 from rakdver at atrey dot karlin dot mff dot cuni dot cz
2006-07-12 23:30 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
Zdenek: I don't see how you can say that what we get is optimal code unless
optimizing
--- Comment #10 from zackw at panix dot com 2006-07-12 23:33 ---
I-cache. Also, more iterations before the branch predictors figure out what's
going on.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364
--- Comment #11 from rakdver at atrey dot karlin dot mff dot cuni dot cz
2006-07-12 23:39 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
I-cache.
this only matters if this increase in code size will make the code go
out of
--- Comment #12 from zackw at panix dot com 2006-07-13 03:09 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
I-cache.
this only matters if this increase in code size will make the code go
out of instruction cache.
The real
--- Comment #13 from pinskia at gcc dot gnu dot org 2006-07-13 03:37
---
Hmm, for some reason I don't like the idea of using std::string in the inner
loop :). Even the C testcase does not seem like a good inner loop in general
anyways as there is no caculation going on here. To me
--- Comment #14 from zackw at panix dot com 2006-07-13 03:40 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
It's a validation routine, yes, which is run over every pathname the
program is working on, and there can be hundreds
--- Comment #15 from pinskia at gcc dot gnu dot org 2006-07-13 03:45
---
One more comment, a loop with an early exit is whole issue and that is the
reason why all of the code in the loop is considered the header. There are a
couple of loop headers in this case, one for each exit which
--- Comment #16 from pinskia at gcc dot gnu dot org 2006-07-13 04:01
---
If this is really a program's inner most loop, then the program is messed up as
there is no caculation going on here at all.
What type of program is this? Do you cache the result of this function? Maybe
--- Comment #17 from zackw at panix dot com 2006-07-13 04:23 ---
Subject: Re: poor optimization choices when iterating over a std::string
(probably not c++-specific)
One more comment, a loop with an early exit is whole issue and that is the
reason why all of the code in the loop is
36 matches
Mail list logo