public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jiong Wang <jiong.wang@arm.com>
To: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: [PATCH] Fix seq_cost prototype to use signed int
Date: Tue, 08 Sep 2015 12:26:00 -0000	[thread overview]
Message-ID: <n994mj585o1.fsf@arm.com> (raw)

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


All other cost helper functions are using signed int to hold cost
while seq_cost is using unsigned int.

This fix this. bootstrap OK on x86.

OK for trunk?

2015-09-08  Jiong Wang  <jiong.wang@arm.com>

gcc/
  * rtl.h (seq_cost): Change return type from "unsigned" to "int".
  * rtlanal.c (seq_cost): Likewise.
  
-- 
Regards,
Jiong


[-- Attachment #2: seq_cost.patch --]
[-- Type: text/x-diff, Size: 948 bytes --]

diff --git a/gcc/rtl.h b/gcc/rtl.h
index ac56133..ded054c 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3050,7 +3050,7 @@ extern rtx_insn *find_first_parameter_load (rtx_insn *, rtx_insn *);
 extern bool keep_with_call_p (const rtx_insn *);
 extern bool label_is_jump_target_p (const_rtx, const rtx_insn *);
 extern int insn_rtx_cost (rtx, bool);
-extern unsigned seq_cost (const rtx_insn *, bool);
+extern int seq_cost (const rtx_insn *, bool);

 /* Given an insn and condition, return a canonical description of
    the test being made.  */
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index ef98f4b..2f14b93 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -5160,10 +5160,10 @@ insn_rtx_cost (rtx pat, bool speed)

 /* Returns estimate on cost of computing SEQ.  */

-unsigned
+int
 seq_cost (const rtx_insn *seq, bool speed)
 {
-  unsigned cost = 0;
+  int cost = 0;
   rtx set;

   for (; seq; seq = NEXT_INSN (seq))

             reply	other threads:[~2015-09-08 12:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-08 12:26 Jiong Wang [this message]
2015-09-08 15:03 ` Jeff Law
2015-09-08 15:27   ` Jiong Wang
2015-09-08 15:39     ` Jeff Law

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=n994mj585o1.fsf@arm.com \
    --to=jiong.wang@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).