This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/78176] [MIPS] miscompiles ldxc1 with large pointers on 32-bits
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 01 Feb 2017 15:29:28 +0000
- Subject: [Bug target/78176] [MIPS] miscompiles ldxc1 with large pointers on 32-bits
- Auto-submitted: auto-generated
- References: <bug-78176-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78176
--- Comment #19 from Richard Biener <rguenth at gcc dot gnu.org> ---
I agree with the comments that this (if at all) needs to be fixed at RTL
expansion time where we already do quite some "hacks" for sizetype
in POINTER_PLUS_EXPR context:
case POINTER_PLUS_EXPR:
/* Even though the sizetype mode and the pointer's mode can be different
expand is able to handle this correctly and get the correct result out
of the PLUS_EXPR code. */
/* Make sure to sign-extend the sizetype offset in a POINTER_PLUS_EXPR
if sizetype precision is smaller than pointer precision. */
if (TYPE_PRECISION (sizetype) < TYPE_PRECISION (type))
treeop1 = fold_convert_loc (loc, type,
fold_convert_loc (loc, ssizetype,
treeop1));
/* If sizetype precision is larger than pointer precision, truncate the
offset to have matching modes. */
but I don't see from the comments in this bug what the actual stmt is the
critical one.