This is the mail archive of the gcc@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]

Re: Objective C and STRUCTURE_SIZE_BOUNDARY


> : Is there a way to find out at runtime what was the option passed to
> : the compiler at the build time?
> 
> Sadly no.  This feature was never really intended for widespread use.
> Some people have found that changing the default boundary (from 32 to
> 8) produces better code *under certain circumstances*.  The best way
> to use this feature is to use the default value whenever possible, and
> to only use the non-default value when speed is critical and access to
> the affected structures can be localised to user controlled source
> files.

Assuming you only support -mstructure_size_boundary=8 to set it to
eight (i.e. no whitespace, zeroes, other number bases or trailing junk),
you can do:
#define STRUCTURE_SIZE_BOUNDARY __ARM_STRUCTURE_SIZE_BOUNDARY__

#undef __ARM_STRUCTURE_SIZE_BOUNDARY__ /* Just in caers we build a native... */
#define __ARM_STRUCTURE_SIZE_BOUNDARY__ arm_structure_size_boundary

and in CPP_SPECS:

%{structure_size_boundary=8:!-D__ARM_STRUCTURE_SIZE_BOUNDARY__=8} \
%{!structure_size_boundary=8:!-D__ARM_STRUCTURE_SIZE_BOUNDARY__=32} \


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