[RS6000] rs6000_rtx_costs for PLUS/MINUS constant
authorAlan Modra <amodra@gmail.com>
Thu, 18 Jun 2015 10:49:55 +0000 (20:19 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 24 Sep 2020 03:22:23 +0000 (12:52 +0930)
These functions do behave a little differently for SImode, so the
mode should be passed.

* config/rs6000/rs6000.c (rs6000_rtx_costs): Pass mode to
reg_or_add_cint_operand and reg_or_sub_cint_operand.

gcc/config/rs6000/rs6000.c

index 5f4e2927a212656a8aa697fd4ba72ddcef3c30f0..375fff59928a4b7b2ccb23636e4fd15ff8c10393 100644 (file)
@@ -21176,9 +21176,9 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code,
          return true;
        }
       else if ((outer_code == PLUS
-               && reg_or_add_cint_operand (x, VOIDmode))
+               && reg_or_add_cint_operand (x, mode))
               || (outer_code == MINUS
-                  && reg_or_sub_cint_operand (x, VOIDmode))
+                  && reg_or_sub_cint_operand (x, mode))
               || ((outer_code == SET
                    || outer_code == IOR
                    || outer_code == XOR)