[PATCH] D69876: Allow output constraints on "asm goto"
James Y Knight via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 10 19:56:13 PST 2019
jyknight added a comment.
I think -Wuninitialized (UninitializedValues.cpp) should be taught how to detect the use of output variables in error blocks, at least for trivial cases.
Actually, for some reason -- it looks like the warning is failing the wrong way right now, and emits an uninitialized use warning even where there shouldn't be one.
E.g. this example should be okay:
int foo(int x) {
int y;
asm goto("# %0 %1 %2" : "=r"(y) : "r"(x) : : err);
return y;
err:
return -1;
}
But now warns:
$ clang -Wall -fsyntax-only foo.c
foo.c:4:10: warning: variable 'y' is uninitialized when used here [-Wuninitialized]
return y;
^
foo.c:2:8: note: initialize the variable 'y' to silence this warning
int y;
^
= 0
1 warning generated.
I'd expect a warning only if the code was modified to say "return y" in the err block.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69876/new/
https://reviews.llvm.org/D69876
More information about the cfe-commits
mailing list