CVSROOT:        /cvs
Module name:    src
Changes by:     m...@cvs.openbsd.org    2012/12/01 15:54:02

Modified files:
        gnu/usr.bin/gcc/gcc: reload1.c 

Log message:
reload_cse_noop_set_p(): invoking rtx_equal_for_cselib_p() is not enough; if
it reports the dest and source parts of the set insn are identical, we need
to check whether they are volatile memory references, and return 0 (not a
noop) in that case.

This allows `*volatile_ptr = *volatile_ptr;' constructs to no longer be
incorrectly optimized away on platforms which can perform memory to memory
transfers in a single instruction (i.e. m68k and vax).

Found the hard way on vax, where some systems need to frob the interrupt
stack early, before being able to handle faults, and a gcc3-built kernel
would have this operation optimized away, leading to a quick system reset.

Reply via email to