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:

>> 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
...
>
> Big, big hammer just to get rid of 5 problematic lines... now I understand 
> why they are still there :-)

A smaller hammer would be to change all existing definitions to

#define STACK_GROWS_DOWNWARD 1

and make the default be 0.  Flipping the default to be the common case
can be a separate patch.   An even smaller hammer is to put

#ifdef STACK_GROWS_DOWNWARD
#define STACK_GROWS_DOWN 1
#else
#define STACK_GROWS_DOWN 0
#endif

in defaults.h, and then just use STACK_GROWS_DOWN in push_block.

zw


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