Paul, that is exactly what I found out. Firstly, in answer to JMS, here is my exact workaround:
This was my original code. Note that "mode" is my own variable, not a processor thing...
if_bitIsClear(mode,ioPort_modeBit_inputOnly)
{
// Port is output. First, tell hardware about...