public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix seq_cost prototype to use signed int
@ 2015-09-08 12:26 Jiong Wang
  2015-09-08 15:03 ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Jiong Wang @ 2015-09-08 12:26 UTC (permalink / raw)
  To: gcc-patches List

[-- 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))

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-08 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-08 12:26 [PATCH] Fix seq_cost prototype to use signed int Jiong Wang
2015-09-08 15:03 ` Jeff Law
2015-09-08 15:27   ` Jiong Wang
2015-09-08 15:39     ` Jeff Law

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).