diff mbox

[COMMITTED] Fix silly error in aarch64_register_move_cost

Message ID 53514CA4.3060704@redhat.com
State New
Headers show

Commit Message

Richard Henderson April 18, 2014, 4:02 p.m. UTC
Building mainline I got

> .../aarch64.c:4879:134: error: invalid conversion from ‘reg_class_t {aka int}’ to ‘machine_mode’ [-fpermissive]
>    if (! TARGET_SIMD && GET_MODE_SIZE (from) == 128 && GET_MODE_SIZE (to) == 128)

Sure enough, TO and FROM are not modes.  Did mainline just change away from
permissive or something?  It surely seems like we ought to have seen this
earlier...

Anyway, applied as obvious to all active branches.


r~
* config/aarch64/aarch64.c (aarch64_register_move_cost): Pass a mode
        to GET_MODE_SIZE, not a reg_class_t.

Comments

Jeff Law April 18, 2014, 8:12 p.m. UTC | #1
On 04/18/14 10:02, Richard Henderson wrote:
> Building mainline I got
>
>> .../aarch64.c:4879:134: error: invalid conversion from ‘reg_class_t {aka int}’ to ‘machine_mode’ [-fpermissive]
>>     if (! TARGET_SIMD && GET_MODE_SIZE (from) == 128 && GET_MODE_SIZE (to) == 128)
>
> Sure enough, TO and FROM are not modes.  Did mainline just change away from
> permissive or something?  It surely seems like we ought to have seen this
> earlier...
I haven't looked at GET_MODE_XXX, but most, if not of the RTL checking 
is disabled because it's too expensive.

I'm hoping that David's work will take us to a place where we can do 
more static checking on the RTL bits too.

jeff
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index a3147ee..7b6c2b3 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4847,9 +4847,11 @@  aarch64_address_cost (rtx x ATTRIBUTE_UNUSED,
 }
 
 static int
-aarch64_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
-			    reg_class_t from, reg_class_t to)
+aarch64_register_move_cost (enum machine_mode mode,
+			    reg_class_t from_i, reg_class_t to_i)
 {
+  enum reg_class from = (enum reg_class) from_i;
+  enum reg_class to = (enum reg_class) to_i;
   const struct cpu_regmove_cost *regmove_cost
     = aarch64_tune_params->regmove_cost;
 
@@ -4875,8 +4877,7 @@  aarch64_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
      secondary reload.  A general register is used as a scratch to move
      the upper DI value and the lower DI value is moved directly,
      hence the cost is the sum of three moves. */
-
-  if (! TARGET_SIMD && GET_MODE_SIZE (from) == 128 && GET_MODE_SIZE (to) == 128)
+  if (! TARGET_SIMD && GET_MODE_SIZE (mode) == 128)
     return regmove_cost->GP2FP + regmove_cost->FP2GP + regmove_cost->FP2FP;
 
   return regmove_cost->FP2FP;