https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90244
Bug ID: 90244 Summary: [UBSAN]: in get_object_alignment_2 Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- Following on from PR 85164, I tried out a UBSAN version of gcc trunk with test suite file gcc.dg/Warray-bounds-22.c and flag -O2 and got this: ../../trunk/gcc/poly-int.h:1095:5: runtime error: signed integer overflow: 92233 72036854775807 * 8 cannot be represented in type 'long int' #0 0xf85e20 in poly_int<1u, poly_result<long, if_nonpoly<int, int, poly_int_ traits<int>::is_poly>::type, poly_coeff_pair_traits<long, if_nonpoly<int, int, p oly_int_traits<int>::is_poly>::type>::result_kind>::type> operator*<1u, long, in t>(poly_int_pod<1u, long> const&, int const&) ../../trunk/gcc/poly-int.h:1095 #1 0xf85e20 in get_object_alignment_2 ../../trunk/gcc/builtins.c:344 #2 0xf86d9d in get_object_alignment_1(tree_node*, unsigned int*, unsigned lo ng*) ../../trunk/gcc/builtins.c:394 #3 0xf86d9d in get_object_alignment(tree_node*) ../../trunk/gcc/builtins.c:4 05 #4 0x1690d75 in expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expan d_modifier, rtx_def**, bool) ../../trunk/gcc/expr.c:10343 #5 0x16939b8 in expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expan d_modifier, rtx_def**, bool) ../../trunk/gcc/expr.c:9947 #6 0x16ecf5c in expand_expr ../../trunk/gcc/expr.h:279