This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Adding an IPA pass question (pass names)
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Steve Ellcey <sellcey at imgtec dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 19 Aug 2015 13:40:12 -0400
- Subject: Re: Adding an IPA pass question (pass names)
- Authentication-results: sourceware.org; auth=none
- References: <f65e0e91-784a-49b9-9408-2b6b4eeddc5c at BAMAIL02 dot ba dot imgtec dot org>
On Wed, 2015-08-19 at 10:27 -0700, Steve Ellcey wrote:
> I am trying to create a new IPA pass to scan the routines being compiled
> by GCC and I thought I would put it in after the last IPA pass (comdats)
> so I tried to register it with:
>
> opt_pass *p = make_pass_ipa_frame_header_opt (g);
> static struct register_pass_info f =
> {p, "comdats", 1, PASS_POS_INSERT_AFTER };
> register_pass (&f);
>
> But when I build GCC I get:
>
> /scratch/sellcey/repos/header2/src/gcc/libgcc/libgcc2.c:1:0: fatal error: pass 'comdats' not found but is referenced by new pass 'frame-header-opt'
>
> Does anyone know why this is the case? "comdats" is what is used for
> the name of pass_ipa_comdats in ipa-comdats.c.
Is your pass of the correct type? (presumably IPA_PASS). I've run into
this a few times with custom passes (which seems to be a "gotcha");
position_pass can fail here:
/* Check if the current pass is of the same type as the new pass and
matches the name and the instance number of the reference pass. */
if (pass->type == new_pass_info->pass->type
Hope this is helpful
Dave