@@ -5935,11 +5935,14 @@ check_for_overlaps (vec<fieldoff_s> fieldstack)
5935
5935
This will also create any varinfo structures necessary for fields
5936
5936
of DECL. DECL is a function parameter if HANDLE_PARAM is set.
5937
5937
HANDLED_STRUCT_TYPE is used to register struct types reached by following
5938
- restrict pointers. This is needed to prevent infinite recursion. */
5938
+ restrict pointers. This is needed to prevent infinite recursion.
5939
+ If ADD_RESTRICT, pretend that the pointer NAME is restrict even if DECL
5940
+ does not advertise it. */
5939
5941
5940
5942
static varinfo_t
5941
5943
create_variable_info_for_1 (tree decl , const char * name , bool add_id ,
5942
- bool handle_param , bitmap handled_struct_type )
5944
+ bool handle_param , bitmap handled_struct_type ,
5945
+ bool add_restrict = false)
5943
5946
{
5944
5947
varinfo_t vi , newvi ;
5945
5948
tree decl_type = TREE_TYPE (decl );
@@ -6013,7 +6016,7 @@ create_variable_info_for_1 (tree decl, const char *name, bool add_id,
6013
6016
vi -> size = vi -> fullsize ;
6014
6017
vi -> is_full_var = true;
6015
6018
if (POINTER_TYPE_P (decl_type )
6016
- && TYPE_RESTRICT (decl_type ))
6019
+ && ( TYPE_RESTRICT (decl_type ) || add_restrict ))
6017
6020
vi -> only_restrict_pointers = 1 ;
6018
6021
if (vi -> only_restrict_pointers
6019
6022
&& !type_contains_placeholder_p (TREE_TYPE (decl_type ))
@@ -6242,6 +6245,7 @@ intra_create_variable_infos (struct function *fn)
6242
6245
{
6243
6246
tree t ;
6244
6247
bitmap handled_struct_type = NULL ;
6248
+ bool this_parm_in_ctor = DECL_CXX_CONSTRUCTOR_P (fn -> decl );
6245
6249
6246
6250
/* For each incoming pointer argument arg, create the constraint ARG
6247
6251
= NONLOCAL or a dummy variable if it is a restrict qualified
@@ -6253,10 +6257,12 @@ intra_create_variable_infos (struct function *fn)
6253
6257
6254
6258
varinfo_t p
6255
6259
= create_variable_info_for_1 (t , alias_get_name (t ), false, true,
6256
- handled_struct_type );
6260
+ handled_struct_type , this_parm_in_ctor );
6257
6261
insert_vi_for_tree (t , p );
6258
6262
6259
6263
make_param_constraints (p );
6264
+
6265
+ this_parm_in_ctor = false;
6260
6266
}
6261
6267
6262
6268
if (handled_struct_type != NULL )
0 commit comments