Hi,
If we are unable to fully cost an RTX, we should return the default
cost and avoid recursing to the operands. This will bias us towards
picking "bigger" RTX - which presumably have been added as patterns
because somebody expects them to be more efficient.
To aid future debugging and development, we also dump our shortcomings.
Tested on aarch64-none-elf with no issues.
OK for 5.0?
Thanks,
James
---
2014-03-27 James Greenhalgh <[email protected]>
* config/aarch64/aarch64.c (aarch64_rtx_costs): Handle the case
where we were unable to cost an RTX.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 8ebb3d0..f284641 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5734,7 +5734,11 @@ cost_plus:
/* Fall through. */
default:
- break;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ "\nFailed to cost RTX. Assuming default cost.\n");
+
+ return true;
}
return false;
}