[backport gcc-4.9/trunk r199029 + r199030 (ChangeLog fixup), fixes PR57304 regression from initial web-subreg-ice patch ] gcc/ 2013-05-17 Mike Stump PR rtl-optimization/57304 * web.c (union_match_dups): Ensure that DF_REF_LOC exists before accessing DF_REF_REAL_LOC. --- gcc-4.8.0/gcc/web.c.~1~ 2013-05-18 12:09:15.336278228 +0200 +++ gcc-4.8.0/gcc/web.c 2013-05-18 12:12:08.295434931 +0200 @@ -133,9 +133,10 @@ union_match_dups (rtx insn, struct web_e entry = type == OP_IN ? use_entry : def_entry; for (; *ref; ref++) { - if (DF_REF_LOC (*ref) == recog_data.operand_loc[op]) + rtx *l = DF_REF_LOC (*ref); + if (l == recog_data.operand_loc[op]) break; - if (DF_REF_REAL_LOC (*ref) == recog_data.operand_loc[op]) + if (l && DF_REF_REAL_LOC (*ref) == recog_data.operand_loc[op]) break; } @@ -143,9 +144,10 @@ union_match_dups (rtx insn, struct web_e { for (ref = use_link, entry = use_entry; *ref; ref++) { - if (DF_REF_LOC (*ref) == recog_data.operand_loc[op]) + rtx *l = DF_REF_LOC (*ref); + if (l == recog_data.operand_loc[op]) break; - if (DF_REF_REAL_LOC (*ref) == recog_data.operand_loc[op]) + if (l && DF_REF_REAL_LOC (*ref) == recog_data.operand_loc[op]) break; } }