[patch] expr.c: Fix the failure of gcc.dg/compat/scalar-by-value-4.

Jim Wilson wilson@tuliptree.org
Sun Jun 29 08:15:00 GMT 2003


On Sat, 2003-06-28 at 02:32, Kazu Hirata wrote:
>  1)  STACK_GROWS_DOWNWARD, STACK_PUSH_CODE == PRE_DEC
>  2)  STACK_GROWS_DOWNWARD, STACK_PUSH_CODE == POST_DEC
>  3) !STACK_GROWS_DOWNWARD, STACK_PUSH_CODE == PRE_INC
>  4) !STACK_GROWS_DOWNWARD, STACK_PUSH_CODE == POST_INC

Only cases 1 and 4 make any sense.  Cases 2 and 3 shouldn't exist,
unless you have badly designed hardware or a badly designed port.  Case
3 appears to exist by default because of a typo in the code, which was
never noticed because the code was never used.

The c4x port agrees with the documentation.  Either the part is badly
designed, or the hardware documentation is wrong.

The avr port also agrees with the documentation.  So this is also either
a badly designed part, or a part with incorrect hardware documentation.

> To my surprise, h8300 is the only port that my patch has effects on.

Yes, that was my conclusion also.

The patch is OK.  It looks a little overly complicated, but apparently
we do have to handle cases 2 and 3 because there is some badly designed
hardware out there, so we unfortunately need the extra complexity.

Jim




More information about the Gcc-patches mailing list