+2016-10-21 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ PR target/71627
+ * reload.c (find_valid_class_1): Allow regclass if atleast one
+ regno in regclass is ok. Compute and use rclass size based on
+ actually available regnos for mode in rclass.
+
2016-10-21 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sparc-modes.def (CCV): New.
for (rclass = 1; rclass < N_REG_CLASSES; rclass++)
{
- int bad = 0;
- for (regno = 0; regno < FIRST_PSEUDO_REGISTER && !bad; regno++)
- {
- if (in_hard_reg_set_p (reg_class_contents[rclass], mode, regno)
- && !HARD_REGNO_MODE_OK (regno, mode))
- bad = 1;
- }
-
- if (bad)
- continue;
+ unsigned int computed_rclass_size = 0;
+
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ {
+ if (in_hard_reg_set_p (reg_class_contents[rclass], mode, regno)
+ && (HARD_REGNO_MODE_OK (regno, mode)))
+ computed_rclass_size++;
+ }
cost = register_move_cost (outer, (enum reg_class) rclass, dest_class);
- if ((reg_class_size[rclass] > best_size
+ if ((computed_rclass_size > best_size
&& (best_cost < 0 || best_cost >= cost))
|| best_cost > cost)
{
best_class = (enum reg_class) rclass;
- best_size = reg_class_size[rclass];
+ best_size = computed_rclass_size;
best_cost = register_move_cost (outer, (enum reg_class) rclass,
dest_class);
}
+2016-10-21 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ PR target/71627
+ * gcc.target/avr/pr71627.c: New test
+
2016-10-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc.target/sparc/overflow-1.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+
+extern volatile __memx const long a, b, c, d, e, f;
+extern volatile long result;
+
+extern void vfunc (const char*, ...);
+
+void foo (void)
+{
+ result = a + b + c + d + e + f;
+ vfunc ("text", a, b, c, d, e, f, result);
+}