fix false negative with noread attribute
just a normal's day arithmetic underflow
MODIFY
ir/pointer.cpp
ir/pointer.cpp
@@ -168,6 +168,7 @@ expr Pointer::isLocal(bool simplify) const {
expr Pointer::isConstGlobal() const {
auto bid = getShortBid();
auto generic = bid.uge(has_null_block) &&
+ expr(num_consts_src > 0) &&
bid.ule(num_consts_src + has_null_block - 1);
auto tgt = bid.uge(num_nonlocals_src + num_extra_nonconst_tgt) &&
bid.ule(num_nonlocals - 1);

ADD
tests/alive-tv/attrs/noread.srctgt.ll
+; ERROR: Source is more defined
+
+@glb = external global i8, align 1
+
+define void @src(i8 %var) writeonly {
+ ret void
+}
+
+define void @tgt(i8 %var) writeonly {
+ %x = load i8, i8* @glb
+ ret void
+}

fix false negative with noread attribute
just a normal's day arithmetic underflow