Re: Ping^3: [PATCH] d: Update __FreeBSD_version values [PR107469]

2023-01-28 Thread Lorenzo Salvadore via Gcc-patches
--- Original Message ---
On Monday, January 23rd, 2023 at 3:45 PM, Iain Buclaw  
wrote:


> 
> 
> Excerpts from Lorenzo Salvadore's message of Januar 10, 2023 5:10 pm:
> 
> > Hello,
> > 
> > Ping https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605685.html
> > 
> > I would like to remind that Gerald Pfeifer already volunteered to commit 
> > this patch
> > when it is approved. However the patch has not been approved yet.
> 
> 
> Hi, sorry for belated reply.
> 
> Yes is fine for now, I'm concerned that it'll just be the same again
> come FreeBSD 15, 16, 17...
> 
> There needs to be a better mechanism to determine which FreeBSD version
> is being compiled for, but that shouldn't block this going in.
> 
> OK.

Thanks, I will keep this concern in mind when FreeBSD 15 starts its
development and then I will try to submit a patch proposing a better
mechanism.

Cheers,

Lorenzo Salvadore


[pushed] libstdc++: Switch www.open-std.org to https (ABI manual)

2023-01-28 Thread Gerald Pfeifer
Pushed.

Gerald


libstdc++-v3/ChangeLog:

* doc/xml/manual/abi.xml: Update www.open-std.org link to https.
* doc/html/manual/abi.html: Regenerate.
---
 libstdc++-v3/doc/html/manual/abi.html | 4 ++--
 libstdc++-v3/doc/xml/manual/abi.xml   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/doc/html/manual/abi.html 
b/libstdc++-v3/doc/html/manual/abi.html
index b1f89e8f57e..2781aeda30d 100644
--- a/libstdc++-v3/doc/html/manual/abi.html
+++ b/libstdc++-v3/doc/html/manual/abi.html
@@ -551,13 +551,13 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 
/usr/lib/libstdc++.so.
   C++ ABI for the ARM Architecture

   . 
-   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html"; 
target="_top">
+   https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html"; 
target="_top">
   Dynamic Shared Objects: Survey and Issues

   . 
   ISO C++ J16/06-0046
 . Benjamin 
Kosnik. 
-   http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html"; 
target="_top">
+   https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html"; 
target="_top">
Versioning With Namespaces

   . 
diff --git a/libstdc++-v3/doc/xml/manual/abi.xml 
b/libstdc++-v3/doc/xml/manual/abi.xml
index 008fb66e5b1..3cca1fd3b38 100644
--- a/libstdc++-v3/doc/xml/manual/abi.xml
+++ b/libstdc++-v3/doc/xml/manual/abi.xml
@@ -1191,7 +1191,7 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 
/usr/lib/libstdc++.so.
   
   
http://www.w3.org/1999/xlink";
- 
xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html";>
+ 
xlink:href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html";>
   Dynamic Shared Objects: Survey and Issues

   
@@ -1205,7 +1205,7 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 
/usr/lib/libstdc++.so.
   
   
http://www.w3.org/1999/xlink";
- 
xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html";>
+ 
xlink:href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html";>
Versioning With Namespaces

   
-- 
2.39.1


[pushed] doc: Update Go1 link

2023-01-28 Thread Gerald Pfeifer
gcc/ChangeLog:

* doc/standards.texi: Update Go1 link.
---
 gcc/doc/standards.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi
