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

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmalcolm at gcc dot gnu.org

--- Comment #6 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
FWIW this seems to have some of the issues with inlining vs diagnostics as PR
tree-optimization/83336.

In particular, the diagnostics lacks the "%K" in its format string (I take "%K"
to be something of a "make this work please" anti-pattern; diagnostics
shouldn't need to supply it IMHO).

Hacking up default_tree_diagnostic_starter to inject a %K, and using my other
local fixes for PR tree-optimization/83336, I get this additional contextual
information:

In function ‘ptlrpcd_ctl_init.part.0’,
    inlined from ‘ptlrpcd_ctl_init’,
    inlined from ‘ptlrpcd_init’ at ../../src/pr83312.c:20:7,
       ptlrpcd_ctl_init(&ptlrpcd_init_pd->pd_threads[j], j);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    inlined from ‘ptlrpcd_addref’ at ../../src/pr83312.c:26:5:
     ptlrpcd_init(ptlrpcd_init_groupsize);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/pr83312.c:10:26: warning: array subscript -1 is below array bounds of
‘struct ptlrpcd_ctl[6]’ [-Warray-bounds]
     __builtin_snprintf(pc->pc_name, sizeof(pc->pc_name), "ptlrpcd_rcv");
                        ~~^~~~~~~~~


which looks sane (well, the contextual information does; the warning itself is
still bogus).

Reply via email to