diff options
author | Balazs Benics <balazs.benics@sigmatechnology.se> | 2021-07-01 10:54:22 +0200 |
---|---|---|
committer | Balazs Benics <balazs.benics@sigmatechnology.se> | 2021-07-01 10:54:22 +0200 |
commit | aa454dda2eed4e71081bc57b1f32dfce2486b177 (patch) | |
tree | d1cf824018386334b0c7e27d3c2c86dcdbcbf699 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 820ced136280474a6702a10e9dfb35fdef1a0e6f (diff) | |
download | llvm-aa454dda2eed4e71081bc57b1f32dfce2486b177.zip llvm-aa454dda2eed4e71081bc57b1f32dfce2486b177.tar.gz llvm-aa454dda2eed4e71081bc57b1f32dfce2486b177.tar.bz2 |
[analyzer] LValueToRValueBitCasts should evaluate to an r-value
Previously `LValueToRValueBitCast`s were modeled in the same way how
a regular `BitCast` was. However, this should not produce an l-value.
Modeling bitcasts accurately is tricky, so it's probably better to
model this expression by binding a fresh conjured value.
The following code should not result in a diagnostic:
```lang=C++
__attribute__((always_inline))
static inline constexpr unsigned int_castf32_u32(float __A) {
return __builtin_bit_cast(unsigned int, __A); // no-warning
}
```
Previously, it reported
`Address of stack memory associated with local variable '__A' returned
to caller [core.StackAddressEscape]`.
Differential Revision: https://reviews.llvm.org/D105017
Reviewed by: NoQ, vsavchenko
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions