Re: gettext, _, N_, and G_

2021-05-14 Thread Jakub Jelinek via Gcc
On Thu, May 13, 2021 at 08:56:39PM -0400, Jason Merrill wrote:
> >From 8718fbbf83978bd8ec4bf0a0e4164459158df182 Mon Sep 17 00:00:00 2001
> From: Jason Merrill 
> Date: Thu, 13 May 2021 20:53:50 -0400
> Subject: [PATCH] intl: add comments to _, N_, and G_
> To: gcc-patc...@gcc.gnu.org
> 
> gcc/ChangeLog:
> 
>   * intl.h: Add comments.
> ---
>  gcc/intl.h | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/gcc/intl.h b/gcc/intl.h
> index 829364ae905..f21ec11ada0 100644
> --- a/gcc/intl.h
> +++ b/gcc/intl.h
> @@ -47,14 +47,19 @@ extern const char *fake_ngettext (const char *singular, 
> const char *plural,
>  
>  #endif
>  
> +/* Used to immediately translate the argument.  */
>  #ifndef _
>  # define _(msgid) gettext (msgid)
>  #endif
>  
> +/* Used to mark strings that will be translated later.  */
>  #ifndef N_
>  # define N_(msgid) msgid
>  #endif
>  
> +/* Like N_, but used for diagnostic strings, to tell gettext that this is a
> +   gcc-internal-format string rather than standard c-format.  exgettext gets
> +   this from the 'g' in "gmsgid", which is also used in diagnostic.c.  */
>  #ifndef G_
>  # define G_(gmsgid) gmsgid
>  #endif

I'd just write
/* Like N_, but for GCC diagnostic format strings.  See ABOUT-GCC-NLS for
   details.  */
for this and if something is unclear, clarify there.

Jakub



Re: gettext, _, N_, and G_

2021-05-14 Thread Jakub Jelinek via Gcc
On Fri, May 14, 2021 at 09:41:57AM +0200, Jakub Jelinek via Gcc wrote:
> I'd just write
> /* Like N_, but for GCC diagnostic format strings.  See ABOUT-GCC-NLS for
>details.  */
> for this and if something is unclear, clarify there.

See https://gcc.gnu.org/legacy-ml/gcc-patches/2005-06/threads.html#00055
for further details.

Jakub



Question about non-POD class type

2021-05-14 Thread Feng Xue OS via Gcc
Sorry, sent to wrong mail list.


From: Feng Xue OS
Sent: Friday, May 14, 2021 4:30 PM
To: gcc-patc...@gcc.gnu.org
Subject: Question about non-POD class type

For an instance of a non-POD class, can I always assume that any
operation on it should be type-safe, any wrong or even trick code
to violate this is UB in C++ spec? For example, here are some ways:

 union {
Type1  *p1;
Type2  *p2;
};

or

union {
Type1 t1;
Type2 t2;
};

or

void *p = Type1 *p1;
Type2 *p2 = p;
p2->xxx;

Feng


Re: gcc 11.1.0 mpfr

2021-05-14 Thread Guy Harrison
On Wednesday 12 May 2021 09:51:45 Richard Biener wrote:
> On Tue, May 11, 2021 at 6:34 PM Serge Belyshev via Gcc  
wrote:
> > > $ egrep "mpfr\.h" log/cfg/cfg.gcc-11.1.0.log
> > > checking for the correct version of mpfr.h... buggy but acceptable
> > >
> > > It appears "gcc-11.1.0/contrib/download_prerequisites"
> > > specifies "mpfr-3.1.4.tar.bz2" whereas top level 'configure'
> > > has "MPFR_VERSION_NUM(3,1,6)".
> > >
> > > Is there a reason mpfr 3.1.6 isn't being used?
> >
> > No good reason: that script was not updated with new versions. GCC-11
> > is also known to work fine with the most recent mpfr version 4.1.0.
>
> Yes, the update of the minimum version and the buggy check was
> done by Janne w/o adjusting the download script.
>
> Richard.

Thanks folks.



Re: gcc 11.1.0 mpfr

2021-05-14 Thread Martin Liška

On 5/12/21 10:51 AM, Richard Biener via Gcc wrote:

On Tue, May 11, 2021 at 6:34 PM Serge Belyshev via Gcc  wrote:




$ egrep "mpfr\.h" log/cfg/cfg.gcc-11.1.0.log
checking for the correct version of mpfr.h... buggy but acceptable

It appears "gcc-11.1.0/contrib/download_prerequisites"
specifies "mpfr-3.1.4.tar.bz2" whereas top level 'configure'
has "MPFR_VERSION_NUM(3,1,6)".

Is there a reason mpfr 3.1.6 isn't being used?


No good reason: that script was not updated with new versions. GCC-11 is
also known to work fine with the most recent mpfr version 4.1.0.


Yes, the update of the minimum version and the buggy check was
done by Janne w/o adjusting the download script.

Richard.



Should I adjust download_prerequisites accordingly?

Martin


Re: gcc 11.1.0 mpfr

2021-05-14 Thread Richard Biener via Gcc
On May 14, 2021 10:53:21 AM GMT+02:00, "Martin Liška"  wrote:
>On 5/12/21 10:51 AM, Richard Biener via Gcc wrote:
>> On Tue, May 11, 2021 at 6:34 PM Serge Belyshev via Gcc
> wrote:
>>>
>>>
 $ egrep "mpfr\.h" log/cfg/cfg.gcc-11.1.0.log
 checking for the correct version of mpfr.h... buggy but acceptable

 It appears "gcc-11.1.0/contrib/download_prerequisites"
 specifies "mpfr-3.1.4.tar.bz2" whereas top level 'configure'
 has "MPFR_VERSION_NUM(3,1,6)".

 Is there a reason mpfr 3.1.6 isn't being used?
>>>
>>> No good reason: that script was not updated with new versions.
>GCC-11 is
>>> also known to work fine with the most recent mpfr version 4.1.0.
>> 
>> Yes, the update of the minimum version and the buggy check was
>> done by Janne w/o adjusting the download script.
>> 
>> Richard.
>> 
>
>Should I adjust download_prerequisites accordingly?

Yes.

Richard. 

>Martin



Re: Why don't recently added -Wexceptions and -Winvalid-imported-macros use "Warning" flag?

2021-05-14 Thread Martin Liška

On 5/13/21 11:33 PM, Vadim Zeitlin wrote:

  Hello,

  While running my script[1] parsing gcc/c-family/c.opt to extract
information about the new warnings for C++ programs, I've noticed that a
couple of new warnings in gcc 11 don't use the "Warning" flag which, I had
assumed, would be used for all warnings (with a couple of historical
exceptions). Was this assumption wrong, or could this have been an
oversight, i.e. should this flag be added to these warning too?

  For the reference, the commits adding the warning were:

- 1d87302a8e2 (c++: Add -Wexceptions warning option [PR97675], 2020-11-03)
- 10ee6da64c5 (C++ Module options, 2020-12-01)

  Thanks in advance,
VZ



You are right, thanks for heads up. I'm going to install the following obvious 
patch
(and will add it to gcc-11 branch as well).

Martin
>From 3d4ba1b4f34d16b98d6333d203c80b50f655d445 Mon Sep 17 00:00:00 2001
From: Martin Liska 
Date: Fri, 14 May 2021 11:40:58 +0200
Subject: [PATCH] opts: add Warning keyword for 2 options

gcc/c-family/ChangeLog:

	* c.opt: Add Warning keyword for 2 options.
---
 gcc/c-family/c.opt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index f1b4c3f34ec..5fcf961fd96 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -592,7 +592,7 @@ C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
 This switch is deprecated; use -Werror=implicit-function-declaration instead.
 
 Wexceptions
-C++ ObjC++ Var(warn_exceptions) Init(1)
+C++ ObjC++ Var(warn_exceptions) Init(1) Warning
 Warn when an exception handler is shadowed by another handler.
 
 Wextra
@@ -1741,7 +1741,7 @@ C++ ObjC Var(flag_module_version_ignore) Integer
 ; undocumented, Very dangerous, but occasionally useful
 
 Winvalid-imported-macros
-C++ ObjC++ Var(warn_imported_macros)
+C++ ObjC++ Var(warn_imported_macros) Warning
 Warn about macros that have conflicting header units definitions.
 
 flang-info-include-translate
-- 
2.31.1



Name (de)mangling for C++20 modules

2021-05-14 Thread Jones, Andrew via Gcc
Reading over 
https://gcc.gnu.org/wiki/cxx-modules?action=AttachFile&do=view&target=module-abi-2017-09-01.pdf,
 in particular Section 4 ("Recommendation"), it suggests that code such as:

```
export module moo;

int moo() { return 10; }

```

should "have module-linkage include the module name in their mangling", and 
indeed it appears this is the case:

```
 g F .text  000b _ZW3mooE3moov

```

(from objdump @ 75f03fa7743, compiled with GCC 11.0.0).

However, I have two questions:

1) What should the demanging (e.g., via c++filt) of `_ZW3mooE3moov` be?

