Patchwork [AArch64,costs,18/18] Dump a message if we are unable to cost an insn.

login
register
mail settings
Submitter James Greenhalgh
Date March 27, 2014, 5:33 p.m.
Message ID <1395941622-22926-19-git-send-email-james.greenhalgh@arm.com>
Download mbox | patch
Permalink /patch/334437/
State New
Headers show

Comments

James Greenhalgh - March 27, 2014, 5:33 p.m.
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  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.c (aarch64_rtx_costs): Handle the case
	where we were unable to cost an RTX.

Patch

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;
 }