This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][C++] Fix PR38334, TBAA issues with vtbl loads


Richard Guenther wrote:

 Index: typeck.c
> ===================================================================
> --- typeck.c	(revision 142371)
> +++ typeck.c	(working copy)
> @@ -2790,6 +2790,10 @@ get_member_function_from_ptrfunc (tree *
>        vtbl = build1 (NOP_EXPR, build_pointer_type (vtbl_ptr_type_node),
>  		     instance_ptr);
>        vtbl = cp_build_indirect_ref (vtbl, NULL, tf_warning_or_error);
> +      /* If the object is not dynamic the access invokes undefined
> +	 behavior.  As it is not executed in this case silence the
> +	 spurious warnings it may provoke.  */
> +      TREE_NO_WARNING (vtbl) = 1;
>  
>        /* Finally, extract the function pointer from the vtable.  */
>        e2 = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (vtbl), vtbl,

This is fine, thanks.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]