https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108119
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
It looks to me the plugin isn't needed to compile m2 programs, it's merely an
additional tool to diagnose invalid code (that is maybe never be reached at
runtime).  So I'd suggest to put this plugin use behind some driver option.

Alternatively the functionality could be lifted to the middle-end for example
by introducing an __attribute__((diagnose_if_invoked_on_function_entry))
that could then emit

warning: 'error' is always invoked when executing 'foo'

for

void __attribute__((diagnose_if_invoked_on_function_entry)) error ();

void foo ()
{
  error ();
}

but I understand the plugin does some whole-program analysis?  That won't
work with LTO at the point the plugin runs.

That said, the immediate thing to do would be to make the plugin build/run
dependent on plugin support.

Reply via email to