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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Jump threading introduces the code:
```
  <bb 2> [local count: 1073741824]:
  if (fmt_2(D) == 0B)
    goto <bb 4>; [0.00%]
  else
    goto <bb 3>; [100.00%]

  <bb 3> [local count: 1073741824]:
  # .MEM_8 = VDEF <.MEM_1(D)>
  vsnprintf (0B, 0, fmt_2(D), ap); [tail call]
  # VUSE <.MEM_8>
  return;

  <bb 4> [count: 0]:
  # .MEM_6 = VDEF <.MEM_1(D)>
  __builtin___ubsan_handle_nonnull_arg (&*.Lubsan_data0);
  # .MEM_3 = VDEF <.MEM_6>
  vsnprintf (0B, 0, 0B, ap);
  # .MEM_4 = VDEF <.MEM_3>
  abort ();
```

Obvious if you place the check for fmt before the vsnprintf there will be no
warning.

Can you provide the original case?

Reply via email to