This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/84947] UBSAN: ipcp_bits_lattice::meet_with(generic_wide_int<fixed_wide_int_storage<192> >, generic_wide_int<fixed_wide_int_storage<192> >, unsigned int) ../../gcc/ipa-cp.c:1058
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 Mar 2018 14:25:08 +0000
- Subject: [Bug ipa/84947] UBSAN: ipcp_bits_lattice::meet_with(generic_wide_int<fixed_wide_int_storage<192> >, generic_wide_int<fixed_wide_int_storage<192> >, unsigned int) ../../gcc/ipa-cp.c:1058
- Auto-submitted: auto-generated
- References: <bug-84947-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84947
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
I can confirm it works for me:
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index ee41a8d55b7..96fff686a3a 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1813,7 +1813,8 @@ propagate_bits_across_jump_function (cgraph_edge *cs, int
idx,
/* For K&R C programs, ipa_get_type() could return NULL_TREE.
Avoid the transform for these cases. */
- if (!parm_type)
+ if (!parm_type || !(INTEGRAL_TYPE_P (parm_type)
+ || POINTER_TYPE_P (parm_type)))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Setting dest_lattice to bottom, because"
I'm leaving that to Martin.