@@ -1910,6 +1910,28 @@ propagate_context_accross_jump_function (cgraph_edge *cs,
return ret;
}
+static void
+verify_align_worse_p (ipcp_param_lattices *dest_plats)
+{
+ ipcp_alignment_lattice align_lattice = dest_plats->alignment;
+ ipcp_bits_lattice bits_lattice = dest_plats->bits_lattice;
+
+ if (bits_lattice.top_p ())
+ gcc_assert (align_lattice.top_p () || align_lattice.bottom_p ());
+
+ else if (bits_lattice.bottom_p ())
+ gcc_assert (align_lattice.bottom_p ());
+
+ else if ((!align_lattice.bottom_p () && !align_lattice.top_p ())
+ && bits_lattice.constant_p ())
+ {
+ bool align = align_lattice.align;
+ unsigned tem = bits_lattice.get_mask ().to_uhwi ();
+ unsigned bits_align = tem & -tem;
+ gcc_assert (align <= bits_align);
+ }
+}
+
/* Propagate alignments across jump function JFUNC that is associated with
edge CS and update DEST_LAT accordingly. */
@@ -2451,6 +2473,9 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
jump_func, dest_plats);
else
ret |= dest_plats->m_value_range.set_to_bottom ();
+
+ if (flag_ipa_cp_alignment && flag_ipa_bit_cp)
+ verify_align_worse_p (dest_plats);
}
}
for (; i < parms_count; i++)