[gimplefe] reject invalid pass name in startwith
Richard Biener
rguenther@suse.de
Tue Dec 20 09:17:00 GMT 2016
On Sun, 18 Dec 2016, Prathamesh Kulkarni wrote:
> Hi Richard,
> The attached patch attempts to reject invalid pass-name in startwith
> and verified gimplefe tests pass with the patch (not sure if bootstrap
> is required?)
> Does it look OK ?
No - get_pass_by_name works on dump file names while the startwith
machinery counts the actual invocations of the pass (and supports
"ccp" as alias to "ccp1" for example). So there is no 1:1 correspondence
between startwith names and names get_pass_by_name expects.
I'd say we instead want to diagnose when the pass pipeline execution
fails to find "startwith". Thus ontop of my earlier patch which
ends up with
/* For skipping passes until startwith pass */
if (cfun
&& cfun->pass_startwith
/* But we can't skip the lowering phase yet -- ideally we'd
drive that phase fully via properties. */
&& (cfun->curr_properties & PROP_ssa))
{
size_t namelen = strlen (pass->name);
/* We have to at least start when we leave SSA. */
if (pass->properties_destroyed & PROP_ssa)
cfun->pass_startwith = NULL;
else if (! strncmp (pass->name, cfun->pass_startwith, namelen))
{
in the & PROP_ssa case, if pass->name doesn't match, diagnose a
"failed to start pass execution at %s, starting with RTL expansion".
Richard.
More information about the Gcc-patches
mailing list