The exception bug in egcs-970929
Andreas Schwab
schwab@issan.informatik.uni-dortmund.de
Tue Oct 7 03:48:00 GMT 1997
H J Lu <hjl@lucon.org> writes:
|> This code is miscompiled with -O and dwarf based exception on x86.
|> # gcc -O des.cc
|> # a.out
|> zsh: 26333 segmentation fault ./a.out
|> If dwarf based exception is not used, everything is fine. Somehow
|> g++ adjusts stack twice when calling destructor.
I have just sent this to Kenner for gcc2:
The FDE insns that belong to a specific pc value always come after a
DW_CFA_advance_loc that advances to that pc value. Thus when
__frame_state_for executes the FDE insns it must still do that if the
current pc value equals the target pc value.
1997-10-04 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* frame.c (__frame_state_for): Execute the FDE insns until the
current pc value is strictly bigger than the target pc value.
*** testgcc-970926/frame.c.~1~ Wed Sep 24 23:05:26 1997
--- testgcc-970926/frame.c Sat Oct 4 18:43:39 1997
*************** __frame_state_for (void *pc_target, stru
*** 600,606 ****
/* Then the insns in the FDE up to our target PC. */
end = next_fde (f);
pc = f->pc_begin;
! while (insn < end && pc < pc_target)
insn = execute_cfa_insn (insn, &state, &info, &pc);
memcpy (state_in, &state.s, sizeof (state.s));
--- 600,606 ----
/* Then the insns in the FDE up to our target PC. */
end = next_fde (f);
pc = f->pc_begin;
! while (insn < end && pc <= pc_target)
insn = execute_cfa_insn (insn, &state, &info, &pc);
memcpy (state_in, &state.s, sizeof (state.s));
--
Andreas Schwab "And now for something
schwab@issan.informatik.uni-dortmund.de completely different"
More information about the Gcc
mailing list