This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: aarch64 simd index out of range message not correct on 32 bit host
- From: Shiva Chen <shiva0217 at gmail dot com>
- To: Andrew Pinski <pinskia at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 29 May 2015 15:46:16 +0800
- Subject: Re: aarch64 simd index out of range message not correct on 32 bit host
- Authentication-results: sourceware.org; auth=none
- References: <CAH=PD7YNAQfz5VAxdf3OEBaa9MZ7bcAuiPUt2HiBrt4mQRR_ZQ at mail dot gmail dot com> <CA+=Sn1mGLz5XsNf5_fOZNZEneb_Rz5n_V2p8HiKMzR1g=WXecA at mail dot gmail dot com>
Hi, Andrew
You are right, it's much simpler.
Could you give me a tip how %wd works on GCC ?
Could you send a new patch to fix the message since you have better solution ?
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