This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH,MIPS,committed] Fix wrong use of XINT instead of INTVAL
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: Matthew Fortune <mfortune at gmail dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 1 Mar 2018 12:39:55 +0000
- Subject: Re: [PATCH,MIPS,committed] Fix wrong use of XINT instead of INTVAL
- Authentication-results: sourceware.org; auth=none
- References: <00b401d3b151$c5da9420$518fbc60$@gmail.com>
Hi Matthew,
> This issue was caught with assert checking enabled but is not a
> functional bug as XINT(x, 0) happens to overlay INTVAL(x) anyway.
There's an intriguing difference between XINT (x, 0) and XWINT (x, 0)
involved here though, which does not appear to be documented in the
manual, and certainly not in Section 13.3 "Access to Operands" where I'd
expect it. I gather it is a matter of the operand being treated as `int'
vs HOST_WIDE_INT, and that is where the assertion comes from, as these
data types will necessarily be different for most hosts and cause an issue
here right away if the host is big-endian.
Thanks for catching and fixing this!
Maciej