[PATCH 3/8] add default for PCC_BITFIELD_TYPE_MATTERS
Trevor Saunders
tbsaunde@tbsaunde.org
Fri May 1 00:01:00 GMT 2015
On Thu, Apr 30, 2015 at 05:41:57PM +0000, Joseph Myers wrote:
> On Thu, 30 Apr 2015, Jakub Jelinek wrote:
>
> > > I guess the "best" thing to do is justadd a
> > > __PCC_BITFIELD_TYPE_MATTERS__ that gcc defines and use that in libobjc?
> >
> > I think adding way too many predefines, especially rarely used ones, is
> > harmful, certainly it isn't free, consider -g3 or -dD where it will all end
> > up in, additional gcc start overhead, ...
>
> That's why we have -fbuilding-libgcc. It would seem reasonable enough to
> me to use that when building other target libraries that need such
> information.
>
> (See bug 24775 regarding the general issue with libobjc using GCC's struct
> layout target macros - I think there was an idea of a way to rework that
> libobjc code, but haven't looked at the details of Andrew Pinski's old
> work referred to in that bug; -fbuilding-libgcc may not be the optimal way
> of dealing with PCC_BITFIELD_TYPE_MATTERS, but ought to work as an interim
I think I saw this and forgot about it and then resaw it just now in
documenting this macro tm.texi provides a program that supposedly can
check the behavior of the compiler here so writing a autoconf test seems
about as simple as it can get when m4 is involved.
> fix. More generally, regarding host-side target macros used in target
> code, see my suggestions at
> <https://gcc.gnu.org/wiki/Top-Level_Libgcc_Migration>. It's always
> necessary, when changing the semantics of a target macro or converting it
> into a hook, to watch out for uses outside the gcc/ directory, until all
> the remaining uses in target code have been dealt with.)
if we want to be pedantic this patch didn't actually change semantics,
here's what tm.texi says.
If the macro is defined, its definition should be a C expression;
a nonzero value for the expression enables this behavior.
Note that if this macro is not defined, or its value is zero, some
bit-fields may cross more than one alignment boundary. The compiler can
support such references if there are @samp{insv}, @samp{extv}, and
@samp{extzv} insns that can directly reference memory.
so, its valid for PCC_BITFIELD_TYPE_MATTERS to be defined to 0 in
defaults.h. Of course documentation should never really be trusted that
much and its still broken :)
Trev
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
More information about the Gcc-patches
mailing list