------- Comment #2 from kazu at gcc dot gnu dot org 2006-05-11 18:54 ------- Here is a reduced testcase.
volatile short y; int foo (void) { return y; } With -O1, this function magically turns into "return 0;" like so foo: @ Function supports interworking. @ args = 0, pretend = 0, frame = 0 @ frame_needed = 0, uses_anonymous_args = 0 @ link register save eliminated. @ lr needed for prologue mov r0, #0 bx lr -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27538