ref: 4e1b476c9a1c35059e5232de673dcbdaf94376e4
parent: 8c525dcfe1ccf04c8f2279c43d4ef26e87732877
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Jun 17 16:31:01 EDT 2024
cc: logical operations (& | ^) operate on integers only (thanks sigrid) void main(void) { uchar a[3]; float f = a[2] | a[1] | (a[0]/1.2); USED(f); } the code above used to generate impossible code in the linker like: main: doasm: notfound from=34 to=35 (872) ORL X0,X1 main: doasm: notfound from=34 to=35 (872) ORL X0,X1 main: doasm: notfound from=34 to=35 (872) ORL X0,X1 with the change, the compiler correctly rejects it: incompatible types: "UINT" and "DOUBLE" for op "OR" i assume the BNUMBER in the type matrix must have been a oversight.
--- a/sys/src/cmd/cc/sub.c
+++ b/sys/src/cmd/cc/sub.c
@@ -1796,8 +1796,8 @@
TUCHAR, BINTEGER, 0,
TSHORT, BINTEGER, 0,
TUSHORT, BINTEGER, 0,
- TINT, BNUMBER, 0,
- TUINT, BNUMBER, 0,
+ TINT, BINTEGER, 0,
+ TUINT, BINTEGER, 0,
TLONG, BINTEGER, 0,
TULONG, BINTEGER, 0,
TVLONG, BINTEGER, 0,
--
⑨