--- Comment #23 from rguenth at gcc dot gnu dot org 2008-01-13 14:56
---
Closing as fixed.
--
rguenth at gcc dot gnu dot org changed:
What|Removed |Added
Sta
--- Comment #22 from steven at gcc dot gnu dot org 2007-11-19 09:01 ---
"...and then he said: ``well, that's nice and all, but, ehm, where's the
bug?''"
--
steven at gcc dot gnu dot org changed:
What|Removed |Added
-
--- Comment #21 from mmitchel at gcc dot gnu dot org 2007-08-10 00:44
---
I'm not convinced that there's anything to fix here; it sounds like we've just
traded which of two examples is better. If there is a bug here, please add a
note explaining, and upgrade back to P3.
--
mmitchel
--- Comment #20 from rguenth at gcc dot gnu dot org 2007-07-20 17:22
---
Whoops ;) I missed that.
I have a counter-example that is better with the patch in the same way yours
is worse with it.
void f(unsigned int *p, unsigned int a)
{
p[0] = a * 4 + 4;
p[1] = a * 8 + 8;
p[2] =
--- Comment #19 from zippel at gcc dot gnu dot org 2007-07-20 17:06 ---
There is another small source example inbetween, which is used to produce all
code examples following it. :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32698
--- Comment #18 from rguenth at gcc dot gnu dot org 2007-07-20 16:35
---
I mean
Current gcc finally produces:
*p = (a + 1) * 4;
*(p + 4) = (a + 2) * 4;
*(p + 8) = (a + 3) * 4;
movl8(%esp), %eax
movl4(%esp), %ecx
leal4(,%eax,4), %edx
--- Comment #17 from zippel at gcc dot gnu dot org 2007-07-20 16:21 ---
Which claim?
It's exactly the third code example in comment #13
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32698
--- Comment #16 from rguenth at gcc dot gnu dot org 2007-07-20 16:05
---
That makes it
foo:
movl4(%esp), %ecx
movl8(%esp), %edx
movl8(%ecx,%edx,4), %eax
addl4(%ecx,%edx,4), %eax
addl12(%ecx,%edx,4), %eax
ret
for me.
--- Comment #15 from zippel at gcc dot gnu dot org 2007-07-20 11:58 ---
In the examples I used -fomit-frame-pointer.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32698
--- Comment #14 from rguenth at gcc dot gnu dot org 2007-07-20 11:48
---
For current mainline I get (-O2)
foo:
pushl %ebp
movl%esp, %ebp
movl8(%ebp), %ecx
movl12(%ebp), %edx
popl%ebp
movl8(%ecx,%edx,4), %eax
--- Comment #13 from zippel at gcc dot gnu dot org 2007-07-19 18:27 ---
The initial test case is part of the missed optimization. For example current
stable Debian gcc (4.1.2 20061115) produces code like this:
movl4(%esp), %eax
movl8(%esp), %edx
leal(
--- Comment #12 from rguenth at gcc dot gnu dot org 2007-07-19 16:50
---
The IL representation is not a thing to complain about. Do you have a testcase
that shows a missed optimization instead of a one that has IL that is different
from what you expect?
--
rguenth at gcc dot gnu do
--- Comment #11 from zippel at gcc dot gnu dot org 2007-07-18 12:56 ---
This bug is not fixed yet.
Current gcc still generates:
return (*(p + (i + 2) * 4) + *(p + (i + 1) * 4)) + *(p + (i + 3) * 4);
1. it still fails to extract the common expression at tree level.
2. it generates ineff
--- Comment #10 from pinskia at gcc dot gnu dot org 2007-07-18 06:00
---
Fixed.
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
Status|ASSIGNE
--- Comment #9 from rguenth at gcc dot gnu dot org 2007-07-09 19:42 ---
Subject: Bug 32698
Author: rguenth
Date: Mon Jul 9 19:41:54 2007
New Revision: 126494
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126494
Log:
2007-07-09 Richard Guenther <[EMAIL PROTECTED]>
PR
--- Comment #8 from zippel at gcc dot gnu dot org 2007-07-09 17:42 ---
(In reply to comment #7)
> On the backend side we have the fwprop pass which is supposed to do
> addressing mode selection and the backend which is supposed to provide
> accurate costs for them.
Let's take your propo
--- Comment #7 from rguenther at suse dot de 2007-07-09 15:37 ---
Subject: Re: [4.3 regression] inefficient
pointer expression
On Mon, 9 Jul 2007, zippel at gcc dot gnu dot org wrote:
> (In reply to comment #5)
> > as you suggest creates worse assembly (look at the extra shift)
> >
--- Comment #6 from zippel at gcc dot gnu dot org 2007-07-09 15:27 ---
(In reply to comment #5)
> as you suggest creates worse assembly (look at the extra shift)
>
> foo:
> pushl %ebp
> movl%esp, %ebp
> movl12(%ebp), %ecx
> movl8(%ebp), %edx
--- Comment #5 from rguenth at gcc dot gnu dot org 2007-07-09 15:00 ---
Note that we don't hoist the i*4 or the addition to p to help addressing mode
selection which likes to see the "whole" address.
Of course it shouldn't matter in which form we see the addresses and the same
code shou
--- Comment #4 from zippel at gcc dot gnu dot org 2007-07-09 14:40 ---
IMHO something like this should be generated:
p2 = p + (i * 4);
return (*(p2 + 4) + *(p2 + 8) + *(p2 + 12));
Right now not even the (i*4) expression is removed from the last instruction
anymore.
--
http://gcc.g
--- Comment #3 from rguenth at gcc dot gnu dot org 2007-07-09 13:42 ---
Mine.
--
rguenth at gcc dot gnu dot org changed:
What|Removed |Added
AssignedTo|unassigned
--- Comment #2 from rguenth at gcc dot gnu dot org 2007-07-09 13:41 ---
Created an attachment (id=13875)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13875&action=view)
patch
With the proposed patch mainline generates again
foo:
pushl %ebp
movl%esp, %ebp
--- Comment #1 from rguenth at gcc dot gnu dot org 2007-07-09 13:39 ---
With 2.95, 3.3.6 and 3.4.6 I get (for 32bit):
foo:
pushl %ebp
movl %esp,%ebp
movl 8(%ebp),%edx
movl 12(%ebp),%eax
movl %ebp,%esp
popl %ebp
movl 8(%edx,%eax,4),
23 matches
Mail list logo