This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [CHKP, PATCH] Fix instrumented indirect calls with propagated pointers
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Mar 2015 13:06:46 +0300
- Subject: Re: [CHKP, PATCH] Fix instrumented indirect calls with propagated pointers
- Authentication-results: sourceware.org; auth=none
- References: <20150312100931 dot GK27860 at msticlxl57 dot ims dot intel dot com> <20150319082944 dot GC64546 at msticlxl57 dot ims dot intel dot com> <20150324083325 dot GC1746 at tucnak dot redhat dot com> <CAMbmDYbs2GEy3=gQ1+3NDZuqATeiRZbhfucsx3AWP8Zmq2zogA at mail dot gmail dot com> <20150324140619 dot GE1746 at tucnak dot redhat dot com> <CAFiYyc1RyqUr_b331SfxagoLNa8CK0EoeynX=kTKW1YGRcCq1Q at mail dot gmail dot com> <CAMbmDYZ4dAG_SidQKsj-M+VovhZgtVZCVrXTLe8aezabPi2UYA at mail dot gmail dot com> <CAFiYyc2b3GBhtGk4=ayRqZj1Y+KfhJHwDhd5GQvaVMz0_4vc=w at mail dot gmail dot com> <20150325095041 dot GL1746 at tucnak dot redhat dot com>
2015-03-25 12:50 GMT+03:00 Jakub Jelinek <jakub@redhat.com>:
> On Wed, Mar 25, 2015 at 10:38:56AM +0100, Richard Biener wrote:
>> --- gcc/passes.c (revision 221633)
>> +++ gcc/passes.c (working copy)
>> @@ -156,7 +156,8 @@ void
>> pass_manager::execute_early_local_passes ()
>> {
>> execute_pass_list (cfun, pass_build_ssa_passes_1->sub);
>> - execute_pass_list (cfun, pass_chkp_instrumentation_passes_1->sub);
>> + if (flag_check_pointer_bounds)
>> + execute_pass_list (cfun, pass_chkp_instrumentation_passes_1->sub);
>> execute_pass_list (cfun, pass_local_optimization_passes_1->sub);
>> }
>>
>> @@ -424,7 +425,8 @@ public:
>> virtual bool gate (function *)
>> {
>> /* Don't bother doing anything if the program has errors. */
>> - return (!seen_error () && !in_lto_p);
>> + return (flag_check_pointer_bounds
>> + && !seen_error () && !in_lto_p);
>> }
>>
>> }; // class pass_chkp_instrumentation_passes
>
> There is still the wasteful pass_fixup_cfg at the start of:
> PUSH_INSERT_PASSES_WITHIN (pass_local_optimization_passes)
> NEXT_PASS (pass_fixup_cfg);
> which wasn't there before chkp. Perhaps this should be a different
> pass with the same execute method, but gate containing
> flag_check_pointer_bounds?
IIRC the reason for this pass was a different passes split, not
instrumentation itself. Previously function processing always started
with pass_fixup_cfg. Splitting processing into three stages we got
three pass_fixup_cfg passes.
Ilya
>
> Jakub