------- Additional Comments From neroden at gcc dot gnu dot org 2004-12-02 03:35 ------- Jan's message quoted in the previous comment seems to be orthogonal to the main problem in this bug. The problem is that a word fetch is being generated which *reads out of bounds memory*. If the last byte in a page is being fetched, you must not extend that to fetch the next byte; if the first byte in a page is being fetched, you must not extend that to fetch the previous byte. Those are the key failure situations which must be prevented, regardless of whether this is -Os, -O2, or -O0. It doesn't appear to me that the changes proposed in Jan's message actually address that, since none of them seem to feature a alignment or other type of correctness check before converting a QImode move into a (possibly illegal) SImode move. In particular, this statement looks like it's wrong: >while for >TARGET_PARTIAL_REG_STALL/TARGET_PARTIAL_REG_DEPENDENCY we can still use >the full moves as long as they don't encode longer. I believe a check is required that the full moves don't cause a segmentation violation. An alignment check would be sufficient (it would prohibit more cases than strictly necessary, but this is a correctness issue, and I haven't thought of a better check).
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18019