This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Initialize sanitizer builtins (PR sanitizer/60745)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Jonathan Wakely <jwakely at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 4 Apr 2014 21:45:52 +0200
- Subject: Re: [PATCH] Initialize sanitizer builtins (PR sanitizer/60745)
- Authentication-results: sourceware.org; auth=none
- References: <20140403165630 dot GE24603 at redhat dot com> <533ECD26 dot 2000504 at redhat dot com> <20140404154848 dot GT13192 at redhat dot com> <20140404171427 dot GG24603 at redhat dot com> <533EF0CC dot 2020904 at redhat dot com>
On Fri, Apr 04, 2014 at 11:50:04AM -0600, Jeff Law wrote:
> On 04/04/14 11:14, Marek Polacek wrote:
> >
> >So what happens here is that normally we initialize the builtins via
> >c_common_nodes_and_builtins, which has:
> >
> > 5711 if (!flag_preprocess_only)
> > 5712 c_define_builtins (va_list_ref_type_node, va_list_arg_type_node);
> >
> >c_define_builtins defines builtins in builtins.def, that includes even
> >sanitizer.def. I guess that flag_preprocess_only was in effect due to PCH
> >and we didn't define the builtins. I still haven't managed to create
> >some sweet & small testcase, but I've found another ICE with PCH:
> What doesn't make sense to me is I don't see where PCH sets
> flag_preprocess_only. If you can point me to where that happens,
> then I think we'd just need a comment that PCH turns on
> flag_preprocess_only, which guards the creation of some builtins.
I'm sorry, my guess was wrong, it's not about flag_preprocess_only at
all. But still it's about PCH ;). In short: we define the builtins,
but PCH then removes the definitions.
The thing is, we define the
builtins just fine (via c_common_nodes_and_builtins -> c_define_builtins),
but the problem is that later on we call c_common_read_pch that calls
gt_pch_restore which "reads the state of the compiler back in from
file" -- and as a part of this, it overwrites the table with defined
builtins (builtin_info.decl). And so we end up with zapped table
and thus it's needed to re-initialize it. I don't see an easy way
how to tell PCH to not to do the removal.
Marek