This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/18019] [4.0 Regression] -march=pentium4 generates word fetch instead of byte fetch
- From: "neroden at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Dec 2004 03:35:42 -0000
- Subject: [Bug target/18019] [4.0 Regression] -march=pentium4 generates word fetch instead of byte fetch
- References: <20041015180025.18019.stuart@apple.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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