This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]