Blackfin eh broken with dataflow merge
Bernd Schmidt
bernds_cb1@t-online.de
Wed Jun 13 17:44:00 GMT 2007
Exception handling on the Blackfin was broken by the dataflow merge.
Inspecting the differences in the generated code, it appears that when
compiling functions like _Unwind_Resume in unwind-dw2.c, the dse pass
deletes necessary instructions.
Before:
(insn 56 55 57 7 (set (reg/v:SI 56 [ offset ])
(reg:SI 0 R0)) 14 {*movsi_insn} (expr_list:REG_DEAD (reg:SI 0 R0)
(nil)))
(insn 57 56 67 7 (set (reg/v/f:SI 55 [ handler ])
(mem/s/f/c:SI (plus:SI (reg/f:SI 15 FP)
(const_int -376 [0xfffffe88])) [12 cur_context.ra+0 S4
A32])) 14 {*movsi_insn} (nil))
(insn 67 57 68 7 (set (reg:SI 10 P2 [ offset ])
(reg/v:SI 56 [ offset ])) 14 {*movsi_insn} (expr_list:REG_DEAD
(reg/v:SI 56 [ offset ])
(nil)))
(insn 68 67 69 7 (set (mem:SI (plus:SI (reg/f:SI 15 FP)
(const_int 4 [0x4])) [0 S4 A32])
(reg/v/f:SI 55 [ handler ])) 14 {*movsi_insn}
(expr_list:REG_DEAD (reg/v/f:SI 55 [ handler ])
(nil)))
(jump_insn 69 68 0 7 (set (pc)
(unspec_volatile [
(reg:SI 10 P2)
] 0)) 126 {eh_return_internal} (expr_list:REG_DEAD (reg:SI
10 P2)
(expr_list:REG_EQUAL (unspec_volatile [
(reg:SI 10 P2)
] 0)
(nil))))
After:
(insn 56 55 67 7 (set (reg/v:SI 56 [ offset ])
(reg:SI 0 R0)) 14 {*movsi_insn} (expr_list:REG_DEAD (reg:SI 0 R0)
(nil)))
(insn 67 56 69 7 (set (reg:SI 10 P2 [ offset ])
(reg/v:SI 56 [ offset ])) 14 {*movsi_insn} (expr_list:REG_DEAD
(reg/v:SI 56 [ offset ])
(nil)))
(jump_insn 69 67 0 7 (set (pc)
(unspec_volatile [
(reg:SI 10 P2)
] 0)) 126 {eh_return_internal} (expr_list:REG_DEAD (reg:SI
10 P2)
(expr_list:REG_EQUAL (unspec_volatile [
(reg:SI 10 P2)
] 0)
(nil))))
[FP + 4] is part of the register save area. Insn 68, which stores a
value into it, gets deleted.
There is a reference to current_function_uses_eh_return in dse.c, but
it's not clear to me what it's trying to achieve. Anyway, turning the
store into an unspec_volatile solves the problem. I've committed the
following.
Bernd
--
This footer brought to you by insane German lawmakers.
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: eh-fixes.diff
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20070613/aff4448b/attachment.ksh>
More information about the Gcc
mailing list