+2016-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/78575
+ * config/i386/i386.c (timode_scalar_chain::fix_debug_reg_uses): Use
+ DF infrastructure to wrap all V1TImode reg uses into TImode subreg
+ if not already wrapped in a subreg. Make sure df_insn_rescan does not
+ affect further iterations.
+
2016-12-02 Martin Liska <mliska@suse.cz>
PR ipa/78555
if (!flag_var_tracking)
return;
- df_ref ref;
- for (ref = DF_REG_USE_CHAIN (REGNO (reg));
- ref;
- ref = DF_REF_NEXT_REG (ref))
+ df_ref ref, next;
+ for (ref = DF_REG_USE_CHAIN (REGNO (reg)); ref; ref = next)
{
rtx_insn *insn = DF_REF_INSN (ref);
+ /* Make sure the next ref is for a different instruction,
+ so that we're not affected by the rescan. */
+ next = DF_REF_NEXT_REG (ref);
+ while (next && DF_REF_INSN (next) == insn)
+ next = DF_REF_NEXT_REG (next);
+
if (DEBUG_INSN_P (insn))
{
/* It may be a debug insn with a TImode variable in
register. */
- rtx val = PATTERN (insn);
- if (GET_MODE (val) != TImode)
- continue;
- gcc_assert (GET_CODE (val) == VAR_LOCATION);
- rtx loc = PAT_VAR_LOCATION_LOC (val);
- /* It may have been converted to TImode already. */
- if (GET_MODE (loc) == TImode)
- continue;
- gcc_assert (REG_P (loc)
- && GET_MODE (loc) == V1TImode);
- /* Convert V1TImode register, which has been updated by a SET
- insn before, to SUBREG TImode. */
- PAT_VAR_LOCATION_LOC (val) = gen_rtx_SUBREG (TImode, loc, 0);
- df_insn_rescan (insn);
+ bool changed = false;
+ for (; ref != next; ref = DF_REF_NEXT_REG (ref))
+ {
+ rtx *loc = DF_REF_LOC (ref);
+ if (REG_P (*loc) && GET_MODE (*loc) == V1TImode)
+ {
+ *loc = gen_rtx_SUBREG (TImode, *loc, 0);
+ changed = true;
+ }
+ }
+ if (changed)
+ df_insn_rescan (insn);
}
}
}
+2016-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/78575
+ * gcc.dg/pr78575.c: New test.
+
2016-12-02 Dominik Vogt <vogt@linux.vnet.ibm.com>
* gcc.target/s390/litpool-r3-1.c: Fix label number test.
--- /dev/null
+/* PR rtl-optimization/78575 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -g -Wno-psabi" } */
+
+typedef unsigned __int128 V __attribute__((vector_size(64)));
+
+V g;
+
+void
+foo (V v)
+{
+ unsigned __int128 x = 1;
+ int c = v[1] <= ~x;
+ v &= v[1];
+ g = v;
+}