diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2019-01-16 20:40:21 +0000 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gcc.gnu.org> | 2019-01-16 20:40:21 +0000 |
commit | e42589bd629d1c4b38aee2c8fcb924c37c6889b7 (patch) | |
tree | 2f95df85510265503e64860bcdb0ea6023da1ee6 | |
parent | 15b93db9ca258710e3abb43e2378ef3601e3a697 (diff) | |
download | gcc-e42589bd629d1c4b38aee2c8fcb924c37c6889b7.zip gcc-e42589bd629d1c4b38aee2c8fcb924c37c6889b7.tar.gz gcc-e42589bd629d1c4b38aee2c8fcb924c37c6889b7.tar.bz2 |
[D] Fix failing EH execution test on i386.
Turn off partitioning unless it was explicitly requested, as it doesn't
work with D exception chaining, where personality routines use LSDA to
determine whether two thrown exceptions are in the same context.
The following distills what was failing in the D testsuite.
```
try {
try {
fn(); // throws "1"
}
finally {
throw new Exception("2");
}
}
catch (Exception e) {
assert(e.msg == "1");
assert(e.next.msg == "2");
}
```
gcc/d/ChangeLog:
PR d/87824
* d-lang.cc (d_post_options): Disable implicit
-forder-blocks-and-partition.
From-SVN: r267985
-rw-r--r-- | gcc/d/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/d/d-lang.cc | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index 441fed8..fa4ba35 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,5 +1,11 @@ 2019-01-16 Iain Buclaw <ibuclaw@gdcproject.org> + PR d/87824 + * d-lang.cc (d_post_options): Disable implicit + -forder-blocks-and-partition. + +2019-01-16 Iain Buclaw <ibuclaw@gdcproject.org> + * d-codegen.cc (build_typeof_null_value): New function. * d-tree.h (build_typeof_null_value): Declare. * d-convert.cc (convert_expr): Use build_typeof_null_value. diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 109bf4b..b53e56e 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -725,6 +725,12 @@ d_post_options (const char ** fn) global.params.useSwitchError = false; } + /* Turn off partitioning unless it was explicitly requested, as it doesn't + work with D exception chaining, where EH handler uses LSDA to determine + whether two thrown exception are in the same context. */ + if (!global_options_set.x_flag_reorder_blocks_and_partition) + global_options.x_flag_reorder_blocks_and_partition = 0; + /* Error about use of deprecated features. */ if (global.params.useDeprecated == DIAGNOSTICinform && global.params.warnings == DIAGNOSTICerror) |