On Mon, 02 Jun 2008, Szakáts Viktor wrote:

Hi Viktor,

> We currently also use the '()' non-optimization for
> HB_SYMBOL_UNUSED().

It is and was optimized. For all expressions like:
   (exp) <op> (exp)
our expression optimizer strips parenthesis.
It's also not Clipper compatible and maybe we should disable
this optimization when -kc is used. Now it's always enabled.
We also have some other optimizations not done by Clipper, f.e.
Clipper does not make any optimization for <exp> when message
is sent to <exp>, f.e.:
   ? (10==10):calsname
Now this optimization can be disabled by -kc.

> If we can resolve the above, and make it possible to disable
> the feature using -k switch, I think we are fine with it.
> If this involves any complexities though, I'd leave it for after RC1.

In last commit I've already done it for function parameters and -kc
disable this optimization.
Anyhow I think we should update hbtest and use #pragma -kc / #pragma -khx
or HB_C52_STRICT macro for some of CHR( ( <num> ) ).
See current hbtest results.
In general there is a problem with compile time optimizations for
   CHR( <integer_value> * 256 )
and $ operator in expressions like:
   "" $ <exp>
caused by bugs in Clipper compiler. It gives different results then
runtime functions/operations. Keeping strict Clipper compatibility
is hard in complex expressions. Probably we should think about adding
option to set valid results in such situations or we should introduce
flag for expressions to mark them as optimized and in such case do not
replicate wrong Clipper compile time optimizations.
BTW I also thing we should also add INT( <num> ) optimization.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to