Since the OP_SETCC instructions can only return a 0 or a 1, a truncation won't change the value and the OP_SETCC can be changed to directly return the extended size. Remove the unneeded truncate. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- simplify.c | 1 + validation/optim/setne0-trunc.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/simplify.c b/simplify.c index 728647a3e..45e03de19 100644 --- a/simplify.c +++ b/simplify.c @@ -1196,6 +1196,7 @@ static int simplify_cast(struct instruction *insn) break; /* fall through */ case OP_ZEXT: + case OP_TRUNC: // simplify: // setcc.n %t <- %a, %b // zext.m %r <- (n) %t diff --git a/validation/optim/setne0-trunc.c b/validation/optim/setne0-trunc.c index 621314100..6c5494eca 100644 --- a/validation/optim/setne0-trunc.c +++ b/validation/optim/setne0-trunc.c @@ -3,7 +3,6 @@ char foo(int a) { return a != 0; } /* * check-name: setne0-trunc * check-command: test-linearize -m64 -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-excludes: trunc\\. -- 2.18.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html