Quoting Diego Novillo : >> +the gate test - the gate status - stored as an integer. > > I can't parse this. New text: After the original gate function for a pass is called, its result - the gate status - is stored as an integer. Then the event @code{PLUGIN_OVERRIDE_GATE} is invoked, with a pointer to the gate status in the @code{gcc_data} parameter to the callback function. A nonzero value of the gate status means that the pass is to be executed. You can both read and write the gate status via the passed pointer. >> +When your plugin is loaded, yt the moment you can inspect the various >> +pass lists to determine what passes are available. > > I'm not sure what you are trying to say here. Did you meant 'at' > instead of 'yt'? Still, this is hard to parse. Yes, less is more here: When your plugin is loaded, you can inspect the various pass lists to determine what passes are available. However, other plugins might add new passes. Also, future changes to GCC might cause generic passes to be added after plugin loading. When a pass is first added to one of the pass lists, the event @code{PLUGIN_NEW_PASS} is invoked, with the callback parameter @code{gcc_data} pointing to the new pass. >> +/* Number of event ids / names registered so far. */ >> + >> +extern int event_last; > > Why is this a global? I'd rather have it as a static variable > that is updated every time an event is registered. Changed to file static + query function. I am currently testing the attached patch locally & on gcc14.