This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Simplify preprocessor conditional in push_block


Eric Botcazou <ebotcazou@libertysurf.fr> writes:

> Hi,
>
> Any reason to keep this rather intricate preprocessor conditional
>
>  #ifndef STACK_GROWS_DOWNWARD
>    if (0)
>  #else
>    if (1)
>   #endif
>
> in push_block? If the patch is approved, I'll bootstrap it before the commit.
>
>
> 2003-10-06  Eric Botcazou  <ebotcazou@libertysurf.fr>
>
> 	* expr.c (push_block): Simply preprocessor conditional.

Better, provide

#ifndef STACK_GROWS_DOWNWARD
#define STACK_GROWS_DOWNWARD 1
#endif

in defaults.h, then delete all existing definitions, and make all
ports that currently do _not_ define this macro instead define it as

#define STACK_GROWS_DOWNWARD 0

... and then you can use just 

  if (STACK_GROWS_DOWNWARD)

in push_block (but you'll have to tweak all other locations that use
it, too.)

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]