@@ -436,7 +436,7 @@ struct processor_costs iamcu_cost = {
COSTS_N_INSNS (3), /* cost of movsx */
COSTS_N_INSNS (2), /* cost of movzx */
8, /* "large" insn */
- 6, /* MOVE_RATIO */
+ 9, /* MOVE_RATIO */
6, /* cost for loading QImode using movzbl */
{2, 4, 2}, /* cost of loading integer registers
in QImode, HImode and SImode.
new file mode 100644
@@ -0,0 +1,20 @@
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-O3 -fno-tree-fre -fno-tree-pre -fdump-tree-optimized -mtune=iamcu" } */
+
+int
+foo ()
+{
+ const int a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
+ int i, sum;
+
+ sum = 0;
+ for (i = 0; i < sizeof (a) / sizeof (*a); i++)
+ sum += a[i];
+
+ return sum;
+}
+
+/* After late unrolling the above loop completely DOM should be
+ able to optimize this to return 28. */
+
+/* { dg-final { scan-tree-dump "return 28;" "optimized" } } */