https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103114

--- Comment #6 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 8 Nov 2021, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103114
> 
> --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> --- gcc/cp/parser.c.jj  2021-10-28 20:07:48.571193189 +0200
> +++ gcc/cp/parser.c     2021-11-08 10:18:02.042896144 +0100
> @@ -4804,9 +4804,9 @@ cp_parser_userdef_numeric_literal (cp_pa
>        else /* if (id_equal (suffix_id, "il")) */
>         type = long_double_type_node;
> 
> -      value = build_complex (build_complex_type (type),
> -                            fold_convert (type, integer_zero_node),
> -                            fold_convert (type, value));
> +      value = fold_build2 (COMPLEX_EXPR, build_complex_type (type),
> +                          fold_convert (type, integer_zero_node),

build_zero_cost (type) should be cheaper

> +                          fold_convert (type, value));
>      }
> 
>    if (cp_parser_uncommitted_to_tentative_parse_p (parser))
> does that indeed, for the usual case it will do fold_binary_loc -> const_binop
> -> build_complex.
> 
>

Reply via email to