public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@arm.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>,
	 Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: [PATCH][ARM] Use %wd format for lane printing in bounds_check
Date: Fri, 14 Aug 2015 10:20:00 -0000	[thread overview]
Message-ID: <55CDBB66.1010706@arm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

Hi all,

I'm seeing these warnings when building arm.c:
warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘long int’ [-Wformat=]

These appear in the bounds_check function when it tries to print out HOST_WIDE_INTs using the %lld format.
I believe the right way to print these is with %wd, which is what the equivalent aarch64 function does.

With this patch I don't see the warnings any more.
Bootstrapped and tested on arm.

Ok for trunk?

Thanks,
Kyrill

2015-08-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/arm/arm.c (bounds_check): Use %wd print format
     for HOST_WIDE_INT arguments.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: arm-bounds-err.patch --]
[-- Type: text/x-patch; name=arm-bounds-err.patch, Size: 810 bytes --]

commit 004a6baac827ae61c6be32f570decff56e987995
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Thu Aug 13 14:20:38 2015 +0100

    [ARM] Use %wd format for lane printing in bounds_check

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index a401f70..c9c8d7c 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -12847,10 +12847,10 @@ bounds_check (rtx operand, HOST_WIDE_INT low, HOST_WIDE_INT high,
   if (lane < low || lane >= high)
     {
       if (exp)
-	error ("%K%s %lld out of range %lld - %lld",
+	error ("%K%s %wd out of range %wd - %wd",
 	       exp, desc, lane, low, high - 1);
       else
-	error ("%s %lld out of range %lld - %lld", desc, lane, low, high - 1);
+	error ("%s %wd out of range %wd - %wd", desc, lane, low, high - 1);
     }
 }
 

             reply	other threads:[~2015-08-14  9:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14 10:20 Kyrill Tkachov [this message]
2015-08-19  8:17 ` Ramana Radhakrishnan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55CDBB66.1010706@arm.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ramana.radhakrishnan@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).