Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#8 Redundant Temporary, Pt. 1

open
nobody
None
5
2001-11-14
2001-11-14
Geoffrey Yerem
No

Hi,
The code below generates a redundant temporary. I don't think there's a way to trick the
compiler into generating better code.

Geoffrey

xdata long D;
data long d;
data char a[4];

void f1( void )
{
d = D; // Good code!
}

void f2( void )
{
*(data long *)a = *&D; // Generates temporary.
}

void f3( void )
{
*&d = D; // Generates temporary.
}

Discussion