On Thu, Apr 30, 2020 at 08:42:39AM +0200, Richard Biener wrote:
> > --- gcc/config/arm/arm.c.jj     2020-04-29 13:12:46.736007298 +0200
> > +++ gcc/config/arm/arm.c        2020-04-29 14:34:04.878864236 +0200
> > @@ -6416,6 +6416,8 @@ aapcs_vfp_is_call_or_return_candidate (e
> >               && ((alt = aapcs_vfp_sub_candidate (type, &new_mode, NULL))
> >                   != ag_count))
> >             {
> > +             const char *url
> > +               = get_changes_url ("gcc-10/changes.html#empty_base");
> 
> This is called even when !warn_psabi_flags and I wonder if we could
> instead use a macro at uses, like

It is not, because the 3 lines above the snippet are:
          if (warn_psabi
              && warn_psabi_flags
              && uid != last_reported_type_uid

> 
> >               gcc_assert (alt == -1);
> >               last_reported_type_uid = uid;
> >               /* Use TYPE_MAIN_VARIANT to strip any redundant const
> > @@ -6423,11 +6425,14 @@ aapcs_vfp_is_call_or_return_candidate (e
> >               if (warn_psabi_flags & WARN_PSABI_NO_UNIQUE_ADDRESS)
> >                 inform (input_location, "parameter passing for argument of "
> >                         "type %qT with %<[[no_unique_address]]%> members "
> > -                       "changed in GCC 10.1", TYPE_MAIN_VARIANT (type));
> > +                       "changed in %{GCC 10.1%}",
> > +                       TYPE_MAIN_VARIANT (type), url);
> 
>   , CHANGES_URL ("gcc-10/changes.html#empty_base");
> 
> where the macro would just use preprocessor string concatenation?
> 
> Alternatively 'url' could be static I guess (and never freed)

The reason was that DOCUMENTATION_ROOT_URL is a macro added through
CFLAGS-opts.o += -DDOCUMENTATION_ROOT_URL=\"@DOCUMENTATION_ROOT_URL@\"
and so it is available in opts.o only and I've followed that.

I didn't want to add a long -D option to every *.o file out there.

But, thinking about it now, there is no reason why DOCUMENTATION_ROOT_URL
and CHANGES_ROOT_URL couldn't be in config.h, i.e. AC_DEFINE rather than
AC_SUBST, and then we can indeed use string concatenation.
I've already checked the patch in, so I'll post an incremental patch
(together with the doc/ changes requested by Joseph).

        Jakub

Reply via email to