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

--- Comment #17 from Arnd Bergmann <arnd at linaro dot org> ---
Created attachment 43057
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43057&action=edit
linux/drivers/scsi/lpfc/lpfc_bsg.c, preprocessed and compressed

A possibly related warning I just saw this week, with and without the gcc
patch, and back to gcc-4.5+:

x86_64-linux-gcc-8.0.0 -fno-strict-aliasing -Wall -O2 -Wno-pointer-sign -m32 -c
-xc lpfc_bsg.i
/git/arm-soc/drivers/scsi/lpfc/lpfc_bsg.c: In function
'lpfc_bsg_rport_els_cmp':
/git/arm-soc/drivers/scsi/lpfc/lpfc_bsg.c:632:22: warning: 'bsg_reply' may be
used uninitialized in this function [-Wmaybe-uninitialized]

reduced to
8<----
long current_stack_pointer, lpfc_bsg_rport_els_cmp_rsp_0;
long pv_irq_ops_1_0, pv_irq_ops_0_0;
struct bsg_job {
  void *reply;
};
struct fc_bsg_reply {
  int reply_payload_rcv_len;
  struct bsg_job set_job;
} * lpfc_bsg_rport_els_cmp_dd_data;
static void check(long v)
{
  if (v) {
    asm("");
    __builtin_unreachable();
  }
}
void lpfc_bsg_rport_els_cmp(void) {
  struct bsg_job *job;
  struct fc_bsg_reply *bsg_reply;
  job = &lpfc_bsg_rport_els_cmp_dd_data->set_job;
  if (job)
    bsg_reply = job->reply;
  check(pv_irq_ops_0_0);
  check(pv_irq_ops_1_0);
  asm("" : "+r"(current_stack_pointer));
  check(pv_irq_ops_0_0);
  check(pv_irq_ops_1_0);
  if (job) {
    if (lpfc_bsg_rport_els_cmp_rsp_0 == 0)
      bsg_reply->reply_payload_rcv_len = 0;
    else if (lpfc_bsg_rport_els_cmp_rsp_0 == 1)
      bsg_reply->reply_payload_rcv_len = 0;
  }
}
---->8
This looked similar to the originally reported symptom in the source code. The
reduced version looks quite a bit different, so no idea if this is something
else entirely or not.

Reply via email to