[Bug c++/124477] [14/15/16 Regression] ICE in nonnull_arg_p in call to memset via std module with -D_FORTIFY_SOURCE=1
nshead at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Mar 21 00:37:51 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124477
--- Comment #9 from Nathaniel Shead <nshead at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #8)
> Talking about DECL_ARGUMENTS, for -freflection we now track whether a
> PARM_DECL had different names and if not, care about the name even in just
> declarations.
> E.g.
> https://eel.is/c++draft/meta.reflection#names-1.8
> Wonder what survives from that for modules, what should happen if
> declarations of the same function come from multiple different modules etc.
Modules streaming will need to be adjusted. We currently just merge the
parameters directly, so if there's an existing declaration we just use those
PARM_DECLs and throw away the ones we're currently reading.
We'll probably need to call 'merge_decl_arguments' in
'trees_in::fn_parms_fini'. But I'm not sure if we can just call it as-is or if
it makes assumptions about the ordering of declarations that can arrive, and
e.g. that we can see multiple definitions for the same declaration.
Eventually the aim is that we should probably teach 'duplicate_decls' about
modules and just use that instead of just the modules-specific logic we have
separate currently. This will be needed for PR99000, for instance. But that
will be a lot of work so just duplicating the necessary logic with modules
understanding in 'trees_in::fn_parms_fini' might be the best approach for now.
More information about the Gcc-bugs
mailing list