compile: differentiate attribute read and write