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: #pragma push breaks bootstrap?


Hi Robert,

: I walked through the patches of the last 24 hours and one of the most
: benign looking of the lot seems to be thing that triggers it.  If I
: revert i386/i386.h to -D981001 so that HANDLE_PRAGMA_PACK_PUSH_POP isn't
: set and redo the bootstrap, it works.  If I walk that lone file forward
: to the -D981002 tag and redo the bootstrap, it does the wrong thing.  The
: whole thing just reeks of a memory overwrite somewhere.

I agree, although I am stumped as to where the bug might lie.

I eyeballed my code, and I do not see how it could be affecting you.
(I am assuming that none of your system header files actually use
#pragma pack(..).  If they do, then maybe this might be the cause).

: The difference between the two versions is in the .s files.   When
: PRAGMA_PUSH and friends are turned on, egcs emits wrong offsets into
: the __iob array that is used by things like the 'fflush(stdout)' that
: appears in the gencodes source.
: 
: $ diff gencodes.1.s gencodes.2.s
: 125c125
: <       pushl $__iob+48
: ---
: >       pushl $__iob+32

Hmmm, I take it back - it does look like your headers use #pragma
pack push(...).  The effect of the pragma is to change the packing of
fields inside structures.  The point of this patch was to support the
way Microsoft's Visual C compiler implememnts the pragma, and so allow
Cygwin and pals to use MS system header files.

My guess is that <stdio.h> or one of its descendants is defining
#pragma pack, and that either a) the HANDLE_PRAGMA_PACK_PUSH_POP code
is not handling the pragma correctly, or b) there is difference in the
behaviour of #pragma pack between OpenServer and Win32.

: How can I help track this down?   

Can you find out if:

	a. #pragma pack is being used by your system header files
and	b. If so, is there any documentation on how the pragma is
	supposed to behave.

Cheers
	Nick


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