[PATCH] D54891: [RFC] Checking inline assembly for validity
Mike Hommey via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 27 18:23:59 PST 2018
glandium added a comment.
Correction, the mpi_arm.c ones seem to be caught. However, warnings are also being emitted for assembly post substitution. Example:
/builds/worker/workspace/build/src/security/nss/lib/freebl/mpi/mpi_arm.c:31:10: warning: write to an input-only inline assembly operand [-Winline-asm]
"ldr r6, [%0], #4\n"
^
<inline asm>:5:13: note: instantiated into assembly here
ldr r6, [r0], #4
^
/builds/worker/workspace/build/src/security/nss/lib/freebl/mpi/mpi_arm.c:31:10: warning: read from R0, which is not an inline assembly operand or clobber [-Winline-asm]
"ldr r6, [%0], #4\n"
^
<inline asm>:5:19: note: instantiated into assembly here
ldr r6, [r0], #4
^
It also seems there are false positives. Possibly because MC doesn't have all the right information about some instructions. For example:
/builds/worker/workspace/build/src/modules/freetype2/src/truetype/ttinterp.c:1261:31: warning: instruction reads from an output inline assembly operand (without having written to it first) [-Winline-asm]
"smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */
^
The corresponding code is: https://hg.mozilla.org/try/file/8ce89b7f2cf06a5ad743c5a593502c484e73b5b7/modules/freetype2/src/truetype/ttinterp.c#l1261
Operands %3 and %4 *are* inputs, but it seems to be complaining about %2 which is indeed an output, but is not actually an input of the instruction.
I can provide a full log of the 4831 warnings marked -Winline-asm during a Firefox for ARM Android build, if you're interested.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54891/new/
https://reviews.llvm.org/D54891
More information about the llvm-commits
mailing list