On v 5.21, yhe following generates a 'reference to undefined variable' error at the print when using a checkmate build. A breakpoint set on the print shows i1 as 'undefined':
integer*1:: i1 i1 = 0 i1 = ibset(i1, 7) print *, i1
When running a debug build i1 is still shown as undefined in the debugger, but the program doesn't stop and prints the correct -128.
The problem doesn't seem to occur when setting the top bit on an integer*2 or *3.