[Bug tree-optimization/34737] Scheduling of post-modified function arguments is not good

2010-09-13 Thread abnikant dot singh at atmel dot com


--- Comment #6 from abnikant dot singh at atmel dot com  2010-09-13 11:38 
---
we get better code in the head. Both the cases [test1 and test2] produce the
same piece of code:
i.e for the following test case:

void foo(char *p);

void test1(char * p)
{
foo(p++);
foo(p++);
foo(p++);
foo(p++);
}

void test2(char * p)
{
foo(p); p++;
foo(p); p++;
foo(p); p++;
foo(p); p++;
}

we get:
test1:
push r28
push r29
/* prologue: function */
/* frame size = 0 */
/* stack size = 2 */
.L__stack_usage = 2
mov r28,r24
mov r29,r25
rcall foo
mov r24,r28
mov r25,r29
adiw r24,1
rcall foo
mov r24,r28
mov r25,r29
adiw r24,2
rcall foo
mov r24,r28
mov r25,r29
adiw r24,3
rcall foo
/* epilogue start */
pop r29
pop r28
ret
.size   test1, .-test1
.global test2
.type   test2, @function
test2:
push r28
push r29
/* prologue: function */
/* frame size = 0 */
/* stack size = 2 */
.L__stack_usage = 2
mov r28,r24
mov r29,r25
rcall foo
mov r24,r28
mov r25,r29
adiw r24,1
rcall foo
mov r24,r28
mov r25,r29
adiw r24,2
rcall foo
mov r24,r28
mov r25,r29
adiw r24,3
rcall foo
/* epilogue start */
pop r29
pop r28
ret
.size   test2, .-test2


-- 

abnikant dot singh at atmel dot com changed:

   What|Removed |Added

 CC||abnikant dot singh at atmel
   ||dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34737



[Bug tree-optimization/34737] Scheduling of post-modified function arguments is not good

2009-06-24 Thread steven at gcc dot gnu dot org


--- Comment #4 from steven at gcc dot gnu dot org  2009-06-24 07:42 ---
Couldn't this be fixed also by changing the initial gimplification from:

  p.0 = p;
  p = p + 1;
  foo (p.0);

to:

  p.0 = p;
  foo (p.0);
  p = p + 1;

?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34737



[Bug tree-optimization/34737] Scheduling of post-modified function arguments is not good

2009-06-24 Thread rguenther at suse dot de


--- Comment #5 from rguenther at suse dot de  2009-06-24 09:07 ---
Subject: Re:  Scheduling of post-modified function
 arguments is not good

On Wed, 24 Jun 2009, steven at gcc dot gnu dot org wrote:

 --- Comment #4 from steven at gcc dot gnu dot org  2009-06-24 07:42 
 ---
 Couldn't this be fixed also by changing the initial gimplification from:
 
   p.0 = p;
   p = p + 1;
   foo (p.0);
 
 to:
 
   p.0 = p;
   foo (p.0);
   p = p + 1;

Probably yes.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34737



[Bug tree-optimization/34737] Scheduling of post-modified function arguments is not good

2008-01-11 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2008-01-11 11:33 ---
No what happened with 4.0 is rather DOM would prop x+1 for each x.

Really this comes down to scheduling of instructions and moving them closer to
their usage.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

  Known to work|4.0.4   |
Summary|Inefficient gimplification  |Scheduling of post-modified
   |of post-modified function   |function arguments is not
   |arguments, TER doesn't do   |good
   |its work|


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34737