index d9ee11ccc29..b54502add41 100644
--- a/gcc/doc/standards.texi
+++ b/gcc/doc/standards.texi
@@ -318,7 +318,7 @@ available online, see 
@uref{https://gcc.gnu.org/readings.html}
 @section Go Language
 
 As of the GCC 4.7.1 release, GCC supports the Go 1 language standard,
-described at @uref{https://golang.org/doc/go1}.
+described at @uref{https://go.dev/doc/go1}.
 
 @section D language
 
-- 
2.39.1


[pushed] doc: Update reference to AddressSanitizer

2023-01-28 Thread Gerald Pfeifer
gcc/ChangeLog:

* doc/invoke.texi (Instrumentation Options): Update reference to
AddressSanitizer.
---
 gcc/doc/invoke.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a371cd91ef8..6e3f5bf8216 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -16563,7 +16563,7 @@ this can be achieved with @samp{setarch `uname -m` -R 
./prog}.
 @item -fsanitize=kernel-address
 @opindex fsanitize=kernel-address
 Enable AddressSanitizer for Linux kernel.
-See @uref{https://github.com/google/kasan} for more details.
+See @uref{https://github.com/google/kernel-sanitizers} for more details.
 
 @item -fsanitize=hwaddress
 @opindex fsanitize=hwaddress
-- 
2.39.1


[pushed] libstdc++: Move sourceforge.net links to https

2023-01-28 Thread Gerald Pfeifer
Starting to see some trees in the forrest of links that require 
updating...

Pushed.

Gerald


libstdc++-v3/ChangeLog:

* doc/xml/manual/documentation_hacking.xml: Move sourceforge.net
links to https.
* doc/html/manual/documentation_hacking.html: Regenerate.
---
 libstdc++-v3/doc/html/manual/documentation_hacking.html | 4 ++--
 libstdc++-v3/doc/xml/manual/documentation_hacking.xml   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/doc/html/manual/documentation_hacking.html 
b/libstdc++-v3/doc/html/manual/documentation_hacking.html
index bd44b61010d..4e415c32389 100644
--- a/libstdc++-v3/doc/html/manual/documentation_hacking.html
+++ b/libstdc++-v3/doc/html/manual/documentation_hacking.html
@@ -362,7 +362,7 @@
by a vendor package like libxml2 and 
docbook5-schemas-5.0-4
   
For PDF output, something that transforms valid Docbook XML to PDF is
-   required. Possible solutions include http://dblatex.sourceforge.net"; target="_top">dblatex,
+   required. Possible solutions include https://dblatex.sourceforge.net"; target="_top">dblatex,
xmlto, or prince. Of
these, dblatex is the 
default.
Please consult the libstd...@gcc.gnu.org> list 
when
@@ -370,7 +370,7 @@
suggestions.
   
For Texinfo output, something that transforms valid Docbook
-   XML to Texinfo is required. The default choice is http://docbook2x.sourceforge.net/"; target="_top">docbook2X.
+   XML to Texinfo is required. The default choice is https://docbook2x.sourceforge.net/"; target="_top">docbook2X.
   
For epub output, the https://sourceforge.net/projects/docbook/files/epub3/"; 
target="_top">stylesheets for EPUB3 are required. These stylesheets are 
still in development. To validate the created file, https://github.com/w3c/epubcheck"; target="_top">epubcheck is 
necessary.
   Generating the DocBook 
Files
diff --git a/libstdc++-v3/doc/xml/manual/documentation_hacking.xml 
b/libstdc++-v3/doc/xml/manual/documentation_hacking.xml
index 44672f6e26d..8a1cba92506 100644
--- a/libstdc++-v3/doc/xml/manual/documentation_hacking.xml
+++ b/libstdc++-v3/doc/xml/manual/documentation_hacking.xml
@@ -779,7 +779,7 @@
 
   
For PDF output, something that transforms valid Docbook XML to PDF is
-   required. Possible solutions include http://www.w3.org/1999/xlink"; 
xlink:href="http://dblatex.sourceforge.net";>dblatex,
+   required. Possible solutions include http://www.w3.org/1999/xlink"; 
xlink:href="https://dblatex.sourceforge.net";>dblatex,
xmlto, or prince. Of
these, dblatex is the default.
Please consult the libstd...@gcc.gnu.org list when
@@ -789,7 +789,7 @@
 
   
For Texinfo output, something that transforms valid Docbook
-   XML to Texinfo is required. The default choice is http://www.w3.org/1999/xlink"; 
xlink:href="http://docbook2x.sourceforge.net/";>docbook2X.
+   XML to Texinfo is required. The default choice is http://www.w3.org/1999/xlink"; 
xlink:href="https://docbook2x.sourceforge.net/";>docbook2X.
   
 
   
-- 
2.39.1


[pushed, C++] wwwdocs: faq: Remove "Copy constructor access check" entry

2023-01-28 Thread Gerald Pfeifer
Sometimes less is more (and our FAQ can use some trimming/updating for 
sure).

Pushed.

Gerald


This entry refers to changes in GCC 3.4 and GCC 4.3 which were released
in 2004 and 2008, respectively, and this is hardly a FAQ any more.
---
 htdocs/bugs/index.html | 50 --
 1 file changed, 50 deletions(-)

diff --git a/htdocs/bugs/index.html b/htdocs/bugs/index.html
index aaef8915..96a5d0f0 100644
--- a/htdocs/bugs/index.html
+++ b/htdocs/bugs/index.html
@@ -605,56 +605,6 @@ a parse error before the character : (the 
colon before
 The simplest way to avoid this is to write std::vector<
 ::X>, i.e. place a space between the opening angle bracket
 and the scope operator.
-
-
-Copy constructor access check while initializing a
-reference.
-
-Consider this code:
-
-
-class A 
-{
-public:
-  A();
-
-private:
-  A(const A&);   // private copy ctor
-};
-
-A makeA(void);
-void foo(const A&);
-
-void bar(void)
-{
-  foo(A());   // error, copy ctor is not accessible
-  foo(makeA());   // error, copy ctor is not accessible
-
-  A a1;
-  foo(a1);// OK, a1 is a lvalue
-}
-
-Starting with GCC 3.4.0, binding an rvalue to a const reference requires
-an accessible copy constructor. This might be surprising at first sight, 
-especially since most popular compilers do not correctly implement this 
-rule.
-
-The C++ Standard says that a temporary object should be created in 
-this context and its contents filled with a copy of the object we are 
-trying to bind to the reference; it also says that the temporary copy 
-can be elided, but the semantic constraints (eg. accessibility) of the 
-copy constructor still have to be checked.
-
-For further information, you can consult the following paragraphs of
-the C++ standard: [dcl.init.ref] wwwdocs:/5, bullet 2, sub-bullet 1, and
-[class.temporary] wwwdocs:/2.
-
-Starting with GCC 4.3.0, GCC no longer gives an error for this
-case.  This change is based on the
-https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391";>intent
-of the C++ language committee.  As of 2010-05-28, the final
-proposed draft of the C++0x standard permits this code without error.
-
 
 
 Common problems when upgrading the compiler
-- 
2.39.1


Re: [PATCH] [GCC12] Mention Intel AVX512-FP16 and _Float16 support.

2023-01-28 Thread Gerald Pfeifer
On Fri, 8 Oct 2021, Hongtao Liu wrote:
> > On Fri, 24 Sep 2021, Hongtao Liu via Gcc-patches wrote:
>>> +  New ISA extension support for Intel AVX512-FP16 was added to GCC.
>>> +  AVX512FP16 intrinsics are available [...]
>> So, is it AVX512-FP16 or AVX512FP16?
> Sorry for the confusion, the official name is AVX512-FP16[1], and for
> simplicity, AVX512FP16 is used in the mail thread.

Shouldn't we then consistently use AVX512-FP16 here (gcc-12/changes.html)
and in gcc/doc/invoke.texi where there are three instances of AVX512FP16
(without the dash)?

Gerald


[pushed] wwwdocs: bugs: Adjust link to ISO C++ standard

2023-01-28 Thread Gerald Pfeifer
Pushed.
Gerald

---
 htdocs/bugs/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/bugs/index.html b/htdocs/bugs/index.html
index 96a5d0f0..765d8c67 100644
--- a/htdocs/bugs/index.html
+++ b/htdocs/bugs/index.html
@@ -629,7 +629,7 @@ section of the GCC manual.
 Standard conformance
 
 With each release, we try to make G++ conform closer to the http://www.open-std.org/jtc1/sc22/wg21/";>ISO C++ standard.
+"https://www.open-std.org/jtc1/sc22/wg21/";>ISO C++ standard.
 
 Non-conforming legacy code that worked with older versions of GCC may be
 rejected by more recent compilers.  There is no command-line switch to ensure
-- 
2.39.1


[pushed] Modula-2: Claim Wreturn-type in lang.opt.

2023-01-28 Thread Iain Sandoe via Gcc-patches
Now we claim options for Modula-2 in m2/lang.opt we need to add those
used for warnings too.
This fixes:
FAIL: gm2/warnings/returntype/pass/Termbase.mod 
FAIL: gm2/warnings/returntype/pass/goodreturn.mod 
FAIL: gm2/warnings/returntype/pass/keypressedsimple.mod

all with -O0 -g -Werror=return-type  

Tested on x86_64-darwin21, pushed to trunk as obvious
thanks,
Iain

--- 8< ---

Modula-2 handles this warning so that we need to claim it in the
language options.

Signed-off-by: Iain Sandoe 

gcc/m2/ChangeLog:

* lang.opt: Claim Wreturn-type.
---
 gcc/m2/lang.opt | 4 
 1 file changed, 4 insertions(+)

diff --git a/gcc/m2/lang.opt b/gcc/m2/lang.opt
index ab4ea5547eb..b6ef8161d90 100644
--- a/gcc/m2/lang.opt
+++ b/gcc/m2/lang.opt
@@ -269,6 +269,10 @@ Wpedantic
 Modula-2
 ; Documented in common.opt
 
+Wreturn-type
+Modula-2
+; Documented in common.opt
+
 Wunused-variable
 Modula-2
 ; Documented in c.opt
-- 
2.37.1 (Apple Git-137.1)



Re: [COMMITTED] bpf: disable -fstack-protector in BPF

2023-01-28 Thread Jan-Benedict Glaw
On Tue, 2023-01-17 17:25:08 +0100, Jose E. Marchesi via Gcc-patches 
 wrote:
> The stack protector is not supported in BPF.  This patch disables
> -fstack-protector in bpf-* targets, along with the emission of a note
> indicating that the feature is not supported in this platform.
[...]
> diff --git a/gcc/config/bpf/bpf.cc b/gcc/config/bpf/bpf.cc
> index 576a1fe8eab..b268801d00c 100644
> --- a/gcc/config/bpf/bpf.cc
> +++ b/gcc/config/bpf/bpf.cc
> @@ -253,6 +253,14 @@ bpf_option_override (void)
>if (bpf_has_jmp32 == -1)
>  bpf_has_jmp32 = (bpf_isa >= ISA_V3);
>  
> +  /* Disable -fstack-protector as it is not supported in BPF.  */
> +  if (flag_stack_protect)
> +{
> +  inform (input_location,
> +  "%<-fstack-protector%> does not work "
> +  " on this architecture");
> +  flag_stack_protect = 0;
> +}

Building with a recent GCC with (noticed during a -Werror build), this
results in a new warning:

[all 2023-01-27 16:26:25] ../../gcc/gcc/config/bpf/bpf.cc: In function 'void 
bpf_option_override()':
[all 2023-01-27 16:26:25] ../../gcc/gcc/config/bpf/bpf.cc:260:51: error: 
unquoted sequence of 2 consecutive space characters in format 
[-Werror=format-diag]
[all 2023-01-27 16:26:25]   260 |   "%<-fstack-protector%> does not 
work "
[all 2023-01-27 16:26:25]   |   
^~
[all 2023-01-27 16:26:25]   261 |   " on this architecture");
[all 2023-01-27 16:26:25]   |   ~~  
 
[all 2023-01-27 16:26:27] cc1plus: all warnings being treated as errors

MfG, JBG

-- 


signature.asc
Description: PGP signature


Re: [Patch] Resolve bugzilla #108150 and #108192 for mingw

2023-01-28 Thread Jonathan Yong via Gcc-patches

On 1/19/23 09:26, Jonathan Yong wrote:

On 1/11/23 09:56, Jonathan Yong wrote:

Are the patches and changelogs OK?


Ping1.



Pushed to master branch.



Re: [patch, gfortran.dg] Adjust numerous tests so that they pass on line endings

2023-01-28 Thread Mikael Morin

Le 28/01/2023 à 03:47, Jerry D a écrit :


It is not apparent to me that the testsuite/ChangeLog was updated. Maybe 
there is a time delay on that?



Yes, it's done daily as part of the "daily bump" commit.
You can see it in the git log:

$ git log -- gcc/testsuite/ChangeLog
commit f457a62e63a86d5e5342eda16538a26355199856
Author: GCC Administrator 
Date:   Tue Jan 17 00:18:06 2023 +

Daily bump.

commit 5013c3bb3ead9c27adb90152115ca1d606cbf2dc
Author: GCC Administrator 
Date:   Sun Jan 15 00:17:49 2023 +

Daily bump.

commit ecd637e9761485437498f311ddf09af5286d6d0f
Author: GCC Administrator 
Date:   Fri Jan 13 00:17:18 2023 +

Daily bump.




[PATCH] Fortran: diagnose USE associated symbols in COMMON blocks [PR108453]

2023-01-28 Thread Harald Anlauf via Gcc-patches
Dear all,

a USE associated symbol shall not appear in a COMMON block
(F2018:C8121) and needs to be diagnosed.  The patch is
fairly obvious.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?

As the PR is marked as a 10/11/12/13 regression,
I plan to backport as appropriate.

Thanks,
Harald

From 3f0e4b23038ade2cd14d93b0705af93848ee45c2 Mon Sep 17 00:00:00 2001
From: Harald Anlauf 
Date: Sat, 28 Jan 2023 17:59:23 +0100
Subject: [PATCH] Fortran: diagnose USE associated symbols in COMMON blocks
 [PR108453]

gcc/fortran/ChangeLog:

	PR fortran/108453
	* match.cc (gfc_match_common): A USE associated name shall not appear
	in a COMMON block (F2018:C8121).

gcc/testsuite/ChangeLog:

	PR fortran/108453
	* gfortran.dg/common_27.f90: New test.
---
 gcc/fortran/match.cc| 10 ++
 gcc/testsuite/gfortran.dg/common_27.f90 | 14 ++
 2 files changed, 24 insertions(+)
 create mode 100644 gcc/testsuite/gfortran.dg/common_27.f90

diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index 5e933c12931..5eb6d0e1c1d 100644
--- a/gcc/fortran/match.cc
+++ b/gcc/fortran/match.cc
@@ -5345,6 +5345,16 @@ gfc_match_common (void)
 		goto cleanup;
 	}

+	  /* F2018:R874:  common-block-object is variable-name [ (array-spec) ]
+	 F2018:C8121: A variable-name shall not be a name made accessible
+	 by use association.  */
+	  if (sym->attr.use_assoc)
+	{
+	  gfc_error ("Symbol %qs at %C is USE associated from module %qs "
+			 "and cannot occur in COMMON", sym->name, sym->module);
+	  goto cleanup;
+	}
+
 	  /* Deal with an optional array specification after the
 	 symbol name.  */
 	  m = gfc_match_array_spec (&as, true, true);
diff --git a/gcc/testsuite/gfortran.dg/common_27.f90 b/gcc/testsuite/gfortran.dg/common_27.f90
new file mode 100644
index 000..dcde5de2bd2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/common_27.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! PR fortran/108453 - a use associated variable cannot occur in COMMON
+! Contributed by G.Steinmetz
+
+module m
+  type t
+  end type
+  real :: r
+end
+program p
+  use m, only: t, r
+  common t  ! { dg-error "USE associated from module" }
+  common /cm/ r ! { dg-error "USE associated from module" }
+end
--
2.35.3



*PING* [PATCH] Fortran: fix ICE in compare_bound_int [PR108527]

2023-01-28 Thread Harald Anlauf via Gcc-patches

Early gentle ping.

Am 24.01.23 um 22:48 schrieb Harald Anlauf via Gcc-patches:

Dear all,

when checking expressions for array sections, we need to ensure
that these use only type INTEGER.  However, it does not make sense
to generate an internal error when encountering wrong types,
but rather take the ordinary route of error recovery.

The initial fix was provided by Steve.

While working on the same PR, I found that the comments related
to the logic needed a minor adjustment, and the logic could be
cleaned up to actually match the intended comment.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?

Thanks,
Harald





[Patch] Fix excess warnings for mingw-w64 (LLP64)

2023-01-28 Thread Jonathan Yong via Gcc-patches
I'm not fully confident if it might break other platforms. So hopefully 
someone can comment on the patch.


gcc/testsuite/ChangeLog:

* c-c++-common/Wsizeof-array-div1.c: fix excess warnings.
* gcc.dg/Warray-bounds-52.c: ditto
* gcc.dg/Wstringop-overflow-62.c: ditto
* gcc.dg/attr-vector_size.c: ditto
* gcc.dg/overflow-warn-9.c: ditto

Comments?From 209c55e5695e0124138b27057dac5329106f29be Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10wa...@gmail.com>
Date: Sat, 28 Jan 2023 16:49:27 +
Subject: [PATCH] gcc/testsuite: fix excess warnings for mingw-w64

gcc/testsuite/ChangeLog:

	* c-c++-common/Wsizeof-array-div1.c: fix excess warnings.
	* gcc.dg/Warray-bounds-52.c: ditto
	* gcc.dg/Wstringop-overflow-62.c: ditto
	* gcc.dg/attr-vector_size.c: ditto
	* gcc.dg/overflow-warn-9.c: ditto

Signed-off-by: Jonathan Yong <10wa...@gmail.com>
---
 gcc/testsuite/c-c++-common/Wsizeof-array-div1.c | 6 +++---
 gcc/testsuite/gcc.dg/Warray-bounds-52.c | 2 +-
 gcc/testsuite/gcc.dg/Wstringop-overflow-62.c| 2 +-
 gcc/testsuite/gcc.dg/attr-vector_size.c | 4 ++--
 gcc/testsuite/gcc.dg/overflow-warn-9.c  | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c b/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c
index 6e01d6c87d1..068ce0145ca 100644
--- a/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c
+++ b/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c
@@ -13,12 +13,12 @@ fn (int ap[])
   int r = 0;
 
   r += sizeof (arr) / sizeof (*arr);
-  r += sizeof (arr) / sizeof (p); /* { dg-warning "expression does not compute" "" { target { lp64 } } } */
-  r += sizeof (arr) / sizeof p; /* { dg-warning "expression does not compute" "" { target { lp64 } } } */
+  r += sizeof (arr) / sizeof (p); /* { dg-warning "expression does not compute" "" { target { ! ilp32 } } } */
+  r += sizeof (arr) / sizeof p; /* { dg-warning "expression does not compute" "" { target { ! ilp32 } } } */
   r += sizeof (arr) / (sizeof p);
   r += sizeof (arr) / (sizeof (p));
   r += sizeof (arr2) / sizeof p;
-  r += sizeof (arr2) / sizeof (int); /* { dg-warning "expression does not compute" "" { target { lp64 } } } */
+  r += sizeof (arr2) / sizeof (int); /* { dg-warning "expression does not compute" "" { target { ! ilp32 } } } */
   r += sizeof (arr2) / sizeof (int *);
   r += sizeof (arr2) / sizeof (short *);
   r += sizeof (arr) / sizeof (int);
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-52.c b/gcc/testsuite/gcc.dg/Warray-bounds-52.c
index c7217ad4f7b..69dc15ace2d 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-52.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-52.c
@@ -60,7 +60,7 @@ void ptr_idx_cst (void)
   T ( 0, (int[]){ 1 });
   T (+1, (int[]){ 1 }); // { dg-warning "array subscript 1 is outside array bounds of 'int\\\[1]'" }
   T (INT_MIN, (int[]){ 1 });// { dg-warning "array subscript -\[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { xfail ilp32 } }
-  T (INT_MAX, (int[]){ 1 });// { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "lp64" { target lp64 } }
+  T (INT_MAX, (int[]){ 1 });// { dg-warning "array subscript \[0-9\]+ is outside array bounds of 'int\\\[1]'" "not-ilp32" { target { ! ilp32 } } }
 // { dg-warning "array subscript -1 is outside array bounds of 'int\\\[1]'" "ilp32" { target ilp32 } .-1 }
   T (SIZE_MAX, (int[]){ 1 });   // { dg-warning "array subscript -?\[0-9\]+ is outside array bounds of 'int\\\[1]'" }
 }
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c
index ea19aa85905..d589f077887 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-62.c
@@ -41,7 +41,7 @@ void test_min (void)
 memset (q, 0, DIFF_MAX - 2);
 memset (q, 0, DIFF_MAX);
 // { dg-warning "writing 2147483647 bytes into a region of size 2147483646" "ilp32" { target ilp32 } .-1 }
-// { dg-warning "writing 9223372036854775807 bytes into a region of size 9223372036854775806" "lp64" { target lp64 } .-2 }
+// { dg-warning "writing 9223372036854775807 bytes into a region of size 9223372036854775806" "not-ilp32" { target { ! ilp32 } } .-2 }
   }
 
   {
diff --git a/gcc/testsuite/gcc.dg/attr-vector_size.c b/gcc/testsuite/gcc.dg/attr-vector_size.c
index 3f2ce889121..9177e25250a 100644
--- a/gcc/testsuite/gcc.dg/attr-vector_size.c
+++ b/gcc/testsuite/gcc.dg/attr-vector_size.c
@@ -22,7 +22,7 @@ DEFVEC (extern, 30);
 
 #if __SIZEOF_SIZE_T__ > 4
 
-VEC (POW2 (63)) char v63; /* { dg-error  "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "LP64" { target lp64 } } */
+VEC (POW2 (63)) char v63; /* { dg-error  "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "not-ILP32" { target { ! ilp32 } } } */
 
 #else
 
@@ -41,7 +41,7 @@ void test_local_scope (void)
 
 #i

OpenMP Patch Ping – including "[13 Regression]" patches

2023-01-28 Thread Tobias Burnus

"[13 Regression]" OpenMP Fortran patches:

[Patch] OpenMP/Fortran: Fix loop-iter var privatization with !$OMP LOOP 
[PR108512]
https://gcc.gnu.org/pipermail/gcc-patches/2023-January/610531.html

[Patch][v2] OpenMP/Fortran: Partially fix non-rect loop nests [PR107424]
https://gcc.gnu.org/pipermail/gcc-patches/2023-January/610584.html


Additionally, there several more patches pending, see below. Of those:

The first two small ones are very simple; especially the first one I
regard as obvious! The third one is a documentation patch.

The others are of varying complexity but I think some would be still suitable
for the current stage, including some which have been pinged since October :-(

Tobias

PS: The mentioned patches:

On 10.01.23 12:37, Tobias Burnus wrote:

Hi all, hello Jakub,

Below is the updated list to last ping,
https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607178.html

NOTE to the list below: I have stopped checking older patches. I know
some more are pending review, others need to be revised. I will re-check,
once the below listed patches have been reviewed. Cf. old list.

Thanks for the reviews done in between the last ping and now!

 * * *

Small patches
=

* [Patch] Fortran: Extend align-clause checks of OpenMP's allocate clause
https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608401.html
  Tue Dec 13 16:38:22 GMT 2022

* [Patch] OpenMP: Parse align clause in allocate directive in C/C++
https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608404.html
  Tue Dec 13 17:44:27 GMT 2022

* Re: [Patch] libgomp.texi: Reverse-offload updates (was: [Patch]
libgomp: Handle OpenMP's reverse offloads)
https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608245.html
  Thu Nov 24 12:01:04 GMT 2022

(Side note: wwwdocs also needs to be updated for the latter patch and
some other patches done in the meanwhile.)


Fortran allocat(e,ors) prep patch
=

* [Patch] Fortran/OpenMP: Add parsing support for allocators/allocate
directive (was: [Patch] Fortran/OpenMP: Add parsing support for
allocators directive)
https://gcc.gnu.org/pipermail/gcc-patches/2022-December/608904.html
  Wed Dec 21 15:51:25 GMT 2022

(Remark: While written from scratch, it is kind of a follow-up to
Abid's patch
   [PATCH 1/5] [gfortran] Add parsing support for allocate directive
(OpenMP 5.0)
you/Jakub reviewed on Tue Oct 11 12:13:14 GMT 2022, i.e.
 https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603258.html
- For the actual implementation of 'allocators', we still have to
solve the issues
  raised in the review for '[PATCH 2/5] [gfortran] Translate allocate
directive (OpenMP 5.0).'.
  at
https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603279.html
(and earlier in the thread);
  implementing 'omp allocate' (Fortran/C/C++) seems to be easier but
no one has started implementing
  it so far - only parsing support exists.
- The USM patches on semi-USM system run into a similar issue as
'allocators' and for it, some
  ME omp_allocate is added.)


Mapping related patches
===
(Complex but GCC needs a revision badly as it fixing several bugs and
missing functionality.)

* Complete patch set was just re-submitted by Julian, overiew patch is
  [PATCH v6 00/11] OpenMP: C/C++ lvalue parsing, C/C++/Fortran
"declare mapper" support
https://gcc.gnu.org/pipermail/gcc-patches/2022-December/thread.html#609031
  Fri Dec 23 12:12:53 GMT 2022
* Note: For 10/11 of the set, there was a follow up this Monday
  [PATCH v6 10/11] OpenMP: Support OpenMP 5.0 "declare mapper"
directives for C
https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609566.html

[As it relates to one patch in the series:
  '[Patch] Fortran/OpenMP: Fix DT struct-component with 'alloc' and
array descr'
That's mine, needs to be updated (WIP) and fixes array
descriptor/alloc-string-length var
issues, where descriptor/string length may need to be handled
explicitly on data entering map,
i.e. string lengths/allocator may require 'to:' instead of 'alloc:' -
and on data exit mapping,
the current code might add a bogus 'alloc:'. - Idea is to handle this
explicitly
in fortran/trans-openmp.cc instead of auto-adding it in the ME.
Status: WIP - removed in ME but not all cases are handled yet in FE.)


Fortran deep mapping (allocatable components)

(Old patch of March 2022, but first part now properly but belated
submitted - today):
[Patch][1/2] OpenMP: Add lang hooks + run-time filled map arrays for
Fortran deep mapping of DT
https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609637.html

Tobias

-
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955


[Patch] pr65658.c: fix excess warnings on LLP64 targets

2023-01-28 Thread Jonathan Yong via Gcc-patches

Patch OK?

gcc/testsuite/ChangeLog:

* gcc.dg/pr65658.c: fix LLP64 test.From bd2634e2795723f290dcf4bbb06e70fb6ca6af51 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10wa...@gmail.com>
Date: Sat, 28 Jan 2023 18:12:50 +
Subject: [PATCH] pr65658.c: fix excess warnings on LLP64 targets

gcc/testsuite/ChangeLog:

	* gcc.dg/pr65658.c: fix LLP64 test.

Signed-off-by: Jonathan Yong <10wa...@gmail.com>
---
 gcc/testsuite/gcc.dg/pr65658.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr65658.c b/gcc/testsuite/gcc.dg/pr65658.c
index bb5c37adbe3..4847dc2d5c7 100644
--- a/gcc/testsuite/gcc.dg/pr65658.c
+++ b/gcc/testsuite/gcc.dg/pr65658.c
@@ -16,10 +16,10 @@ struct undeffoo
 };
 struct problem
 {
-  unsigned long l1;
-  unsigned long l2;
-  unsigned long l3;
-  unsigned long l4;
+  __UINTPTR_TYPE__ l1;
+  __UINTPTR_TYPE__ l2;
+  __UINTPTR_TYPE__ l3;
+  __UINTPTR_TYPE__ l4;
 };
 static unsigned int undef1, undef2, undef3, undef4, undef5, undef6;
 static void *undefvp1;
@@ -37,7 +37,7 @@ undefinit1 (void)
 }
 
 static int
-undefinit2 (void *problemp, unsigned long problem)
+undefinit2 (void *problemp, __UINTPTR_TYPE__ problem)
 {
   int ret, u;
   if (undefinit1 ())
@@ -60,7 +60,7 @@ fn6 (struct undefinfo *uip, struct problem *problem)
   unsigned long amt;
   if (external_function3 (((void *) 0), ((void *) 0), &amt, 0, 0))
 return 1;
-  problem->l1 = (unsigned long) undefvp1;
+  problem->l1 = (__UINTPTR_TYPE__) undefvp1;
   problem->l4 = uip->l1;
   problem->l3 = uip->l2;
   return 0;
-- 
2.39.1



[pushed] doc: Update link to Objective-C book

2023-01-28 Thread Gerald Pfeifer
Pushed.
Gerald

gcc/ChangeLog:

* doc/standards.texi (Standards): Update link to Objective-C book.
---
 gcc/doc/standards.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi
index b54502add41..5ea724f5657 100644
--- a/gcc/doc/standards.texi
+++ b/gcc/doc/standards.texi
@@ -280,7 +280,7 @@ works with the Apple/NeXT Objective-C runtime library.
 There is no formal written standard for Objective-C or Objective-C++@.
 The authoritative manual on traditional Objective-C (1.0) is
 ``Object-Oriented Programming and the Objective-C Language'':
-@uref{http://www.gnustep.org/@/resources/@/documentation/@/ObjectivCBook.pdf}
+@uref{https://gnustep.github.io/@/resources/@/documentation/@/ObjectivCBook.pdf}
 is the original NeXTstep document.
 
 The Objective-C exception and synchronization syntax (that is, the
-- 
2.39.1


Re: [PATCH] Fortran: fix ICE in compare_bound_int [PR108527]

2023-01-28 Thread Jerry D via Gcc-patches

On 1/24/23 1:48 PM, Harald Anlauf via Fortran wrote:

Dear all,

when checking expressions for array sections, we need to ensure
that these use only type INTEGER.  However, it does not make sense
to generate an internal error when encountering wrong types,
but rather take the ordinary route of error recovery.

The initial fix was provided by Steve.

While working on the same PR, I found that the comments related
to the logic needed a minor adjustment, and the logic could be
cleaned up to actually match the intended comment.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?

Thanks,
Harald



Harald, this looks OK to me. Good for Mainline.


Re: [PATCH] Fortran: diagnose USE associated symbols in COMMON blocks [PR108453]

2023-01-28 Thread Steve Kargl via Gcc-patches
On Sat, Jan 28, 2023 at 06:07:50PM +0100, Harald Anlauf via Fortran wrote:
> 
> a USE associated symbol shall not appear in a COMMON block
> (F2018:C8121) and needs to be diagnosed.  The patch is
> fairly obvious.
> 
> Regtested on x86_64-pc-linux-gnu.  OK for mainline?
> 
> As the PR is marked as a 10/11/12/13 regression,
> I plan to backport as appropriate.
> 

Yes.  Backports are fine with a clean regression test.

Thanks for the patch and your continued attack on
bugzilla issues.

-- 
Steve


Re: [PATCH] Fortran: diagnose USE associated symbols in COMMON blocks [PR108453]

2023-01-28 Thread Jerry D via Gcc-patches

On 1/28/23 9:07 AM, Harald Anlauf via Fortran wrote:

Dear all,

a USE associated symbol shall not appear in a COMMON block
(F2018:C8121) and needs to be diagnosed.  The patch is
fairly obvious.

Regtested on x86_64-pc-linux-gnu.  OK for mainline?

As the PR is marked as a 10/11/12/13 regression,
I plan to backport as appropriate.

Thanks,
Harald



Yes, this is OK for all.

Thanks

Jerry


[pushed] wwwdocs: cxx-status: Fix link to GCC 10 release notes

2023-01-28 Thread Gerald Pfeifer
Pushed.
Gerald


"." refers to the current directory; we need ".." to move one level up.
---
 htdocs/projects/cxx-status.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html
index f6435eb2..cc8fe615 100644
--- a/htdocs/projects/cxx-status.html
+++ b/htdocs/projects/cxx-status.html
@@ -180,7 +180,7 @@
 
Character sets and encodings 
https://wg21.link/p2314r4";>P2314R4
-   10
+   10

 
 
-- 
2.39.1


[v2,pushed] wwwdocs: projects/gomp: Editorial changes

2023-01-28 Thread Gerald Pfeifer
This is a minor variation of what i shared a week ago. 

Pushed now, and I'll be happy to make adjustments/further changes based on 
feedback.

Gerald


Break long sentences, fixe grammar, simplify language.
---
 htdocs/projects/gomp/index.html | 29 ++---
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/htdocs/projects/gomp/index.html b/htdocs/projects/gomp/index.html
index 17cf1ad9..b2b3b0c8 100644
--- a/htdocs/projects/gomp/index.html
+++ b/htdocs/projects/gomp/index.html
@@ -38,9 +38,9 @@ OpenMP and OpenACC are supported with GCC's C, C++ and 
Fortran compilers.
   To enable https://www.openmp.org";>OpenMP,
   use https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-fopenmp";
-  >-fopenmp; -fopenmp-simd can be used
+  >-fopenmp. -fopenmp-simd can be used
   to enable only the SIMD vectorization and loop-transformation constructs
-  without creating multiple threads, offloading code or adding library
+  without creating multiple threads, offloading code or adding a library
   dependency.
   To enable https://www.openacc.org";>OpenACC,
   use 
 
   The https://gcc.gnu.org/onlinedocs/gcc/Developer-Options.html#index-fopt-info";
-  >-fopt-info flag provides details about compile-time 
performed
-  optimizations.
+  >-fopt-info flag provides details about optimizations
+  at compile time.
   Environment variables can be used to influence run-time behavior and 
output
   more data, useful for debugging or performance tuning. See the https://gcc.gnu.org/onlinedocs/libgomp/";>GNU libgomp manual for
@@ -103,32 +103,31 @@ time-consuming and arcane task.
 
 
 OpenMP offers a simple way of exploiting parallelism without
-interfering with algorithm design; an OpenMP program compiles and
+interfering with algorithm design. An OpenMP program compiles and
 operates correctly in both parallel and serial execution
 environments. Using OpenMP's directive-based parallelism also
-simplifies the act of converting existing serial code to
-efficient parallel code.
+simplifies converting existing serial code to efficient parallel code.
 
-OpenMP additionally permits to offload computations on
+OpenMP additionally permits to offload computations to
 accelerators such as GPUs,
-making use of their highly parallel computation support; if
+making use of their highly parallel computation support. If
 no accelerator is available, as fallback, the computation is
-then done on the host.
+done on the host.
 
 To remain relevant, free software development tools must
 support emerging technologies. By implementing OpenMP, GOMP
-provides a simplified syntax tools for creating software targeted
+provides a simple tool for creating software targeted
 at parallel architectures. OpenMP's platform-neutral syntax
 meshes well with the portability goals of GCC and other GNU
 projects.
 
-The GOMP release includes a support library, libgomp, and
+GOMP includes a support library (libgomp) and
 extensions to target language parsers.  A long-term goal is
 the generation of efficient and small code for OpenMP applications.
 
 When support for OpenACC was added, the project name GOMP
 was reinterpreted as GNU Offloading and Multi-Processing instead
-of denoting GNU OpenMP.
+of denoting GNU OpenMP.
 
 Contributing
 We encourage everyone to
@@ -1151,7 +1150,7 @@ Version 5.1 has been released.
 Technical Report 9: Version 5.1 Public Comment Draft has been 
released.
 
 May 7, 2020
-GCC 10 has been released; it adds a number 
of
+GCC 10 has been released. It adds a number 
of
 newly implemented OpenMP 5.0 features on top of the GCC 9 release such as
 conditional lastprivate clause, scan
 and loop directives, order(concurrent) and
@@ -1181,7 +1180,7 @@ mapping.
 April 27, 2016
 GCC 6 has been released and
 version 4.5 of the OpenMP specification is now supported in the C and
-C++ compilers
+C++ compilers.
 
 November 14, 2015
 The final 

[pushed] wwwdocs: gcc-11: Switch www.open-std.org to https

2023-01-28 Thread Gerald Pfeifer
Pushed.
Gerald

---
 htdocs/gcc-11/porting_to.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/gcc-11/porting_to.html b/htdocs/gcc-11/porting_to.html
index 802fb367..a7b634c1 100644
--- a/htdocs/gcc-11/porting_to.html
+++ b/htdocs/gcc-11/porting_to.html
@@ -49,7 +49,7 @@ in CXXFLAGS or similar variables in 
Makefiles.
 G++, starting with
 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=31bfc9b9";>G++ 7,
 implements C++17
-http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html";>P0522R0,
+https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0522r0.html";>P0522R0,
 Matching of template template-arguments excludes compatible templates.  As a
 consequence, the following test is now rejected:
 
-- 
2.39.1


[pushed] libstdc++: Update links in the "Contributing" manual

2023-01-28 Thread Gerald Pfeifer
Pushed.

Gerald


libstdc++-v3/ChangeLog:

* doc/xml/manual/appendix_contributing.xml: Adjust link to
ISO C++ standard at ANSI.
Move link to www.open-std.org to https.
* doc/html/manual/appendix_contributing.html: Regenerate.
---
 libstdc++-v3/doc/html/manual/appendix_contributing.html | 4 ++--
 libstdc++-v3/doc/xml/manual/appendix_contributing.xml   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/doc/html/manual/appendix_contributing.html 
b/libstdc++-v3/doc/html/manual/appendix_contributing.html
index 8be678eb919..e0b253ad263 100644
--- a/libstdc++-v3/doc/html/manual/appendix_contributing.html
+++ b/libstdc++-v3/doc/html/manual/appendix_contributing.html
@@ -26,12 +26,12 @@
  organization. In the USA, this national standards
  organization is
  https://www.ansi.org"; target="_top">ANSI.
- (And if you've already registered with them you can https://webstore.ansi.org/Standards/ISO/ISOIEC148822014"; target="_top">buy
+ (And if you've already registered with them you can https://webstore.ansi.org/standards/iso/isoiec148822014"; target="_top">buy
  the standard on-line.)

  The library working group bugs, and known defects, can
  be obtained here:
- http://www.open-std.org/jtc1/sc22/wg21/"; 
target="_top">http://www.open-std.org/jtc1/sc22/wg21
+ https://www.open-std.org/jtc1/sc22/wg21/"; 
target="_top">https://www.open-std.org/jtc1/sc22/wg21

  Peruse
  the http://www.gnu.org/prep/standards/"; 
target="_top">GNU
diff --git a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml 
b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
index ceb21f4478a..197c7d9fb40 100644
--- a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
+++ b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml
@@ -48,7 +48,7 @@
  http://www.w3.org/1999/xlink"; 
xlink:href="https://www.ansi.org";>ANSI.
  (And if you've already registered with them you can http://www.w3.org/1999/xlink";
- 
xlink:href="https://webstore.ansi.org/Standards/ISO/ISOIEC148822014";>buy
+ 
xlink:href="https://webstore.ansi.org/standards/iso/isoiec148822014";>buy
  the standard on-line.)

   
@@ -57,7 +57,7 @@

  The library working group bugs, and known defects, can
  be obtained here:
- http://www.w3.org/1999/xlink"; 
xlink:href="http://www.open-std.org/jtc1/sc22/wg21/";>http://www.open-std.org/jtc1/sc22/wg21
+ http://www.w3.org/1999/xlink"; 
xlink:href="https://www.open-std.org/jtc1/sc22/wg21/";>https://www.open-std.org/jtc1/sc22/wg21

   
 
-- 
2.39.1


[pushed] doc: Update link to the AVR-Libc manual

2023-01-28 Thread Gerald Pfeifer
Pushed.
Gerald

gcc/ChangeLog:

* doc/extend.texi (Named Address Spaces): Update link to the
AVR-Libc manual.
---
 gcc/doc/extend.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 027a08a2f62..5a026c4b48c 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1578,7 +1578,7 @@ locates data in flash but
 accesses to these data read from generic address space, i.e.@:
 from RAM,
 so that you need special accessors like @code{pgm_read_byte}
-from @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC}}
+from @w{@uref{https://www.nongnu.org/avr-libc/user-manual/,AVR-LibC}}
 together with attribute @code{progmem}.
 
 @noindent
-- 
2.39.1


[PATCH] Fix PR 108582: ICE due to PHI-OPT removing a still in use ssa_name.

2023-01-28 Thread Andrew Pinski via Gcc-patches
This patch adds a check in match_simplify_replacement to make sure the middlebb
does not have any phi-nodes as we don't currently move those.
This was just a thinko from before.

Ok? Bootstrapped and tested on x86_64-linux-gnu with no regressions?

PR tree-optimization/108582

gcc/ChangeLog:

* tree-ssa-phiopt.cc (match_simplify_replacement): Add check
for middlebb to have no phi nodes.

gcc/testsuite/ChangeLog:

* gcc.dg/pr108582-1.c: New test.
---
 gcc/testsuite/gcc.dg/pr108582-1.c | 58 +++
 gcc/tree-ssa-phiopt.cc|  5 +++
 2 files changed, 63 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/pr108582-1.c

diff --git a/gcc/testsuite/gcc.dg/pr108582-1.c 
b/gcc/testsuite/gcc.dg/pr108582-1.c
new file mode 100644
index 000..88c2de369ad
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr108582-1.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-tree-ccp -fno-tree-dce" } */
+
+/*
+  PHI-OPT via match_simplify_replacement used to transform:
+  if (_25 != 0)
+goto ; [25.00%]
+  else
+goto ; [75.00%]
+
+   [local count: 11649864]:
+  # iftmp.5_13 = PHI <2(7)>
+  k_22 = k_11 | iftmp.5_13;
+
+   [local count: 105655256]:
+  # g_9 = PHI <1(2), 0(8), g_8(7)>
+  # k_12 = PHI 
+
+into:
+
+  _15 = (int) _25;
+  _28 = -_15;
+  _4 = _13 & _28;
+  _6 = _4 | k_11;
+
+   [local count: 105655256]:
+  # g_9 = PHI <1(2), g_8(7)>
+  # k_12 = PHI 
+
+Removing the phi-node/assignment of _13.
+
+ */
+
+int a, c, d, e, f;
+char b;
+int main() {
+  int g = 1;
+  char h[1] = {0};
+  while (a) {
+if (f) {
+  b = 0;
+  if (d)
+continue;
+}
+if (a < 1) {
+  g = 0;
+  goto L;
+}
+  }
+  while (c) {
+char *j = h;
+int k;
+  L:
+if (e && !g)
+  k |= 2 | (*j < 0);
+  }
+  return 0;
+}
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index c3a889dc593..a7ab6ce4ad9 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -1002,6 +1002,11 @@ match_simplify_replacement (basic_block cond_bb, 
basic_block middle_bb,
   if (!single_pred_p (middle_bb))
return false;
 
+  /* The middle bb cannot have phi nodes as we don't
+move those assignments yet. */
+  if (!gimple_seq_empty_p (phi_nodes (middle_bb)))
+   return false;
+
   stmt_to_move = last_and_only_stmt (middle_bb);
   if (!stmt_to_move)
return false;
-- 
2.31.1



[PATCH] aarch64: Update Ampere-1A (-mcpu=ampere1a) to include SM4

2023-01-28 Thread Philipp Tomsich
gcc/ChangeLog:

* config/aarch64/aarch64-cores.def (AARCH64_CORE): Update
ampere1a to include SM4.

Signed-off-by: Philipp Tomsich 
---

 gcc/config/aarch64/aarch64-cores.def | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/aarch64/aarch64-cores.def 
b/gcc/config/aarch64/aarch64-cores.def
index 2a0f52e1dd9..85fdfd8bf74 100644
--- a/gcc/config/aarch64/aarch64-cores.def
+++ b/gcc/config/aarch64/aarch64-cores.def
@@ -70,7 +70,7 @@ AARCH64_CORE("thunderxt83",   thunderxt83,   thunderx,  V8A,  
(CRC, CRYPTO), thu
 
 /* Ampere Computing ('\xC0') cores. */
 AARCH64_CORE("ampere1", ampere1, cortexa57, V8_6A, (F16, RNG, AES, SHA3), 
ampere1, 0xC0, 0xac3, -1)
-AARCH64_CORE("ampere1a", ampere1a, cortexa57, V8_6A, (F16, RNG, AES, SHA3, 
MEMTAG), ampere1a, 0xC0, 0xac4, -1)
+AARCH64_CORE("ampere1a", ampere1a, cortexa57, V8_6A, (F16, RNG, AES, SHA3, 
SM4, MEMTAG), ampere1a, 0xC0, 0xac4, -1)
 /* Do not swap around "emag" and "xgene1",
this order is required to handle variant correctly. */
 AARCH64_CORE("emag",emag,  xgene1,V8A,  (CRC, CRYPTO), emag, 
0x50, 0x000, 3)
-- 
2.34.1



[PATCH] Change AVX512FP16 to AVX512-FP16 in the document.

2023-01-28 Thread liuhongt via Gcc-patches
The official name is AVX512-FP16.

Ready to push to trunk.

gcc/ChangeLog:

* config/i386/i386.opt: Change AVX512FP16 to AVX512-FP16.
* doc/invoke.texi: Ditto.
---
 gcc/config/i386/i386.opt | 2 +-
 gcc/doc/invoke.texi  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index feeb7dee9cc..7d57f617d65 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -1209,7 +1209,7 @@ Support MWAIT and MONITOR built-in functions and code 
generation.
 
 mavx512fp16
 Target Mask(ISA2_AVX512FP16) Var(ix86_isa_flags2) Save
-Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and 
AVX512FP16 built-in functions and code generation.
+Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX512F and 
AVX512-FP16 built-in functions and code generation.
 
 mdirect-extern-access
 Target Var(ix86_direct_extern_access) Init(1)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a371cd91ef8..3d059467690 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -32336,7 +32336,7 @@ AES, CLFLUSHOPT, XSAVEC, XSAVES, SGX, AVX512F, 
AVX512VL, AVX512BW, AVX512DQ,
 AVX512CD, PKU, AVX512VBMI, AVX512IFMA, SHA, AVX512VNNI, GFNI, VAES, 
AVX512VBMI2,
 VPCLMULQDQ, AVX512BITALG, RDPID, AVX512VPOPCNTDQ, PCONFIG, WBNOINVD, CLWB,
 MOVDIRI, MOVDIR64B, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG, SERIALIZE, TSXLDTRK,
-UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, AVX512FP16 and AVX512BF16
+UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, AVX512-FP16 and AVX512BF16
 instruction set support.
 
 @item alderlake
@@ -32363,7 +32363,7 @@ AES, CLFLUSHOPT, XSAVEC, XSAVES, SGX, AVX512F, 
AVX512VL, AVX512BW, AVX512DQ,
 AVX512CD, PKU, AVX512VBMI, AVX512IFMA, SHA, AVX512VNNI, GFNI, VAES, 
AVX512VBMI2,
 VPCLMULQDQ, AVX512BITALG, RDPID, AVX512VPOPCNTDQ, PCONFIG, WBNOINVD, CLWB,
 MOVDIRI, MOVDIR64B, AVX512VP2INTERSECT, ENQCMD, CLDEMOTE, PTWRITE, WAITPKG,
-SERIALIZE, TSXLDTRK, UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, AVX512FP16,
+SERIALIZE, TSXLDTRK, UINTR, AMX-BF16, AMX-TILE, AMX-INT8, AVX-VNNI, 
AVX512-FP16,
 AVX512BF16, AMX-FP16 and PREFETCHI instruction set support.
 
 @item k6
@@ -33229,7 +33229,7 @@ WBNOINVD, FMA4, PREFETCHW, RDPID, PREFETCHWT1, RDSEED, 
SGX, XOP, LWP,
 XSAVEOPT, XSAVEC, XSAVES, RTM, HLE, TBM, MWAITX, CLZERO, PKU, AVX512VBMI2,
 GFNI, VAES, WAITPKG, VPCLMULQDQ, AVX512BITALG, MOVDIRI, MOVDIR64B, AVX512BF16,
 ENQCMD, AVX512VPOPCNTDQ, AVX5124FMAPS, AVX512VNNI, AVX5124VNNIW, SERIALIZE,
-UINTR, HRESET, AMXTILE, AMXINT8, AMXBF16, KL, WIDEKL, AVXVNNI, AVX512FP16,
+UINTR, HRESET, AMXTILE, AMXINT8, AMXBF16, KL, WIDEKL, AVXVNNI, AVX512-FP16,
 AVXIFMA, AVXVNNIINT8, AVXNECONVERT, CMPCCXADD, AMX-FP16, PREFETCHI, RAOINT or
 CLDEMOTE extended instruction sets. Each has a corresponding @option{-mno-}
 option to disable use of these instructions.
-- 
2.31.1



[PATCH] Change AVX512FP16 to AVX512-FP16 which is official name.

2023-01-28 Thread liuhongt via Gcc-patches
Ready to push to trunk.

---
 htdocs/gcc-12/changes.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html
index 30fa4d6e..49055ffe 100644
--- a/htdocs/gcc-12/changes.html
+++ b/htdocs/gcc-12/changes.html
@@ -754,7 +754,7 @@ function Multiply (S1, S2 : Sign) return Sign is
 IA-32/x86-64
 
   New ISA extension support for Intel AVX512-FP16 was added.
-  AVX512FP16 intrinsics are available via the -mavx512fp16
+  AVX512-FP16 intrinsics are available via the -mavx512fp16
   compiler switch.
   
   For both C and C++ the _Float16 type is supported on
-- 
2.31.1



[patch, fortran] PR103506 [10/11/12/13 Regression] ICE in gfc_free_namespace, at fortran/symbol.c

2023-01-28 Thread Jerry DeLisle via Gcc-patches
Attached patch fixes this problem by allowing the namespace pointer to
be set correctly regardless of error condition.

Regression tested on x86_64_linux_gnu.

OK for trunk and backports?

Regards,

Jerry

Author: Jerry DeLisle 
Date:   Sat Jan 28 20:00:34 2023 -0800

 ICE in gfc_free_namespace. ice-on-invalid.

 PR fortran/103506

 gcc/fortran/ChangeLog:

 * parse.cc (parse_module): Remove use of a bool error value
 that prevented proper setting of the namespace pointer.

 gcc/testsuite/ChangeLog:

 * gfortran.dg/pr103506_1.f90: New test.diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc
index 0fb19cc9f0f..039e7e7da53 100644
--- a/gcc/fortran/parse.cc
+++ b/gcc/fortran/parse.cc
@@ -6502,7 +6502,6 @@ parse_module (void)
 {
   gfc_statement st;
   gfc_gsymbol *s;
-  bool error;
 
   s = gfc_get_gsymbol (gfc_new_block->name, false);
   if (s->defined || (s->type != GSYM_UNKNOWN && s->type != GSYM_MODULE))
@@ -6525,7 +6524,6 @@ parse_module (void)
 
   st = parse_spec (ST_NONE);
 
-  error = false;
 loop:
   switch (st)
 {
@@ -6544,16 +6542,11 @@ loop:
 default:
   gfc_error ("Unexpected %s statement in MODULE at %C",
 		 gfc_ascii_statement (st));
-
-  error = true;
   reject_statement ();
   st = next_statement ();
   goto loop;
 }
-
-  /* Make sure not to free the namespace twice on error.  */
-  if (!error)
-s->ns = gfc_current_ns;
+  s->ns = gfc_current_ns;
 }
 
 
diff --git a/gcc/testsuite/gfortran.dg/pr103506_1.f90 b/gcc/testsuite/gfortran.dg/pr103506_1.f90
new file mode 100644
index 000..3f57809e099
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr103506_1.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! PR103506 ICE in gfc_free_namespace. ice-on-invalid
+! Test case from the PR.
+module m ! { dg-error "is already being used as a MODULE" }
+stop ! { dg-error "Unexpected STOP statement in MODULE" }
+end
+program p
+call m ! { dg-error "is already being used as a MODULE" }
+end