
#15104: Update JMP_TBL targets during shortcutting for x86 codegen. -------------------------------------+------------------------------------- Reporter: AndreasK | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.5 (NCG) | Keywords: CodeGen | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): Phab:D4595 | Wiki Page: -------------------------------------+------------------------------------- Jump tables are generated from Cmm Code in a few steps: 1. We start with a CmmSwitch at the end of the Cmm pipeline which gets turned into a JMP_TBL instruction. 2. During native codegen we generate static jump tables from JMP_TBL. (generateJumpTables) 3. We shortcut jump targets, for jump tables by updating the static tables. (shortcutBranches). This might update the jump targets with calculated address not represented by a label. After the third step the targets in the JMP_TBL instruction (which are the original labels) and in the static data can be out of sync. Phab:D4566 went part of the way, updating labels in JMP_TBL. However without tables next to code labels can be updated to non-label jump destinations which I did not consider at the time. Phab:D4595 is intended to fix this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15104 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler