#9 Redundant Temporary, Pt. 2

closed
Bernhard Held
None
5
2007-06-09
2001-11-15
Geoffrey Yerem
No

Hi,
It would be nice if (IWBNI), the compiler could recognize that the code below doesn't require a
temporary, since p can reside in DPTR the whole time. I guess this requires moving more of the
responsibility of optimization from the low level (peephole) to a higher lever (global).

Geoffrey

void f( xdata char *p )
{
*p = 1;
*++p = 2;
*++p = 3;
*++p = 4;
}

Discussion

  • Maarten Brock
    Maarten Brock
    2007-06-09

    Logged In: YES
    user_id=888171
    Originator: NO

    Peephole rules 177.x and 301 have the requested effect on this code.
    Rule 301 was added on 2006-12-30 by Bernhard.

     
  • Maarten Brock
    Maarten Brock
    2007-06-09

    • assigned_to: nobody --> bernhardheld
    • status: open --> closed