[PATCH] rs6000_adjust_cost old thinko

David Edelsohn dje.gcc@gmail.com
Sun Nov 29 18:52:00 GMT 2015


When rs6000_adjust_cost originally was written, the return value from
recog_memoized() was handled incorrectly.

Note this also is wrong on PA and one of the SPARC adjust_cost macros.

Bootstrapped on powrepc-ibm-aix7.1.0.0.

PR target/28115
* config/rs6000/rs6000.c (rs6000_adjust_cost): Correct recog_memoized
test for insn and check recog_memoized for dep_insn.

Index: rs6000.c
===================================================================
--- rs6000.c    (revision 231044)
+++ rs6000.c    (working copy)
@@ -28544,8 +28544,8 @@ rs6000_adjust_cost (rtx_insn *insn, rtx link, rtx_
 {
   enum attr_type attr_type;

-  if (! recog_memoized (insn))
-    return 0;
+  if (recog_memoized (insn) < 0 || recog_memoized (dep_insn) < 0)
+    return cost;

   switch (REG_NOTE_KIND (link))
     {



More information about the Gcc-patches mailing list