[issue524] Making world with gcc41?

Matthew Dillon dillon at apollo.backplane.com
Mon Jan 22 10:52:44 PST 2007


:Okay, I fixed it, lets go for some explanation first:
:
:The gpfault comes from vm86_bioscall(...) in init386().  The cause is tha=
:t the assembler code passes the struct vm86frame by value, i.e. simply cr=
:eating it on the stack.  This worked up to gcc34, but gcc41 now optimizes=
: stores to unused memory locations away, whis is allowed per the standard=
:s.  This led to an uninitialized stack frame which in turn panicked the b=
:ox.
:
:After some time of bug searching (qemu with gdbserver being *very* helpfu=
:l) it turns out that freebsd did have the same problem one month ago.  So=
:, the fix is the same:  pass structs by reference if you expect the calle=
:e to modify them.
:
:The attached patch does this.  It is quite a bit, but well, it needs to b=
:e done.  Gcc41 kernel boots fine now.  Best we get that in before release=
:=2E
:
:cheers
:  simon

    Oooohh... I've actually been wanting to do that for a while.

    Ok, please go ahead and commit it right now.

    But this WILL mean we can't branch today.  Not with that big a change.
    We will have to branch tomorrow.
      
						-Matt






More information about the Bugs mailing list