diff mbox

rs6000_adjust_cost old thinko

Message ID 1712766.eG3y3HtxQQ@polaris
State New
Headers show

Commit Message

Eric Botcazou Nov. 30, 2015, 9:44 a.m. UTC
> Note this also is wrong on PA and one of the SPARC adjust_cost macros.

Thanks for the heads up, fixed thusly, applied on the mainline


	PR target/28115
	* config/sparc/sparc.c (supersparc_adjust_cost): Fix thinko.
	(sparc_adjust_cost): Add missing space.

Comments

David Edelsohn Nov. 30, 2015, 1:38 p.m. UTC | #1
On Mon, Nov 30, 2015 at 4:44 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> Note this also is wrong on PA and one of the SPARC adjust_cost macros.
>
> Thanks for the heads up, fixed thusly, applied on the mainline
>
>
>         PR target/28115
>         * config/sparc/sparc.c (supersparc_adjust_cost): Fix thinko.
>         (sparc_adjust_cost): Add missing space.

Eric,

FYI, the function should test recog_memoized (dep_insn) also.

- David
Eric Botcazou Nov. 30, 2015, 4:51 p.m. UTC | #2
> FYI, the function should test recog_memoized (dep_insn) also.

I don't think that's needed as it doesn't call get_attr_type on dep_insn.
diff mbox

Patch

Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c	(revision 231010)
+++ config/sparc/sparc.c	(working copy)
@@ -9353,8 +9353,8 @@  supersparc_adjust_cost (rtx_insn *insn,
 {
   enum attr_type insn_type;
 
-  if (! recog_memoized (insn))
-    return 0;
+  if (recog_memoized (insn) < 0)
+    return cost;
 
   insn_type = get_attr_type (insn);
 
@@ -9487,7 +9487,7 @@  hypersparc_adjust_cost (rtx_insn *insn,
 }
 
 static int
-sparc_adjust_cost(rtx_insn *insn, rtx link, rtx_insn *dep, int cost)
+sparc_adjust_cost (rtx_insn *insn, rtx link, rtx_insn *dep, int cost)
 {
   switch (sparc_cpu)
     {