diff mbox

aarch64 simd index out of range message not correct on 32 bit host

Message ID CAH=PD7ZXUEHYawZz4JTCSKGHe_aYHiOuwP0S0TpFNdJDaZXJaA@mail.gmail.com
State New
Headers show

Commit Message

Shiva Chen May 29, 2015, 8:32 a.m. UTC
Hi, Andrew

I modify the patch as you suggestion and testing on 32/64 bit host.

Thanks your tips.

I really appreciate for your help.

Shiva

2015-05-29 15:57 GMT+08:00 Andrew Pinski <pinskia@gmail.com>:
> On Fri, May 29, 2015 at 3:46 PM, Shiva Chen <shiva0217@gmail.com> wrote:
>> Hi, Andrew
>>
>> You are right, it's much simpler.
>>
>> Could you give me a tip how %wd works on GCC ?
>
> the w modifier is the GCC diagnostic format modifier that specifies
> HOST_WIDE_INT.
>
>>
>> Could you send a new patch to fix the message since you have better solution ?
>
> I don't build using a 32bit host so I can't test it.
>
> Thanks,
> Andrew
>
>>
>> Thanks,
>>
>> Shiva
>>
>> 2015-05-29 15:13 GMT+08:00 Andrew Pinski <pinskia@gmail.com>:
>>> On Fri, May 29, 2015 at 2:33 PM, Shiva Chen <shiva0217@gmail.com> wrote:
>>>> Hi,
>>>>
>>>> I notice that aarch64 simd index range message not correct on 32 bit host.
>>>>
>>>> The message print by the function aarch64_simd_lane_bounds in aarch64.c.
>>>>
>>>> The function print HOST_WIDE_INT variable by %ld which is correct on
>>>> 64 bit host.
>>>>
>>>> However, on 32 bit host HOST_WIDE_INT would be long long.
>>>>
>>>> Therefore, print out incorrect message on 32 bit host.
>>>>
>>>> Fix the message by printing HOST_WIDE_INT variables on 32 bit host by %lld.
>>>
>>>
>>> Actually there is a simpler way.  Since this is error which uses the
>>> GCC diagnostic format you can just use %wd instead.
>>> So:
>>> error ("%Klane %ld out of range %ld - %ld", exp, lane, low, high - 1);
>>> Becomes:
>>> error ("%Klane %wd out of range %wd - %wd", exp, lane, low, high - 1);
>>>
>>> Thanks,
>>> Andrew Pinski
>>>
>>>>
>>>>
>>>> Shiva

Comments

Marcus Shawcroft June 15, 2015, 9:59 a.m. UTC | #1
On 29 May 2015 at 09:32, Shiva Chen <shiva0217@gmail.com> wrote:
> Hi, Andrew
>
> I modify the patch as you suggestion and testing on 32/64 bit host.
>
> Thanks your tips.
>
> I really appreciate for your help.
>
> Shiva

OK and committed with this ChangeLog:

2015-06-14  Shiva Chen  <shiva0217@gmail.com>

* aarch64.c (aarch64_simd_lane_bounds): Change %ld to %wd for
HOST_WIDE_INT parameter.

/Marcus
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 083b9b4..5343d09 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -8903,9 +8903,9 @@  aarch64_simd_lane_bounds (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high,
   if (lane < low || lane >= high)
   {
     if (exp)
-      error ("%Klane %ld out of range %ld - %ld", exp, lane, low, high - 1);
+      error ("%Klane %wd out of range %wd - %wd", exp, lane, low, high - 1);
     else
-      error ("lane %ld out of range %ld - %ld", lane, low, high - 1);
+      error ("lane %wd out of range %wd - %wd", lane, low, high - 1);
   }
 }