https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127151
Bug ID: 127151
Summary: -Werror=maybe-uninitialized when compiling GCC trunk
from source
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: diagnostics
Assignee: dmalcolm at redhat dot com
Reporter: carlosgalvezp at gmail dot com
Target Milestone: ---
Hi,
I am trying to build GCC trunk (99266eead94c8aca7faa1e06d886c2f4abdbb1ed) from
source on Ubuntu 24.04 (GCC 13). The configure/build command is:
RUN /tmp/gcc/configure \
--prefix=${OUTPUT_DIR}/usr \
--with-sysroot=/tmp/sysroot \
--enable-languages=c,c++ \
--enable-checking=release \
--disable-multilib
RUN make -j $(nproc)
Doing that I get:
#15 647.1 In file included from /tmp/gcc/gcc/coretypes.h:479,
#15 647.1 from /tmp/gcc/gcc/gimple-ssa-warn-access.cc:26:
#15 647.1 In member function 'long int* wide_int_storage::write_val(unsigned
int)',
#15 647.1 inlined from 'void wi::copy(T1&, const T2&) [with T1 =
wide_int_storage; T2 = generic_wide_int<wide_int_ref_storage<true, false> >]'
at /tmp/gcc/gcc/wide-int.h:2187:37,
#15 647.1 inlined from 'wide_int_storage& wide_int_storage::operator=(const
T&) [with T = wi::hwi_with_prec]' at /tmp/gcc/gcc/wide-int.h:1247:12,
#15 647.1 inlined from 'generic_wide_int<storage>&
generic_wide_int<T>::operator=(const T&) [with T = wi::hwi_with_prec; storage =
wide_int_storage]' at /tmp/gcc/gcc/wide-int.h:1002:23,
#15 647.1 inlined from 'void irange_bitmask::set_unknown(unsigned int)' at
/tmp/gcc/gcc/value-range.h:185:27,
#15 647.1 inlined from 'virtual void irange::set_varying(tree)' at
/tmp/gcc/gcc/value-range.h:1245:25,
#15 647.1 inlined from 'int_range<N, RESIZABLE>::int_range(tree) [with
unsigned int N = 3; bool RESIZABLE = true]' at
/tmp/gcc/gcc/value-range.h:1207:15,
#15 647.1 inlined from 'bool {anonymous}::memmodel_to_uhwi(tree, gimple*,
long unsigned int*)' at /tmp/gcc/gcc/gimple-ssa-warn-access.cc:2870:41:
#15 647.1 /tmp/gcc/gcc/wide-int.h:1272:73: error: 'rng.int_range<3,
true>::<unnamed>.irange::m_bitmask.irange_bitmask::m_value.generic_wide_int<wide_int_storage>::<unnamed>.wide_int_storage::u.wide_int_storage::<unnamed
union>::valp' may be used uninitialized [-Werror=maybe-uninitialized]
#15 647.1 1272 | return UNLIKELY (precision > WIDE_INT_MAX_INL_PRECISION) ?
u.valp : u.val;
#15 647.1 |
^~~
This fails the build since the warning is treated as an error.
Is this a known issue?