Hi, This patch skips all bounds during debug info generation.
Bootstrapped and tested on linux-x86_64. Thanks, Ilya -- gcc/ 2014-06-11 Ilya Enkovich <ilya.enkov...@intel.com> * dbxout.c (dbxout_type): Ignore POINTER_BOUNDS_TYPE. * dwarf2out.c (gen_subprogram_die): Ignore bound args. (gen_type_die_with_usage): Skip pointer bounds. (dwarf2out_global_decl): Likewise. (is_base_type): Support POINTER_BOUNDS_TYPE. (gen_formal_types_die): Skip pointer bounds. (gen_decl_die): Likewise. * var-tracking.c (vt_add_function_parameters): Skip bounds parameters. diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 7a13289..ee626eb 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -2367,6 +2367,10 @@ dbxout_type (tree type, int full) dbxout_type (TREE_TYPE (type), 0); break; + case POINTER_BOUNDS_TYPE: + /* No debug info for pointer bounds type supported yet. */ + break; + default: gcc_unreachable (); } diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 67b37eb..f9c96d7 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -10255,6 +10255,7 @@ is_base_type (tree type) case FIXED_POINT_TYPE: case COMPLEX_TYPE: case BOOLEAN_TYPE: + case POINTER_BOUNDS_TYPE: return 1; case ARRAY_TYPE: @@ -17555,18 +17556,21 @@ gen_formal_types_die (tree function_or_method_type, dw_die_ref context_die) break; /* Output a (nameless) DIE to represent the formal parameter itself. */ - parm_die = gen_formal_parameter_die (formal_type, NULL, - true /* Emit name attribute. */, - context_die); - if (TREE_CODE (function_or_method_type) == METHOD_TYPE - && link == first_parm_type) + if (!POINTER_BOUNDS_TYPE_P (formal_type)) { - add_AT_flag (parm_die, DW_AT_artificial, 1); - if (dwarf_version >= 3 || !dwarf_strict) - add_AT_die_ref (context_die, DW_AT_object_pointer, parm_die); + parm_die = gen_formal_parameter_die (formal_type, NULL, + true /* Emit name attribute. */, + context_die); + if (TREE_CODE (function_or_method_type) == METHOD_TYPE + && link == first_parm_type) + { + add_AT_flag (parm_die, DW_AT_artificial, 1); + if (dwarf_version >= 3 || !dwarf_strict) + add_AT_die_ref (context_die, DW_AT_object_pointer, parm_die); + } + else if (arg && DECL_ARTIFICIAL (arg)) + add_AT_flag (parm_die, DW_AT_artificial, 1); } - else if (arg && DECL_ARTIFICIAL (arg)) - add_AT_flag (parm_die, DW_AT_artificial, 1); link = TREE_CHAIN (link); if (arg) @@ -18336,7 +18340,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) gen_formal_parameter_pack_die (generic_decl_parm, parm, subr_die, &parm); - else if (parm) + else if (parm && !POINTER_BOUNDS_P (parm)) { dw_die_ref parm_die = gen_decl_die (parm, NULL, subr_die); @@ -18348,6 +18352,8 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) parm = DECL_CHAIN (parm); } + else if (parm) + parm = DECL_CHAIN (parm); if (generic_decl_parm) generic_decl_parm = DECL_CHAIN (generic_decl_parm); @@ -19846,6 +19852,7 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die, case FIXED_POINT_TYPE: case COMPLEX_TYPE: case BOOLEAN_TYPE: + case POINTER_BOUNDS_TYPE: /* No DIEs needed for fundamental types. */ break; @@ -20310,6 +20317,12 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die) if (DECL_P (decl_or_origin) && DECL_IGNORED_P (decl_or_origin)) return NULL; + /* Ignore pointer bounds decls. */ + if (DECL_P (decl_or_origin) + && TREE_TYPE (decl_or_origin) + && POINTER_BOUNDS_P (decl_or_origin)) + return NULL; + switch (TREE_CODE (decl_or_origin)) { case ERROR_MARK: @@ -20517,7 +20530,8 @@ dwarf2out_global_decl (tree decl) declarations, file-scope (extern) function declarations (which had no corresponding body) and file-scope tagged type declarations and definitions which have not yet been forced out. */ - if (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)) + if ((TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)) + && !POINTER_BOUNDS_P (decl)) dwarf2out_decl (decl); } diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index 65d8285..493b312 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -9796,7 +9796,8 @@ vt_add_function_parameters (void) for (parm = DECL_ARGUMENTS (current_function_decl); parm; parm = DECL_CHAIN (parm)) - vt_add_function_parameter (parm); + if (!POINTER_BOUNDS_P (parm)) + vt_add_function_parameter (parm); if (DECL_HAS_VALUE_EXPR_P (DECL_RESULT (current_function_decl))) {