OrangeC
OrangeC copied to clipboard
Use less temp variables
if you do something like this:
#define MYCODE \
{ \
/* declare some vars */ \
/* do something slightly complicated, maybe a loop or maybe function calls */ \
}
main()
{
MYCODE;
MYCODE;
MYCODE;
/* lots more */
MYCODE;
}
you can overwhelm the temporary variable generator. Even if you don't go past the limit, optimization will be very slow. A fix for this might be to recognize that temporary variables go out of scope at the end of the block, and reuse them...
the recent rewrites helped with this a bit; less indirections are generated which means less temp variables. Could still use a more formal look though.