This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: #pragma push breaks bootstrap?
- To: robertl at dgii dot com
- Subject: Re: #pragma push breaks bootstrap?
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Mon, 5 Oct 1998 13:43:59 -0700
- CC: egcs at cygnus dot com
Hi Robert,
: Before we chase this a lot further, can I ask a silly question? Since
: insert_pack_attributes() has a non-zero cost (breakpoints show it being
: called many times for even the simple example) and presumably provides
: benefits only to those that need the Windows-ism 'pragma push' should
: we move the setting of this out of i386.h and into the target-specific
: files for those targets that care about that extension? (winnt.h,
: go32.h, cygwin32, mingw, etc.)
Good point, I had not considered compilation times when writing the
patch. Moving H_P_P_P into those OS specific header files would be a
good idea.
Actually it turns out that this was the clue that I needed. The
problem is that insert_pack_attributes() is being called for #pragma
pack, (as well as #pragma pack (push,...) which is a change from the
previous behaviour. Could you try applying the patch below and see if
it foxes the problem for you. If it does, I will tidy it up and
submit it to egcs-patches.
Index: c-pragma.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-pragma.c,v
retrieving revision 1.9
diff -p -w -r1.9 c-pragma.c
*** c-pragma.c 1998/10/01 10:50:06 1.9
--- c-pragma.c 1998/10/05 20:40:45
*************** insert_pack_attributes (node, attributes
*** 146,152 ****
tree a;
/* If we are not packing, then there is nothing to do. */
! if (maximum_field_alignment == 0)
return;
/* We are only interested in fields. */
--- 146,153 ----
tree a;
/* If we are not packing, then there is nothing to do. */
! if (maximum_field_alignment == 0
! || alignment_stack == NULL)
return;
/* We are only interested in fields. */
Cheers
Nick