- while (def_link)
- {
- if (DF_REF_REAL_REG (use) == DF_REF_REAL_REG (def_link->ref))
- unionfind_union (use_entry + DF_REF_ID (use),
- def_entry + DF_REF_ID (def_link->ref));
- def_link = def_link->next;
- }
+ if (def_link)
+ while (*def_link)
+ {
+ if (DF_REF_REAL_REG (use) == DF_REF_REAL_REG (*def_link))
+ (*fun) (use_entry + DF_REF_ID (use),
+ def_entry + DF_REF_ID (*def_link));
+ def_link++;
+ }
+ }
+
+ /* UD chains of uninitialized REGs are empty. Keeping all uses of
+ the same uninitialized REG in a single web is not necessary for
+ correctness, since the uses are undefined, but it's wasteful to
+ allocate one register or slot for each reference. Furthermore,
+ creating new pseudos for uninitialized references in debug insns
+ (see PR 42631) causes -fcompare-debug failures. We record the
+ number of the first uninitialized reference we found, and merge
+ with it any other uninitialized references to the same
+ register. */
+ if (!link)
+ {
+ int regno = REGNO (DF_REF_REAL_REG (use));
+ if (used[regno])
+ (*fun) (use_entry + DF_REF_ID (use), use_entry + used[regno] - 2);
+ else
+ used[regno] = DF_REF_ID (use) + 2;