diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2023-06-26 03:24:27 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2023-06-26 03:32:13 +0200 |
commit | 0f54a73b998b72f7c8452a63730ec3b16fc47854 (patch) | |
tree | 2f113149700b09803f07fdc72cd036a3cca0b1ef /lto-plugin/lto-plugin.c | |
parent | 016047f54713dc601c661ab57c78a26da3759608 (diff) | |
download | gcc-vendors/ARM/release-12.3.rel1.zip gcc-vendors/ARM/release-12.3.rel1.tar.gz gcc-vendors/ARM/release-12.3.rel1.tar.bz2 |
d: Suboptimal codegen for __builtin_expect(cond, false)vendors/ARM/release-12.3.rel1
Since PR96435, both boolean objects and expressions have been evaluated
in the following way.
(*(ubyte*)&obj_or_expr) & 1
It has been noted that sometimes this can cause the back-end to optimize
in non-obvious ways - in particular with __builtin_expect.
This @safe feature is now restricted to just when reading the value of a
bool field that comes from a union.
PR d/110359
gcc/d/ChangeLog:
* d-convert.cc (convert_for_rvalue): Only apply the @safe boolean
conversion to boolean fields of a union.
(convert_for_condition): Call convert_for_rvalue in the default case.
gcc/testsuite/ChangeLog:
* gdc.dg/pr110359.d: New test.
(cherry picked from commit ab98db1e8c1b997414539f41b7fb814019497d8d)
Diffstat (limited to 'lto-plugin/lto-plugin.c')
0 files changed, 0 insertions, 0 deletions