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

            Bug ID: 120924
           Summary: [15/16 Regression] -Wmaybe-uninitialized regression on
                    s390x
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

It was reported that on s390x there's a -Wmaybe-uninitialized regression on the
15 branch.

I have reduced the following testcase which with -O2 -std=gnu89
-Wmaybe-uninitialized is diagnosed by a s390x compiler but not by x86-64.

The key seems to be a wastly different IL due to how we lower the switch(?).

On s390x we exceed --param uninit-max-chain-len, with the reduced testcase
it's enough to bump it by 1, the original testcase requires bumping to 12
(from 8).  Note the work we do is quadratic in what these limits limit.

Reduced testcase:

int foo(int);
enum {
  BPF_TRACE_RAW_TP,
  BPF_MODIFY_RETURN,
  BPF_LSM_MAC,
  BPF_TRACE_ITER,
  BPF_LSM_CGROUP
};
int btf_get_kernel_prefix_kind_prefix, obj_1, attach_name___trans_tmp_1;
char attach_name_fn_name;
void attach_name(int attach_type) 
{
  int mod_len;
  char mod_name = attach_name_fn_name;
  if (attach_name_fn_name)
    mod_len = mod_name;
  for (; obj_1;) {
    if (mod_name && foo(mod_len))
      continue;
    switch (attach_type) {
    case BPF_TRACE_RAW_TP:
    case BPF_LSM_MAC:
    case BPF_LSM_CGROUP:
      btf_get_kernel_prefix_kind_prefix = 1;
    case BPF_TRACE_ITER:
      attach_name_fn_name = 2;
    }
    if (attach_name___trans_tmp_1)
      return;
  }
}

Reply via email to