This patch is unchanged from that which was posted before. Discussion fizzled out there and I was too busy with other patches to restart it then. This issue needs to be resolved before libgfortran can be compiled for GCN. The IRA pass makes an assumption that any pseudos created after the pass begins were created explicitly by the pass itself and therefore will have corresponding entries in its other tables. The GCN back-end, however, often creates additional pseudos, in expand patterns, to represent the necessary EXEC value, and these break IRA's assumption and cause ICEs: ..../libgfortran/generated/matmul_r8.c: In function 'matmul_r8': ..../libgfortran/generated/matmul_r8.c:3002:1: internal compiler error: in setup_preferred_alternate_classes_for_new_pseudos, at ira.c:2772 This patch simply has IRA skip unknown pseudos, and the problem goes away. Presumably, it's not ideal that these registers have not been processed by IRA, but it does not appear to do any real harm. 2018-11-16 Andrew Stubbs gcc/ * ira.c (setup_preferred_alternate_classes_for_new_pseudos): Skip pseudos not created by this pass. (move_unallocated_pseudos): Likewise. --- gcc/ira.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)