diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-07-08 10:24:01 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-08-07 13:31:12 +0200 |
| commit | 0908755d71eec16da5ab1f9ef1019bdcab4f1857 (patch) | |
| tree | 11625be82f448c00a3311d4dfa972f92cf0b6812 /validation/call-variadic.c | |
| parent | 7347750afb894047b5145637cdebd1613c33d64a (diff) | |
| download | sparse-dev-0908755d71eec16da5ab1f9ef1019bdcab4f1857.tar.gz | |
fix instruction size & type in linearize_inc_dec()
If the ++ or -- operator is used on a bitfield, the addition or
subtraction is done with the size of the bitfield. So code like:
struct {
int f:3;
} s;
...
s->f++;
will generate intermediate code like:
add.3 %r <- %a, $1
This is not incorrect from the IR point of view but CPUs have
only register-sized instructions, like 'add.32'. So, these
odd-sized instruction have one or two implicit masking/extend
that should better make explicit.
Fix this by casting to and from the base type when these operators
are used on bitfields.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/call-variadic.c')
0 files changed, 0 insertions, 0 deletions
