Message ID | 20131107114645.GI54327@msticlxl57.ims.intel.com |
---|---|
State | New |
Headers | show |
On Thu, Nov 7, 2013 at 12:46 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote: > Hi, > > Here is a patch to remove language hook used by Pointer Bounds Checker. To disable checker on non C languages option is moved to c.opt. Ok. Thanks, Richard. > Thanks, > Ilya > -- > gcc/ > > 2013-11-06 Ilya Enkovich <ilya.enkovich@intel.com> > > * common.opt (fcheck-pointer-bounds): Move to ... > * c-family/c.opt: ... here. > * langhooks-def.h (LANG_HOOKS_CHKP_SUPPORTED): Remove. > (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_CHKP_SUPPORTED. > * langhooks.h (lang_hooks): Remove chkp_supported field. > * toplev.c (process_options): Remove chkp_supported check. > > > diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt > index b862eb9..c082bac 100644 > --- a/gcc/c-family/c.opt > +++ b/gcc/c-family/c.opt > @@ -850,6 +850,11 @@ fcanonical-system-headers > C ObjC C++ ObjC++ > Where shorter, use canonicalized paths to systems headers. > > +fcheck-pointer-bounds > +C ObjC C++ ObjC++ LTO Report Var(flag_check_pointer_bounds) > +Add Pointer Bounds Checker instrumentation. fchkp-* flags are used to > +control instrumentation. > + > fcilkplus > C ObjC C++ ObjC++ LTO Report Var(flag_enable_cilkplus) Init(0) > Enable Cilk Plus > diff --git a/gcc/common.opt b/gcc/common.opt > index 5c2f56e..deeb3f2 100644 > --- a/gcc/common.opt > +++ b/gcc/common.opt > @@ -874,11 +874,6 @@ fbounds-check > Common Report Var(flag_bounds_check) > Generate code to check bounds before indexing arrays > > -fcheck-pointer-bounds > -Common Report Var(flag_check_pointer_bounds) > -Add Pointer Bounds Checker instrumentation. fchkp-* flags are used to > -control instrumentation. Currently available for C, C++ and ObjC. > - > fbranch-count-reg > Common Report Var(flag_branch_on_count_reg) Init(1) Optimization > Replace add, compare, branch with branch on count register > diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h > index 0597036..b7be472 100644 > --- a/gcc/langhooks-def.h > +++ b/gcc/langhooks-def.h > @@ -118,7 +118,6 @@ extern bool lhd_omp_mappable_type (tree); > #define LANG_HOOKS_BLOCK_MAY_FALLTHRU hook_bool_const_tree_true > #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false > #define LANG_HOOKS_DEEP_UNSHARING false > -#define LANG_HOOKS_CHKP_SUPPORTED false > > /* Attribute hooks. */ > #define LANG_HOOKS_ATTRIBUTE_TABLE NULL > @@ -306,8 +305,7 @@ extern void lhd_end_section (void); > LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \ > LANG_HOOKS_BLOCK_MAY_FALLTHRU, \ > LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \ > - LANG_HOOKS_DEEP_UNSHARING, \ > - LANG_HOOKS_CHKP_SUPPORTED \ > + LANG_HOOKS_DEEP_UNSHARING \ > } > > #endif /* GCC_LANG_HOOKS_DEF_H */ > diff --git a/gcc/langhooks.h b/gcc/langhooks.h > index 002d7eb..a83bf7b 100644 > --- a/gcc/langhooks.h > +++ b/gcc/langhooks.h > @@ -472,9 +472,6 @@ struct lang_hooks > gimplification. */ > bool deep_unsharing; > > - /* True if this language allows pointers checker instrumentation. */ > - bool chkp_supported; > - > /* Whenever you add entries here, make sure you adjust langhooks-def.h > and langhooks.c accordingly. */ > }; > diff --git a/gcc/toplev.c b/gcc/toplev.c > index 0eaf081..d3dac07 100644 > --- a/gcc/toplev.c > +++ b/gcc/toplev.c > @@ -1286,9 +1286,6 @@ process_options (void) > { > if (targetm.chkp_bound_mode () == VOIDmode) > error ("-fcheck-pointers is not supported for this target"); > - > - if (!lang_hooks.chkp_supported) > - flag_check_pointer_bounds = 0; > } > > /* One region RA really helps to decrease the code size. */
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index b862eb9..c082bac 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -850,6 +850,11 @@ fcanonical-system-headers C ObjC C++ ObjC++ Where shorter, use canonicalized paths to systems headers. +fcheck-pointer-bounds +C ObjC C++ ObjC++ LTO Report Var(flag_check_pointer_bounds) +Add Pointer Bounds Checker instrumentation. fchkp-* flags are used to +control instrumentation. + fcilkplus C ObjC C++ ObjC++ LTO Report Var(flag_enable_cilkplus) Init(0) Enable Cilk Plus diff --git a/gcc/common.opt b/gcc/common.opt index 5c2f56e..deeb3f2 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -874,11 +874,6 @@ fbounds-check Common Report Var(flag_bounds_check) Generate code to check bounds before indexing arrays -fcheck-pointer-bounds -Common Report Var(flag_check_pointer_bounds) -Add Pointer Bounds Checker instrumentation. fchkp-* flags are used to -control instrumentation. Currently available for C, C++ and ObjC. - fbranch-count-reg Common Report Var(flag_branch_on_count_reg) Init(1) Optimization Replace add, compare, branch with branch on count register diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 0597036..b7be472 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -118,7 +118,6 @@ extern bool lhd_omp_mappable_type (tree); #define LANG_HOOKS_BLOCK_MAY_FALLTHRU hook_bool_const_tree_true #define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false #define LANG_HOOKS_DEEP_UNSHARING false -#define LANG_HOOKS_CHKP_SUPPORTED false /* Attribute hooks. */ #define LANG_HOOKS_ATTRIBUTE_TABLE NULL @@ -306,8 +305,7 @@ extern void lhd_end_section (void); LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \ LANG_HOOKS_BLOCK_MAY_FALLTHRU, \ LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \ - LANG_HOOKS_DEEP_UNSHARING, \ - LANG_HOOKS_CHKP_SUPPORTED \ + LANG_HOOKS_DEEP_UNSHARING \ } #endif /* GCC_LANG_HOOKS_DEF_H */ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 002d7eb..a83bf7b 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -472,9 +472,6 @@ struct lang_hooks gimplification. */ bool deep_unsharing; - /* True if this language allows pointers checker instrumentation. */ - bool chkp_supported; - /* Whenever you add entries here, make sure you adjust langhooks-def.h and langhooks.c accordingly. */ }; diff --git a/gcc/toplev.c b/gcc/toplev.c index 0eaf081..d3dac07 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1286,9 +1286,6 @@ process_options (void) { if (targetm.chkp_bound_mode () == VOIDmode) error ("-fcheck-pointers is not supported for this target"); - - if (!lang_hooks.chkp_supported) - flag_check_pointer_bounds = 0; } /* One region RA really helps to decrease the code size. */