diff options
author | Bartosz Nitka <niteria@gmail.com> | 2018-05-03 12:37:00 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-05-03 12:37:18 -0400 |
commit | 6132d7c5e6404936ef281a6f3be333fea780906e (patch) | |
tree | 653db073c3273e343ae60a062c43c210fff05e87 /testsuite/tests | |
parent | 75361b119c609f0ab98f3d12a15690aae4ce42a1 (diff) | |
download | haskell-6132d7c5e6404936ef281a6f3be333fea780906e.tar.gz |
Correctly add unwinding info in manifestSp and makeFixupBlocks
In `manifestSp` the unwind info was before the relevant instruction, not
after. I added some notes to establish semantics. Also removes
redundant annotation in stg_catch_frame.
For `makeFixupBlocks` it looks like we were off by `wORD_SIZE dflags`.
I'm not sure why, but it lines up with `manifestSp`. In fact it lines
up so well so that I can consolidate the Sp unwind logic in
`maybeAddUnwind`. I detected the problems with `makeFixupBlocks` by
running T14779b after patching D4559.
Test Plan: added a new test
Reviewers: bgamari, scpmw, simonmar, erikd
Reviewed By: bgamari
Subscribers: thomie, carter
GHC Trac Issues: #14999
Differential Revision: https://phabricator.haskell.org/D4606
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/codeGen/should_compile/Makefile | 5 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_compile/T14999.cmm | 11 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_compile/T14999.stdout | 16 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_compile/all.T | 5 |
4 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_compile/Makefile b/testsuite/tests/codeGen/should_compile/Makefile index a8414384cf..e024788085 100644 --- a/testsuite/tests/codeGen/should_compile/Makefile +++ b/testsuite/tests/codeGen/should_compile/Makefile @@ -33,3 +33,8 @@ debug: ./debug rm debug + +T14999: + '$(TEST_HC)' $(TEST_HC_OPTS) -O2 -g -c T14999.cmm -o T14999.o + gdb --batch -ex 'file T14999.o' -ex 'disassemble stg_catch_frame_info' --nx | tr -s '[:blank:]' + readelf --debug-dump=frames-interp T14999.o | tr -s '[:blank:]' diff --git a/testsuite/tests/codeGen/should_compile/T14999.cmm b/testsuite/tests/codeGen/should_compile/T14999.cmm new file mode 100644 index 0000000000..a3e283b0be --- /dev/null +++ b/testsuite/tests/codeGen/should_compile/T14999.cmm @@ -0,0 +1,11 @@ +#define CATCH_FRAME 34 + +#define SIZEOF_StgCatchFrame (SIZEOF_StgHeader+16) + +INFO_TABLE_RET(stg_catch_frame, CATCH_FRAME, + bits64 info_ptr, bits64 exceptions_blocked, gcptr handler) + return (gcptr ret) +{ + return (ret); +} + diff --git a/testsuite/tests/codeGen/should_compile/T14999.stdout b/testsuite/tests/codeGen/should_compile/T14999.stdout new file mode 100644 index 0000000000..4bca980a9a --- /dev/null +++ b/testsuite/tests/codeGen/should_compile/T14999.stdout @@ -0,0 +1,16 @@ +Dump of assembler code for function stg_catch_frame_info: + 0x0000000000000010 <+0>: add $0x18,%rbp + 0x0000000000000014 <+4>: jmpq *0x0(%rbp) +End of assembler dump. +Contents of the .debug_frame section: + +00000000 0000000000000014 ffffffff CIE "" cf=1 df=-8 ra=16 + LOC CFA rbp rsp ra +0000000000000000 rbp+0 v+0 s c+0 + +00000018 000000000000002c 00000000 FDE cie=00000000 pc=000000000000000f..0000000000000017 + LOC CFA rbp rsp ra +000000000000000f rbp+0 v+0 s c+0 +000000000000000f rbp+24 v+0 s c+0 +0000000000000014 rbp+0 v+0 s c+0 + diff --git a/testsuite/tests/codeGen/should_compile/all.T b/testsuite/tests/codeGen/should_compile/all.T index fb813a497a..9118b6c23b 100644 --- a/testsuite/tests/codeGen/should_compile/all.T +++ b/testsuite/tests/codeGen/should_compile/all.T @@ -38,3 +38,8 @@ test('T12355', normal, compile, ['']) test('T14626', normal, run_command, ['$MAKE -s --no-print-directory T14626']) +test('T14999', + [when((arch('powerpc64') or arch('powerpc64le')), expect_broken(11261)), + unless(opsys('linux') and arch('x86_64') and have_gdb() and + have_readelf(), skip)], + run_command, ['$MAKE -s --no-print-directory T14999']) |