This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, MPX, 2/X] Pointers Checker [4/25] Constructors
- From: Jeff Law <law at redhat dot com>
- To: Ilya Enkovich <enkovich dot gnu at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Oct 2013 23:55:43 -0600
- Subject: Re: [PATCH, MPX, 2/X] Pointers Checker [4/25] Constructors
- Authentication-results: sourceware.org; auth=none
- References: <20131021121018 dot GD37888 at msticlxl57 dot ims dot intel dot com>
On 10/21/13 06:10, Ilya Enkovich wrote:
This patch introduces two new contructor types supported by cgraph_build_static_cdtor.
'B' type is used to initialize static objects (bounds) created by Pointers Checker. The difference of this type from the regular constructor is that 'B' constructor is never instrumented by Pointers Checker.
'P' type is used by Pointers Checker to generate constructors to initialize bounds of statically initialized pointers. Pointers Checker remove all stores from such constructors after instrumentation.
Since 'P' type constructors are created for statically initialized objects, we need to avoid creation of such objects during its gimplification. New restriction was added to gimplify_init_constructor.
Bootstrapped and checked on linux-x86_64.
2013-10-21 Ilya Enkovich <firstname.lastname@example.org>
* ipa.c (cgraph_build_static_cdtor_1): Support contructors
with "chkp ctor" and "bnd_legacy" attributes.
* gimplify.c (gimplify_init_constructor): Avoid infinite
loop during gimplification of bounds initializer.
This is OK.
As a side note, it seems awfully strange to be passing in the type of
ctor/dtor in a char varaible. I'd look favorably upon changing that to
an enum where the enum values describe the cases they handle. The
existing code seems so, umm, 80s/90s style. Obviously not something
that's required of you to move this patch forward.