In the latest reload.c, the function combine_reloads() includes a wrong evaluation order of expressions to check if there is any available hard register.
In the following statements in combine_reloads(), the candidate register must be checked whether it is a hard register or not before invoking the function reg_overlap_mentioned_for_reload_p(). Otherwise, reg_overlap_mentioned_for_reload_p() will fail and die when it is invoked and the candidate register is a pseudo register. File: reload.c Revision: 1.268, Thu Feb 24 22:06:06 2005 UTC (5 weeks, 1 day ago) by dje 1837: /* See if some hard register that dies in this insn and is not used in 1838: the output is the right class. Only works if the register we pick 1839: up can fully hold our output reload. */ 1840: for (note = REG_NOTES (this_insn); note; note = XEXP (note, 1)) 1841: if (REG_NOTE_KIND (note) == REG_DEAD 1842: && REG_P (XEXP (note, 0)) 1843: && ! reg_overlap_mentioned_for_reload_p (XEXP (note, 0), 1844: rld[output_reload].out) 1845: && REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER -- Summary: Wrong evaluation order of expressions in combine_reloads() in reload.c Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P2 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kumura at r2 dot dion dot ne dot jp CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20728