2) How should the presentation of demangling `_ZW3mooE3moov` (in the module 
case) differ from the demangling of `_ZN3moo3mooEv` (in the case where you have 
a method `moo` in a namespace `moo`)?

Cheers,

Andrew



GCC 8.5 Releasedd

2021-05-14 Thread Jakub Jelinek via Gcc
GCC version 8.5 has been released.

GCC 8.5 is a bug-fix release from the GCC 8 branch
containing important fixes for regressions and serious bugs in
GCC 8.4 with more than 199 bugs fixed since the previous release.

This is also the last release from the GCC 8 branch, GCC continues
to be maintained on the GCC 9, GCC 10 and GCC 11 branches and the development
trunk.

This release is available from the WWW and FTP servers listed here:

 https://sourceware.org/pub/gcc/releases/gcc-8.5.0/
 https://gcc.gnu.org/mirrors.html

The release is in the gcc-8.5.0/ subdirectory.

Please do not contact me directly regarding questions or comments
about this release.  Instead, use the resources available from
http://gcc.gnu.org.

As always, a vast number of people contributed to this GCC release
-- far too many to thank them individually!



Re: gettext, _, N_, and G_

2021-05-14 Thread Jason Merrill via Gcc

On 5/14/21 3:41 AM, Jakub Jelinek wrote:

