On Wed, Oct 17, 2018 at 07:20:53PM +0200, Paolo Carlini wrote:
> Hi,
> 
> as you probably remember, very close to the release of 8.1.0 we noticed that
> my fix for c++/70808 was causing c++/85553, which Jakub promptly fixed.
> However, we later found out that the real problem was a latent issue in
> convert, which I fixed in r259966. Thus, I think that in current trunk we
> can revert Jakub's quick fix, now redundant. Tested x86_64-linux.

Is there some desirable diagnostics you expect from the convert?
If not, build_int_cst is certainly cheaper.

> 2018-10-17  Paolo Carlini  <paolo.carl...@oracle.com>
> 
>       * init.c (build_zero_init_1): Remove special casing for
>       NULLPTR_TYPE_P (type), introduced by r259728 and made
>       redundant by r259966.

> Index: init.c
> ===================================================================
> --- init.c    (revision 265241)
> +++ init.c    (working copy)
> @@ -180,10 +180,8 @@ build_zero_init_1 (tree type, tree nelts, bool sta
>         items with static storage duration that are not otherwise
>         initialized are initialized to zero.  */
>      ;
> -  else if (TYPE_PTR_OR_PTRMEM_P (type))
> +  else if (TYPE_PTR_OR_PTRMEM_P (type) || NULLPTR_TYPE_P (type))
>      init = fold (convert (type, nullptr_node));
> -  else if (NULLPTR_TYPE_P (type))
> -    init = build_int_cst (type, 0);
>    else if (SCALAR_TYPE_P (type))
>      init = fold (convert (type, integer_zero_node));
>    else if (RECORD_OR_UNION_CODE_P (TREE_CODE (type)))


        Jakub

Reply via email to