https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99989

            Bug ID: 99989
           Summary: [11 regression] False maybe-uninitialized warning
                    breaks bootstrap on riscv64
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sch...@linux-m68k.org
                CC: hubicka at gcc dot gnu.org
            Blocks: 24639, 98265
  Target Milestone: ---
            Target: riscv64-*-*

In function ‘alloca_type_and_limit alloca_call_type(range_query&, gimple*, bool
’,
    inlined from ‘virtual unsigned int pass_walloca::execute(function*)’ at
../../gcc/gimple-ssa-warn-alloca.c:295:25:
../../gcc/gimple-ssa-warn-alloca.c:206:13: error: ‘*(long int*)((char*)&ret +
offsetof(alloca_type_and_limit,
alloca_type_and_limit::limit.generic_wide_int<wide_int_storage>::<unnamed>.wide_int_storage::val[0]))’
may be used uninitialized  -Werror=maybe-uninitialized]
  206 |         ret = alloca_type_and_limit (ALLOCA_OK);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../gcc/gimple-ssa-warn-alloca.c: In member function ‘virtual unsigned int
pass_walloca::execute(function*)’:
../../gcc/gimple-ssa-warn-alloca.c:200:32: note: ‘ret’ declared here
  200 |   struct alloca_type_and_limit ret = alloca_type_and_limit (ALLOCA_OK);
      |                                ^~~
In function ‘alloca_type_and_limit alloca_call_type(range_query&, gimple*, bool
’,
    inlined from ‘virtual unsigned int pass_walloca::execute(function*)’ at
../../gcc/gimple-ssa-warn-alloca.c:295:25:
../../gcc/gimple-ssa-warn-alloca.c:206:13: error: ‘*(long int*)((char*)&ret +
offsetof(alloca_type_and_limit,
alloca_type_and_limit::limit.generic_wide_int<wide_int_storage>::<unnamed>.wide_int_storage::val[1]))’
may be used uninitialized  -Werror=maybe-uninitialized]
  206 |         ret = alloca_type_and_limit (ALLOCA_OK);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../gcc/gimple-ssa-warn-alloca.c: In member function ‘virtual unsigned int
pass_walloca::execute(function*)’:
../../gcc/gimple-ssa-warn-alloca.c:200:32: note: ‘ret’ declared here
  200 |   struct alloca_type_and_limit ret = alloca_type_and_limit (ALLOCA_OK);
      |                                ^~~
In function ‘alloca_type_and_limit alloca_call_type(range_query&, gimple*, bool
’,
    inlined from ‘virtual unsigned int pass_walloca::execute(function*)’ at
../../gcc/gimple-ssa-warn-alloca.c:295:25:
../../gcc/gimple-ssa-warn-alloca.c:206:13: error: ‘*(long int*)((char*)&ret +
offsetof(alloca_type_and_limit,
alloca_type_and_limit::limit.generic_wide_int<wide_int_storage>::<unnamed>.wide_int_storage::val[2]))’
may be used uninitialized  -Werror=maybe-uninitialized]
  206 |         ret = alloca_type_and_limit (ALLOCA_OK);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../gcc/gimple-ssa-warn-alloca.c: In member function ‘virtual unsigned int
pass_walloca::execute(function*)’:
../../gcc/gimple-ssa-warn-alloca.c:200:32: note: ‘ret’ declared here
  200 |   struct alloca_type_and_limit ret = alloca_type_and_limit (ALLOCA_OK);
      |                                ^~~
In function ‘alloca_type_and_limit alloca_call_type(range_query&, gimple*, bool
’,
    inlined from ‘virtual unsigned int pass_walloca::execute(function*)’ at
../../gcc/gimple-ssa-warn-alloca.c:295:25:
../../gcc/gimple-ssa-warn-alloca.c:206:13: error: ‘*(unsigned int*)((char*)&ret
+ offsetof(alloca_type_and_limit,
alloca_type_and_limit::limit.generic_wide_int<wide_int_storage>::<unnamed>.wide_int_storage::len))’
may be used uninitialized [-Werror=maybe-uninitialized]
  206 |         ret = alloca_type_and_limit (ALLOCA_OK);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../gcc/gimple-ssa-warn-alloca.c: In member function ‘virtual unsigned int
pass_walloca::execute(function*)’:
../../gcc/gimple-ssa-warn-alloca.c:200:32: note: ‘ret’ declared here
  200 |   struct alloca_type_and_limit ret = alloca_type_and_limit (ALLOCA_OK);
      |                                ^~~
In function ‘alloca_type_and_limit alloca_call_type(range_query&, gimple*, bool
’,
    inlined from ‘virtual unsigned int pass_walloca::execute(function*)’ at
../../gcc/gimple-ssa-warn-alloca.c:295:25:
../../gcc/gimple-ssa-warn-alloca.c:206:13: error: ‘*(unsigned int*)((char*)&ret
+ offsetof(alloca_type_and_limit,
alloca_type_and_limit::limit.generic_wide_int<wide_int_storage>::<unnamed>.wide_int_storage::precision))’
may be used uninitialized [-Werror=maybe-uninitialized]
  206 |         ret = alloca_type_and_limit (ALLOCA_OK);
      |         ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../gcc/gimple-ssa-warn-alloca.c: In member function ‘virtual unsigned int
pass_walloca::execute(function*)’:
../../gcc/gimple-ssa-warn-alloca.c:200:32: note: ‘ret’ declared here
  200 |   struct alloca_type_and_limit ret = alloca_type_and_limit (ALLOCA_OK);
      |                                ^~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:1142: gimple-ssa-warn-alloca.o] Error 1


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98265
[Bug 98265] [10/11 Regression] gcc-10 has significantly worse code generated
with -O2 compared to -O1 (or gcc-9 -O2) when using the Eigen C++ library

Reply via email to