On Thu, May 13, 2021 at 08:56:39PM -0400, Jason Merrill wrote:

>From 8718fbbf83978bd8ec4bf0a0e4164459158df182 Mon Sep 17 00:00:00 2001
From: Jason Merrill 
Date: Thu, 13 May 2021 20:53:50 -0400
Subject: [PATCH] intl: add comments to _, N_, and G_
To: gcc-patc...@gcc.gnu.org

gcc/ChangeLog:

* intl.h: Add comments.
---
  gcc/intl.h | 5 +
  1 file changed, 5 insertions(+)

diff --git a/gcc/intl.h b/gcc/intl.h
index 829364ae905..f21ec11ada0 100644
--- a/gcc/intl.h
+++ b/gcc/intl.h
@@ -47,14 +47,19 @@ extern const char *fake_ngettext (const char *singular, 
const char *plural,
  
  #endif
  
+/* Used to immediately translate the argument.  */

  #ifndef _
  # define _(msgid) gettext (msgid)
  #endif
  
+/* Used to mark strings that will be translated later.  */

  #ifndef N_
  # define N_(msgid) msgid
  #endif
  
+/* Like N_, but used for diagnostic strings, to tell gettext that this is a

+   gcc-internal-format string rather than standard c-format.  exgettext gets
+   this from the 'g' in "gmsgid", which is also used in diagnostic.c.  */
  #ifndef G_
  # define G_(gmsgid) gmsgid
  #endif


I'd just write
/* Like N_, but for GCC diagnostic format strings.  See ABOUT-GCC-NLS for
details.  */


Aha, that's where the documentation lives!  Committed with that change.

Jason



Re: gcc 11.1.0 mpfr

2021-05-14 Thread Andrew Pinski via Gcc
On Fri, May 14, 2021 at 3:27 AM Richard Biener via Gcc  wrote:
>
> On May 14, 2021 10:53:21 AM GMT+02:00, "Martin Liška"  wrote:
> >On 5/12/21 10:51 AM, Richard Biener via Gcc wrote:
> >> On Tue, May 11, 2021 at 6:34 PM Serge Belyshev via Gcc
> > wrote:
> >>>
> >>>
>  $ egrep "mpfr\.h" log/cfg/cfg.gcc-11.1.0.log
>  checking for the correct version of mpfr.h... buggy but acceptable
> 
>  It appears "gcc-11.1.0/contrib/download_prerequisites"
>  specifies "mpfr-3.1.4.tar.bz2" whereas top level 'configure'
>  has "MPFR_VERSION_NUM(3,1,6)".
> 
>  Is there a reason mpfr 3.1.6 isn't being used?
> >>>
> >>> No good reason: that script was not updated with new versions.
> >GCC-11 is
> >>> also known to work fine with the most recent mpfr version 4.1.0.
> >>
> >> Yes, the update of the minimum version and the buggy check was
> >> done by Janne w/o adjusting the download script.
> >>
> >> Richard.
> >>
> >
> >Should I adjust download_prerequisites accordingly?
>
> Yes.

It looks like the adjustment was made but the file was not added uploaded:
[apinski@xeond2 gcc]$ ./contrib/download_prerequisites
2021-05-14 13:18:41
URL:http://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2
[2383840/2383840] -> "gmp-6.1.0.tar.bz2" [1]
http://gcc.gnu.org/pub/gcc/infrastructure/mpfr-4.1.0.tar.bz2:
2021-05-14 13:18:42 ERROR 404: Not Found.
error: Cannot download mpfr-4.1.0.tar.bz2 from
http://gcc.gnu.org/pub/gcc/infrastructure/


Thanks,
Andrew Pinski


>
> Richard.
>
> >Martin
>


gcc-10-20210514 is now available

2021-05-14 Thread GCC Administrator via Gcc
Snapshot gcc-10-20210514 is now available on
  https://gcc.gnu.org/pub/gcc/snapshots/10-20210514/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 10 git branch
with the following options: git://gcc.gnu.org/git/gcc.git branch 
releases/gcc-10 revision a0368f8344f85c09886c7c77b9aff6ae4f94ee80

You'll find:

 gcc-10-20210514.tar.xz   Complete GCC

  SHA256=4d76134eaeb4f1580fa81813daaefeca666e4a19bd1aeff6e659d09873573385
  SHA1=0878a66bee83fe64353df16e983ea71851efe9ba

Diffs from 10-20210507 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-10
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.