diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-08-15 11:24:01 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-06-23 07:46:40 +0200 |
| commit | 01951278a60490735677920c86f139d627b22dbf (patch) | |
| tree | 44e9168eacaf2053a4b96bc52a4fb38b288e07a2 /validation/linear/cast-volatile.c | |
| parent | bf21036518acf0c3069c9c9e12b13fd09c8cdceb (diff) | |
| download | sparse-dev-01951278a60490735677920c86f139d627b22dbf.tar.gz | |
cast: specialize integer casts
Casts to integer used to be done with only 2 instructions:
OP_CAST & OP_SCAST.
Those are not very convenient as they don't reflect the real
operations that need to be done.
This patch specialize these instructions in:
- OP_TRUNC, for casts to a smaller type
- OP_ZEXT, for casts that need a zero extension
- OP_SEXT, for casts that need a sign extension
- Integer-to-integer casts of the same size are considered as
a NOPs and are, in fact, never emitted.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear/cast-volatile.c')
| -rw-r--r-- | validation/linear/cast-volatile.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/validation/linear/cast-volatile.c b/validation/linear/cast-volatile.c index f8a64937..6d12c015 100644 --- a/validation/linear/cast-volatile.c +++ b/validation/linear/cast-volatile.c @@ -8,7 +8,8 @@ static int foo(volatile int *a, int v) * check-name: cast-volatile * check-command: test-linearize -fdump-ir=linearize $file * - * check-known-to-fail * check-output-ignore - * check-output-excludes: scast\\. + * check-output-excludes: sext\\. + * check-output-excludes: zext\\. + * check-output-excludes: trunc\\. */ |
