aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-02-04 12:03:37 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:06:19 -0700
commitcaeaf72d34d1e91aaea7340241232d1d877907b7 (patch)
treec8be032fa19c1817dbdd16aac5500187f1515ed0 /simplify.c
parentSimplify OP_CAST of OP_AND. (diff)
downloadsparse-caeaf72d34d1e91aaea7340241232d1d877907b7.tar.gz
sparse-caeaf72d34d1e91aaea7340241232d1d877907b7.tar.bz2
sparse-caeaf72d34d1e91aaea7340241232d1d877907b7.zip
Split OP_CAST into signed, unsigned and FP casts.
Otherwise we lose the information what the target type is (we only have the bit-size of the target).
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/simplify.c b/simplify.c
index a1f798b..7a69906 100644
--- a/simplify.c
+++ b/simplify.c
@@ -694,7 +694,7 @@ static int simplify_branch(struct instruction *insn)
return REPEAT_CSE;
}
}
- if (def->opcode == OP_CAST) {
+ if (def->opcode == OP_CAST || def->opcode == OP_SCAST) {
int orig_size = def->orig_type ? def->orig_type->bit_size : 0;
if (def->size > orig_size) {
use_pseudo(def->src, &insn->cond);
@@ -770,8 +770,10 @@ int simplify_instruction(struct instruction *insn)
if (dead_insn(insn, NULL, NULL, NULL))
return REPEAT_CSE | REPEAT_SYMBOL_CLEANUP;
return replace_with_pseudo(insn, insn->symbol);
- case OP_PTRCAST:
case OP_CAST:
+ case OP_SCAST:
+ case OP_FPCAST:
+ case OP_PTRCAST:
return simplify_cast(insn);
case OP_PHI:
if (dead_insn(insn, NULL, NULL, NULL)) {