[Bug middle-end/96987] [11 regression] warning 'ptr' may be used uninitialized const pointer parameter

2020-09-18 Thread ibuclaw at gdcproject dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96987

--- Comment #6 from Iain Buclaw  ---
(In reply to Martin Sebor from comment #5)
> A void pointer is usually cast to one to a complete type that's then used to
> access the object (e.g., bsearch).  But not every instance of every warning
> should be expected to indicate a bug.  Most only suggest that there might be
> one.  The documented purpose of GCC warnings is to "report constructions
> that are not inherently erroneous but that are risky or suggest there may
> have been an error."  This rare use is one such case.  It was considered
> when the warning was designed and deemed an acceptable trade-off.  (The
> attribute was added to help accommodate  it.)
> 
> If adding support for attribute access to the D front end isn't feasible to
> mark up the function and avoid the warning that way, I would suggest
> removing the const qualifier from the pointer (following the practice of the
> C++ standard garbage collector APIs) or providing an non-const overload. 
> Alternatively, writing into a byte of the allocated memory will prevent the
> warning as well.

Changing the API is not really an option as that sits in upstream.

Thinking more about it.  Though it isn't immediately intuitive, one implication
of the warning could be that the GC may run a mark/sweep between the time
GC.addRange is called and the allocated data being initialized, thus leading to
the possibility of false pointers being seen during the scan.

So I'll relax my stance on this, however was certainly thrown off by the way
the warning presented itself as shown in pr96989.

[Bug c++/97099] [temp.deduct.guide]p3 not implemented properly

2020-09-18 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97099

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2020-09-18
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug ipa/97119] New: Top level option to disable creation of IPA symbols such as .localalias is desired

2020-09-18 Thread ali_gccbugzilla at emvision dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97119

Bug ID: 97119
   Summary: Top level option to disable creation of IPA symbols
such as .localalias is desired
   Product: gcc
   Version: 10.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ali_gccbugzilla at emvision dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

I work on the Solaris linkers, and in that role, often
collaborate with Rainer Orth to keep gcc working on that
platform. As part of that, we use gcc to build the OS along
with the native Studio compilers, as a means to better test
things, and because we often find that one compiler finds issues
that the other doesn't.

A couple of years ago (gcc 5?), we became aware of symbols ending
in .localalias.nn, .part.nn, and isra.dd. While this is very
impressive technology, particularly when C++ templates are generating
reams of identical code bodies for various interfaces, it poses
some problems for using gcc to build the core Solaris OS.

To understand the issue, it is necessary to understand that
Solaris has a large infrastructure dedicated to producing
accurate stack traces purely from examining in memory
object content (symbol tables, etc) and not relying on
access to the on-disk image, or on any debug sections.
Our libproc does this efficiently, and as part of that, relies
on symbol sort sections generated by the linkers to map symbol
names to addresses, or addresses to names. When mapping addresses
to names, it is important that the name we report be the one that
the programmer would understand, and not some other name that
happens to have the same address, due to some under the hood
optimizations. DTrace, mdb, and the ptools (pstack, etc) all
rely on this.

In this context, the local symbols generated by IPA, and particularly
the .localalias symbols, mess up our results, causing our 
address-to-name tables to have multiple names, some of which are
optimization implementation details that are not what the
programmer would want to see. Even worse is the case where
2 functions have their bodies merged into one piece of text
with 2 different names. Showing the user the "wrong" name for
a function on their stack can be very misleading, and can cause
wasted debugging time until they realize that they're seeing an
IPA artifact. At the same time, the core OS is largely written in
C, so the benefits from these particular IPA features are modest
at best. We have found a few merged function bodies, and in this
case, the minor duplication bloat is a price worth paying to get
the correct name associated to the different instances.

With previous versions of gcc, we were able to disable the
production of these symbols by using -fno-ipa-icf, so we did
that and moved on. With gcc10 however, we find that -fno-ipa-icf
is not sufficient, and that we still see .localalias symbols
in the resulting links. Although I'm sure that there is another
option like -fno-ipa-icf that we could set to address
that, I would like to ask for a supported way to turn off all
IPA that causes symbols like these to be injected into the link.
so that we can opt out for our admittedly specialized purposes,
and without having to revisit it every time a new gcc version appears,
or dig into the underlying optimization passes to figure out what
to turn off.

Please note that turning down optimization (e.g. -g) in order to
achieve this isn't the sort of answer we're looking for. These are
not debug objects, but rather objects built for production use. Hence
 we want to retain optimizations that don't generate extra symbols
in a simple and maintainable way.

Rainer did a one off experiment that showed that it would be
fairly easy to provide this. I'll leave it to him to describe.

Thanks for your consideration of this.

[Bug fortran/97063] [ MATMUL intrinsic] The value of result is wrong when vector (step size is negative) * matrix

2020-09-18 Thread jvdelisle at charter dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97063

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at charter dot net

--- Comment #3 from Jerry DeLisle  ---
(In reply to anlauf from comment #2)
> Interestingly, the bug "disappears" if frontend optimization is enabled
> (-ffrontend-optimize), thus at all optimizations that enable it.

It could be we need to fix in the runtime library. I have not looked to closely
yet but it would be best I think if the front-end did the necessary
transforming. The code is probably there already to do it.

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:4a5ff2b56bfea0b3e154a15e809c5c42dc3b9e9f

commit r11-3292-g4a5ff2b56bfea0b3e154a15e809c5c42dc3b9e9f
Author: Jakub Jelinek 
Date:   Sat Sep 19 00:09:11 2020 +0200

c++: Add testcase for already fixed PR97105

This has been fixed by the PR bootstrap/97118 fix.

2020-09-19  Jakub Jelinek  

PR c++/97105
* g++.dg/template/pr97105.C: New test.

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Jakub Jelinek  ---
Fixed by the PR97118 fix.

[Bug bootstrap/97118] [11 Regression] r11-3274 breaks bootstrap

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97118

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:4a5ff2b56bfea0b3e154a15e809c5c42dc3b9e9f

commit r11-3292-g4a5ff2b56bfea0b3e154a15e809c5c42dc3b9e9f
Author: Jakub Jelinek 
Date:   Sat Sep 19 00:09:11 2020 +0200

c++: Add testcase for already fixed PR97105

This has been fixed by the PR bootstrap/97118 fix.

2020-09-19  Jakub Jelinek  

PR c++/97105
* g++.dg/template/pr97105.C: New test.

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

--- Comment #5 from Jakub Jelinek  ---
Ah, Jason has committed a fix already, against the other PR.  I'll commit the
testcase and close this PR.

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

--- Comment #4 from Jakub Jelinek  ---
>From what I can see, when doing pushdecl of the extern a declaration the
VAR_DECL is pushed into incomplete_vars, then when seeing the definition
pushdecl is called again and during duplicate_decls it is turned into no longer
DECL_EXTERNAL, but the type hasn't been instantiated yet.  Then start_decl
calls start_decl_1 which calls complete_decl and that sees an incomplete type
that can't be completed and errors.
One way out of this might be not call layout_var_decl if !COMPLETE_TYPE_P
(type).
Another one might be to let start_decl_1 record in some global variable that it
is processing (if it is) a variable with [] array and let complete_vars skip
that var.

[Bug c++/90210] [C++17] CTAD forbidding explicit deduction guide for copy-list-initialization

2020-09-18 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90210

Marek Polacek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Reduced testcase:
template  struct A {};
extern const A<0> a[];
const A<0> a[] = {};

[Bug fortran/97063] [ MATMUL intrinsic] The value of result is wrong when vector (step size is negative) * matrix

2020-09-18 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97063

--- Comment #2 from anlauf at gcc dot gnu.org ---
Interestingly, the bug "disappears" if frontend optimization is enabled
(-ffrontend-optimize), thus at all optimizations that enable it.

[Bug fortran/97063] [ MATMUL intrinsic] The value of result is wrong when vector (step size is negative) * matrix

2020-09-18 Thread anlauf at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97063

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

  Known to fail||10.2.1, 11.0, 7.4.1, 8.4.1,
   ||9.3.1
 CC||anlauf at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-09-18
 Ever confirmed|0   |1
   Priority|P3  |P4

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.  This happens with all real kinds, not only kind=16.

The output is easier to read when replacing

  write(*,'(5F5.1)') arr3

by

  write(*,'(10F5.1)') arr3

etc.

[Bug fortran/93423] [8/9/10/11 Regression] ICE on invalid with argument list for module procedure

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93423

--- Comment #8 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:ce2c9b341df267ce2ab86815ba957bce9935f7bb

commit r10-8774-gce2c9b341df267ce2ab86815ba957bce9935f7bb
Author: Harald Anlauf 
Date:   Thu Jul 2 20:48:16 2020 +0200

PR fortran/93423 - ICE on invalid with argument list for module procedure

When recovering from an error, a NULL pointer dereference could occur.
Check for that situation and punt.

gcc/fortran/
PR fortran/93423
* resolve.c (resolve_symbol): Avoid NULL pointer dereference.

(cherry picked from commit b88744905a46be44ffa3c57d46080f601ae832b8)

[Bug fortran/93423] [8/9/10/11 Regression] ICE on invalid with argument list for module procedure

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93423

--- Comment #9 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:13421890f81844acb134a460eda7132db3e504ed

commit r10-8775-g13421890f81844acb134a460eda7132db3e504ed
Author: Tobias Burnus 
Date:   Thu Sep 17 14:01:09 2020 +0200

Fortran: Avoid double-free with parse error (PR96041, PR93423)

gcc/fortran/

PR fortran/96041
PR fortran/93423
* decl.c (gfc_match_submod_proc): Avoid later double-free
in the error case.

(cherry picked from commit c12facd22881517127ebbe213d7ecc7fc1fcea4e)

[Bug fortran/96041] [11 regression] ICE in gfortran.dg/pr93423.f90 after r11-1792

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96041

--- Comment #12 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:13421890f81844acb134a460eda7132db3e504ed

commit r10-8775-g13421890f81844acb134a460eda7132db3e504ed
Author: Tobias Burnus 
Date:   Thu Sep 17 14:01:09 2020 +0200

Fortran: Avoid double-free with parse error (PR96041, PR93423)

gcc/fortran/

PR fortran/96041
PR fortran/93423
* decl.c (gfc_match_submod_proc): Avoid later double-free
in the error case.

(cherry picked from commit c12facd22881517127ebbe213d7ecc7fc1fcea4e)

[Bug other/97117] [11 regression] location-overflow-test-1.c FAILs after r11-3266

2020-09-18 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97117

Patrick Palka  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
   Last reconfirmed||2020-09-18
 Ever confirmed|0   |1

--- Comment #1 from Patrick Palka  ---
Thanks, I somehow missed this failure during testing...

[Bug bootstrap/97118] [11 Regression] r11-3274 breaks bootstrap

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97118

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:e1a1808cd19afd93fc4134fbd8376346d05bdba8

commit r11-3289-ge1a1808cd19afd93fc4134fbd8376346d05bdba8
Author: Jason Merrill 
Date:   Fri Sep 18 15:34:24 2020 -0400

c++: Fix bootstrap failure.  [PR97118]

gcc/cp/ChangeLog:

PR bootstrap/97118
* decl.c (complete_vars): Only call layout_var_decl if completing
the type succeeded.

[Bug c++/96531] [10/11 Regression] ICE for concepts here.

2020-09-18 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96531

Patrick Palka  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

[Bug c++/97103] [10/11 Regression] ICE on nested requires expression template template instantiation

2020-09-18 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97103

Patrick Palka  changed:

   What|Removed |Added

   Target Milestone|--- |10.3
  Known to fail||10.1.0, 10.2.0, 11.0
  Known to work||9.3.0
Summary|ICE on nested requires  |[10/11 Regression] ICE on
   |expression template |nested requires expression
   |template instantiation  |template template
   ||instantiation

--- Comment #3 from Patrick Palka  ---
Started with r10-8077.

[Bug bootstrap/97118] [11 Regression] r11-3274 breaks bootstrap

2020-09-18 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97118

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Dominique d'Humieres  ---
Dup.

*** This bug has been marked as a duplicate of bug 97105 ***

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||hjl.tools at gmail dot com

--- Comment #2 from Dominique d'Humieres  ---
*** Bug 97118 has been marked as a duplicate of this bug. ***

[Bug bootstrap/97118] New: [11 Regression] r11-3274 breaks bootstrap

2020-09-18 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97118

Bug ID: 97118
   Summary: [11 Regression] r11-3274 breaks bootstrap
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hjl.tools at gmail dot com
CC: jason at redhat dot com
  Target Milestone: ---

On Linux/x86:

commit f627125855075f7ffde74e48481ee961f0bc4c7b
Author: Jason Merrill 
Date:   Fri Sep 4 12:14:19 2020 -0400

c++: Layout decls with newly-complete type.

Martin's -Wplacement-new patch ran into a problem with DECL_SIZE not being
set on an extern variable for which the type was not complete until after
its declaration.  complete_vars was deliberately not calling layout_decl
for
some reason, instead leaving that for expand_expr_real_1 much later in the
compilation.  But if we layout decls at declaration time, I don't see any
reason we shouldn't lay them out here, when their type is newly complete.

gcc/cp/ChangeLog:

* decl.c (complete_vars): Call layout_var_decl.

cause:

../../src-master/gcc/coretypes.h: In instantiation of ??struct
kv_pair??:
../../src-master/gcc/dumpfile.c:169:50:   required from here
../../src-master/gcc/dumpfile.c:169:33: error: storage size of
??optgroup_options?? isn??t known
  169 | const kv_pair optgroup_options[] =
  | ^~~~
../../src-master/gcc/dumpfile.c: In function ??void dump_loc(dump_flags_t,
pretty_printer*, location_t)??:
../../src-master/gcc/dumpfile.c:498:34: warning: spurious trailing space in
format [-Wformat-diag]
  498 | pp_printf (pp, "%s:%d:%d: ", LOCATION_FILE (loc),
  |  ^
../../src-master/gcc/dumpfile.c:501:34: warning: spurious trailing space in
format [-Wformat-diag]
  501 | pp_printf (pp, "%s:%d:%d: ",
  |  ^
../../src-master/gcc/dumpfile.c:505:26: warning: spurious trailing space in
format [-Wformat-diag]
  505 |   pp_printf (pp, "%s: ", kind_as_string (dump_kind));
  |  ^
../../src-master/gcc/dumpfile.c: In member function ??void
dump_context::begin_scope(const char*, const dump_user_location_t&, const
dump_impl_location_t&)??:
../../src-master/gcc/dumpfile.c:1122:20: warning: spurious leading punctuation
sequence ??===?? in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);
  |^~~
../../src-master/gcc/dumpfile.c:1122:27: warning: unquoted sequence of 3
consecutive punctuation characters ??===?? in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);

[Bug middle-end/97054] [10/11 Regression] Runtime segfault with attached test code since r10-3559

2020-09-18 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97054

--- Comment #3 from H.J. Lu  ---
Fixed in GCC 11 by

commit 3c7c5f1d4a4b8328fb4c07483cdbfe4ea7762155
Author: Richard Sandiford 
Date:   Fri Sep 18 16:55:45 2020 +0100

ira: Fix elimination for global hard FPs [PR91957]

[Bug other/97117] New: [11 regression] location-overflow-test-1.c FAILs after r11-3266

2020-09-18 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97117

Bug ID: 97117
   Summary: [11 regression] location-overflow-test-1.c FAILs after
r11-3266
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:4839de55e2c98619f4919254abb87e2f393aaead, r11-3266

commit 4839de55e2c98619f4919254abb87e2f393aaead (HEAD)
Author: Patrick Palka 
Date:   Thu Sep 17 14:27:22 2020 -0400

c-family: Macro support in -Wmisleading-indentation [PR80076]


FAIL: gcc.dg/plugin/location-overflow-test-1.c
-fplugin=./location_overflow_plugin.so adding '-flarge-source-files' (test for
warnings, line 16)

Executing on host: /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c
   -fdiagnostics-plain-output  -fplugin=./location_overflow_plugin.so
-Wmisleading-indentation -Wall
-fplugin-arg-location_overflow_plugin-value=0x6001 -S -o
location-overflow-test-1.s(timeout = 300)
spawn -ignore SIGHUP /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c
-fdiagnostics-plain-output -fplugin=./location_overflow_plugin.so
-Wmisleading-indentation -Wall
-fplugin-arg-location_overflow_plugin-value=0x6001 -S -o
location-overflow-test-1.s^M
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/location-overflow-test-1.c:8:
error: unknown type name 'unknown_type'^M
compiler exited with status 1
PASS: gcc.dg/plugin/location-overflow-test-1.c
-fplugin=./location_overflow_plugin.so  (test for errors, line 8)
FAIL: gcc.dg/plugin/location-overflow-test-1.c
-fplugin=./location_overflow_plugin.so adding '-flarge-source-files' (test for
warnings, line 16)
PASS: gcc.dg/plugin/location-overflow-test-1.c
-fplugin=./location_overflow_plugin.so  (test for bogus messages, line 26)
PASS: gcc.dg/plugin/location-overflow-test-1.c
-fplugin=./location_overflow_plugin.so (test for excess errors)

[Bug bootstrap/96378] ICE: Solaris/SPARCv9 bootstrap stage2 segfault compiling stdc++.h.gch/O2ggnu++0x.gch

2020-09-18 Thread nicholas.h.briggs at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96378

--- Comment #2 from Nick Briggs  ---
The initial gcc is:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/7/lib/gcc/sparcv9-solaris2.11/7.3.0/lto-wrapper
Target: sparcv9-solaris2.11
Configured with:
/builds/ulhg/workspace/Solaris_11u4/Userland/full-build/02b-build-sparc/components/gcc7/gcc-7.3.0/configure
--prefix=/usr/gcc/7 --mandir=/usr/gcc/7/share/man --bindir=/usr/gcc/7/bin
--sbindir=/usr/gcc/7/sbin --libdir=/usr/gcc/7/lib
--infodir=/usr/gcc/7/share/info --libexecdir=/usr/gcc/7/lib
--enable-languages=c,c++,fortran,objc --enable-shared --enable-initfini-array
--disable-rpath --with-system-zlib --with-build-config=no
--with-gmp-include=/usr/include --with-mpfr-include=/usr/include
--without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/gnu/bin/as
--disable-bootstrap 'BOOT_CFLAGS=-g -O2' sparcv9-solaris2.11
Thread model: posix
gcc version 7.3.0 (GCC)

[Bug analyzer/93293] 'FAIL: gcc.dg/analyzer/dot-output.c dg-check-dot dot-output.c.state-purge.dot'

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93293

David Malcolm  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from David Malcolm  ---
Thanks.  The consensus on the mailing list re my patch seemed to be that people
should just update graphviz, rather than trying to detect this.  I'm going to
close this out then.

[Bug analyzer/97114] Support for vfuncs in -fanalyzer

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97114

--- Comment #1 from David Malcolm  ---
There may also be some precision-of-wording issues here, when describing the
chain of events in a diagnostic path.

[Bug analyzer/97116] New: Fix argument numbering in C++ member function calls

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97116

Bug ID: 97116
   Summary: Fix argument numbering in C++ member function calls
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dmalcolm at gcc dot gnu.org
Blocks: 97110
  Target Milestone: ---

IIRC -fanalyzer currently misreports parameter numbers in calls when there's an
implicit "this" pointer (e.g. when passing NULL as "this" due to a buggy
allocator to a ctor call it reports "parameter 1", rather than "this").

We might need a langhook for this (but what about LTO, and e.g. mixed-language
analysis?)

(Filing this as part of the -fanalyzer C++ tracker bug)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110
[Bug 97110] [meta-bug] tracker bug for supporting C++ in -fanalyzer

[Bug target/97107] libgo fails to build for power10

2020-09-18 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97107

--- Comment #1 from Alan Modra  ---
Created attachment 49241
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49241=edit
fix under test

[Bug analyzer/97115] New: Support for pre-main ctors in -fanalyzer

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97115

Bug ID: 97115
   Summary: Support for pre-main ctors in -fanalyzer
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dmalcolm at gcc dot gnu.org
Blocks: 97110
  Target Milestone: ---

-fanalyzer doesn't yet have special handling for pre-main constructors; they
show up in the supergraph, but IIRC the code makes assumptions that main is the
first thing that is run, which should be investigated if we're going to
properly support C++.

Also, would be nice to statically detect issues due to ordering in such ctors.

(Filing this as part of the -fanalyzer C++ tracker bug)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110
[Bug 97110] [meta-bug] tracker bug for supporting C++ in -fanalyzer

[Bug analyzer/97114] New: Support for vfuncs in -fanalyzer

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97114

Bug ID: 97114
   Summary: Support for vfuncs in -fanalyzer
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dmalcolm at gcc dot gnu.org
Blocks: 97110
  Target Milestone: ---

(Similar to PR analyzer/97113 which covers RTTI in general)

-fanalyzer doesn't yet "know about" virtual functions; it probably ought to be
able to devirtualization calls, or speculate about likely calls.

Probably need to reuse/refactor logic in ipa-devirt.c for this.

(Filing this as part of the -fanalyzer C++ tracker bug)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110
[Bug 97110] [meta-bug] tracker bug for supporting C++ in -fanalyzer

[Bug analyzer/97113] New: Support for RTTI within -fanalyzer

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97113

Bug ID: 97113
   Summary: Support for RTTI within -fanalyzer
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dmalcolm at gcc dot gnu.org
Blocks: 97110
  Target Milestone: ---

-fanalyzer doesn't yet "know about" RTTI objects, dynamic_cast, or inheritance.

Probably need to reuse/refactor logic in ipa-devirt.c for this.

(Filing this as part of the -fanalyzer C++ tracker bug)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110
[Bug 97110] [meta-bug] tracker bug for supporting C++ in -fanalyzer

[Bug c++/97112] New: class-deduction-alias1.C ICEs with -std=c++17

2020-09-18 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97112

Bug ID: 97112
   Summary: class-deduction-alias1.C ICEs with -std=c++17
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

$ ./cc1plus -quiet class-deduction-alias1.C
class-deduction-alias1.C:6:20: error: ‘concept’ does not name a type
6 | template  concept Int = __is_same_as (T, int);
  |^~~
class-deduction-alias1.C:6:20: note: ‘concept’ only available with ‘-std=c++20’
or ‘-fconcepts’
class-deduction-alias1.C:17:10: error: ‘Int’ has not been declared
   17 | template
  |  ^~~
class-deduction-alias1.C:18:13: error: ‘W’ was not declared in this scope
   18 | using B = A;
  | ^
class-deduction-alias1.C:18:14: error: template argument 1 is invalid
   18 | using B = A;
  |  ^
class-deduction-alias1.C:22:12: warning: alias template deduction only
available with ‘-std=c++20’ or ‘-std=gnu++20’
   22 | A a1(, ); // { dg-bogus "" "Deduces A" }
  |^
class-deduction-alias1.C:22:12: internal compiler error: in set_constraints, at
cp/constraint.cc:1192
0xa02c24 set_constraints(tree_node*, tree_node*)
/home/mpolacek/src/gcc/gcc/cp/constraint.cc:1192
0xc740c9 alias_ctad_tweaks
/home/mpolacek/src/gcc/gcc/cp/pt.c:28750
0xc74894 deduction_guides_for
/home/mpolacek/src/gcc/gcc/cp/pt.c:28861
0xc75131 do_class_deduction
/home/mpolacek/src/gcc/gcc/cp/pt.c:28966
0xc75d79 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
/home/mpolacek/src/gcc/gcc/cp/pt.c:29095
0xa7f688 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
/home/mpolacek/src/gcc/gcc/cp/decl.c:7576
0xba60a3 cp_parser_init_declarator
/home/mpolacek/src/gcc/gcc/cp/parser.c:21018
0xb98966 cp_parser_simple_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:13818
0xb98508 cp_parser_block_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:13644
0xb981f6 cp_parser_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:13517
0xb982e6 cp_parser_toplevel_declaration
/home/mpolacek/src/gcc/gcc/cp/parser.c:13546
0xb84e59 cp_parser_translation_unit
/home/mpolacek/src/gcc/gcc/cp/parser.c:4793
0xbe42d2 c_parse_file()
/home/mpolacek/src/gcc/gcc/cp/parser.c:44090
0xdb3881 c_common_parse_file()
/home/mpolacek/src/gcc/gcc/c-family/c-opts.c:1188

[Bug analyzer/97111] New: Support for exception-handling within -fanalyzer

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97111

Bug ID: 97111
   Summary: Support for exception-handling within -fanalyzer
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dmalcolm at gcc dot gnu.org
Blocks: 97110
  Target Milestone: ---

-fanalyzer does not yet understand exception-handling, and, in particular, C++
exception-handling.

(Filing this as part of the -fanalyzer C++ tracker bug)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110
[Bug 97110] [meta-bug] tracker bug for supporting C++ in -fanalyzer

[Bug analyzer/97110] New: [meta-bug] analyzer tracker bug for C++ support

2020-09-18 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97110

Bug ID: 97110
   Summary: [meta-bug] analyzer tracker bug for C++ support
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: meta-bug
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

-fanalyzer doesn't properly support C++ yet, and there are lot of things that
would need fixing for that to occur.

I'm opening this as a tracker bug, to try to break the work down into
manageable chunks and improve visibility.

[Bug target/96789] x264: sub4x4_dct() improves when vectorization is disabled

2020-09-18 Thread linkw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96789

--- Comment #15 from Kewen Lin  ---
(In reply to rguent...@suse.de from comment #14)
> On Fri, 18 Sep 2020, linkw at gcc dot gnu.org wrote:
> 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96789
> > 
> > --- Comment #13 from Kewen Lin  ---
> > >   2) on Power, the conversion from unsigned char to unsigned short is nop
> > > conversion, when we counting scalar cost, it's counted, then add costs 32
> > > totally onto scalar cost. Meanwhile, the conversion from unsigned short to
> > > signed short should be counted but it's not (need to check why further). 
> > 
> > UH to SH conversion is true when calling vect_nop_conversion_p, so it's not
> > even put into the cost vector. 
> > 
> > tree_nop_conversion_p's comments saying:
> > 
> > /* Return true iff conversion from INNER_TYPE to OUTER_TYPE generates
> >no instruction.  */
> > 
> > I may miss something here, but UH to SH conversion does need one explicit
> > extend instruction *extsh*, the precision/mode equality check looks wrong 
> > for
> > this conversion.
> 
> Well, it isn't a RTL predicate and it only needs extension because
> there's never a HImode pseudo but always SImode subregs.

Thanks Richi! Should we take care of this case? or neglect this kind of
extension as "no instruction"? I was intent to handle it in target specific
code, but it isn't recorded into cost vector while it seems too heavy to do the
bb_info slp_instances revisits in finish_cost.

[Bug tree-optimization/97081] [8/9/10 Regression] wrong code for rotate vectorization (x86 target)

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97081

--- Comment #8 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:3d3fe967b0961cb59f5df03ae2a55d83dc4bbd34

commit r11-3283-g3d3fe967b0961cb59f5df03ae2a55d83dc4bbd34
Author: Jakub Jelinek 
Date:   Fri Sep 18 15:05:53 2020 +0200

testsuite: add another test for the rotate vectorization miscompilation

This time with short and char where the used mask used to be larger
than it should have been.

2020-09-18  Jakub Jelinek  

PR tree-optimization/97081
* gcc.dg/vect/pr97081-2.c: New test.

[Bug c++/97103] ICE on nested requires expression template template instantiation

2020-09-18 Thread ppalka at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97103

Patrick Palka  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
   Last reconfirmed||2020-09-18
 CC||ppalka at gcc dot gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #2 from Patrick Palka  ---
Confirmed.

[Bug middle-end/97073] [8/9/10/11 Regression] Miscompilation with -m32 -O1 -march=i686

2020-09-18 Thread sirl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97073

--- Comment #8 from Franz Sirl  ---
(In reply to Jakub Jelinek from comment #4)
> Created attachment 49236 [details]
> gcc11-pr97073.patch
> 
> Untested fix.

I can confirm that this patch applied to the gcc-8 branch fixes the testcase
and the original problem in the affected application.

[Bug tree-optimization/97081] [8/9/10 Regression] wrong code for rotate vectorization (x86 target)

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97081

Richard Biener  changed:

   What|Removed |Added

Summary|[8/9/10/11 Regression]  |[8/9/10 Regression] wrong
   |wrong code for rotate   |code for rotate
   |vectorization (x86 target)  |vectorization (x86 target)
   Keywords|needs-bisection |
  Known to work||11.0

--- Comment #7 from Richard Biener  ---
Fixed on trunk sofar.

[Bug tree-optimization/97081] [8/9/10/11 Regression] wrong code for rotate vectorization (x86 target)

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97081

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:9c9b88fdcff3520b2c4fb520c5d3b422eaa9a72f

commit r11-3282-g9c9b88fdcff3520b2c4fb520c5d3b422eaa9a72f
Author: Richard Biener 
Date:   Fri Sep 18 13:36:24 2020 +0200

tree-optimization/97081 - fix wrong-code with vectorized shift

This corrects the mask for creation of x << s | x >> (-x & mask)
from a rotate x <

PR tree-optimization/97081
* tree-vect-patterns.c (vect_recog_rotate_pattern): Use the
precision of the shifted operand to determine the mask.

* gcc.dg/vect/pr97081.c: New testcase.

[Bug tree-optimization/97089] [11 regression] execution FAILs for gfortran.dg/array_constructor_11.f90 after r11-3258

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97089

Richard Biener  changed:

   What|Removed |Added

 CC||clyon at gcc dot gnu.org

--- Comment #4 from Richard Biener  ---
*** Bug 97109 has been marked as a duplicate of this bug. ***

[Bug fortran/97109] [11 regression] gfortran.dg/array_constructor_11.f90 fails since r11-3258 (g:c7f4be78cb61006492d16375aba5392f580cd633)

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97109

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Richard Biener  ---
dup

*** This bug has been marked as a duplicate of bug 97089 ***

[Bug fortran/97109] New: [11 regression] gfortran.dg/array_constructor_11.f90 fails since r11-3258 (g:c7f4be78cb61006492d16375aba5392f580cd633)

2020-09-18 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97109

Bug ID: 97109
   Summary: [11 regression] gfortran.dg/array_constructor_11.f90
fails since r11-3258
(g:c7f4be78cb61006492d16375aba5392f580cd633)
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---

Since r11-3258 g:c7f4be78cb61006492d16375aba5392f580cd633, I've noticed:
FAIL: gfortran.dg/array_constructor_11.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/array_constructor_11.f90   -O3 -g  execution test

on arm and aarch64.

The problem also occurs on x86_64 according to
https://gcc.gnu.org/pipermail/gcc-patches/2020-September/554209.html

[Bug tree-optimization/97108] New: Wmaybe-uninitialized false positive

2020-09-18 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97108

Bug ID: 97108
   Summary: Wmaybe-uninitialized false positive
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: clyon at gcc dot gnu.org
  Target Milestone: ---

This testcase causes a false positive 'may be used uninitialized' warning when
compiled with -O2 -Wall. It is derived from libiberty/pex-win32.c
=
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2

int _close(int);

int
pex_win32_exec_child (int flags,
  int in, int out, int errdes)
{
  int pid = flags;
  int orig_err;
  int separate_stderr = !(flags);

  if (separate_stderr)
{
  orig_err = errdes;
}

  if (pid != (int) -1)
{
  if (in != STDIN_FILENO)
_close (in);
  if (out != STDOUT_FILENO)
_close (out);
  if (separate_stderr
  && orig_err != STDERR_FILENO)
_close (orig_err);
}

  return pid;
}
=

../pex-win32.c: In function ‘pex_win32_exec_child’:
../pex-win32.c:27:23: warning: ‘orig_err’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
   27 |   && orig_err != STDERR_FILENO)
  |   ^

[Bug target/97107] libgo fails to build for power10

2020-09-18 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97107

Alan Modra  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |amodra at gmail dot com
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-09-18

[Bug target/97107] New: libgo fails to build for power10

2020-09-18 Thread amodra at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97107

Bug ID: 97107
   Summary: libgo fails to build for power10
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: amodra at gmail dot com
  Target Milestone: ---

ld.gold: error: runtime/.libs/go-cdiv.o: failed to match split-stack sequence
at section 1 offset 0
ld.gold: error: runtime/.libs/go-cdiv.o: failed to match split-stack sequence
at section 1 offset 70
ld.gold: error: runtime/.libs/runtime_c.o: failed to match split-stack sequence
at section 1 offset 310
ld.gold: error: reflect/.libs/makefunc_ffi_c.o: failed to match split-stack
sequence at section 1 offset 1a0

Recently added rs6000 backend code allows sibcalls when pcrel.  In the
go-cdiv.o cases we have tail calls to __divsc3 and __divdc3 both of which are
non-split-stack functions.  The functions making those calls don't have a stack
frame, and therefore don't have the magic split-stack instruction sequence that
gold patches to allocate a larger stack.  Now those __div libgcc functions
don't have large stack frames that might blow the very limited stack provided,
but in general you can't tail call non-split-stack functions from split-stack
code.

It isn't actually the sibcall that is the problem, but that
rs6000_expand_split_stack_prologue didn't emit the magic code gold patches and
a __morestack call.  ie. a sibcall to non-split-stack code from split-stack is
fine if there is sufficient stack memory mapped.  __morestack is quite a
surprising function on powerpc in that it calls back to its caller - and a tail
call will continue running in the context of extra stack mapped until it
returns.

[Bug target/97106] [nvptx] Issues with weak aliases introduced by C++

2020-09-18 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97106

--- Comment #1 from Tobias Burnus  ---
Suggested fix:

14:11 < amonakov> Tobias__: I think the proper way to solve this is define
hooks for the backend to print something for aliases, and then have nvptx-ld.c
resolve them
14:12 < amonakov> (right now the backend prints nothing without crashing, which
is pretty bad: unhandled stuff should at least emit a diagnostic)

That would be an alternative to CUDA 10's/ISA 6.3's  .alias

[Bug target/97106] New: [nvptx] Issues with weak aliases introduced by C++

2020-09-18 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97106

Bug ID: 97106
   Summary: [nvptx] Issues with weak aliases introduced by C++
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: openmp
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: burnus at gcc dot gnu.org
CC: vries at gcc dot gnu.org
Depends on: 97102
  Target Milestone: ---

Created attachment 49240
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49240=edit
C++ test case  - note: matches mostly uncommitted
testsuite/libgomp.c++/pr96390.C  of PR96390

Related PR 97102: nvptx + aliases
Related PR 96390: alias-related: automatically mark functions called in omp
target as declare target (that's where the initial testcase came from)


For the attached testcase, GCC calls the "complete object constructor" C1:
  _ZN1VILi1EEC1ImvEET_
but generates the function definition for "base object constructor" C2:
  _ZN1VILi1EEC2ImvEET_

And it generates a weak alias between the two.

Using .alias should work – the aliasee should not be weak but I believe in our
case only the alias itself is weak. – Hence, it should work.

Caveat: .alias is ISA version 6.3 = CUDA 10.0, cf. PR 97102.

I wonder whether this could be solved at LTO time – after all, except for
linked libraries (libgomp, libm) it should be know.

Caveat: currently, no real LTO is done on the offloading side.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97102
[Bug 97102] [nvptx] PTX JIT compilation failed when using aliases

[Bug tree-optimization/97104] [11 Regression] aarch64, SVE: ICE in vect_get_loop_mask since r11-3070-g783dc66f9cc

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97104

--- Comment #1 from Richard Biener  ---
possibly latent if you turn the live operation into one stored to a loop
variant  and vectorized location - the loop wasn't vectorized before the cited
rev.

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||jason at gcc dot gnu.org
   Target Milestone|--- |11.0
   Keywords||build
   Last reconfirmed||2020-09-18
 Status|UNCONFIRMED |NEW

--- Comment #1 from Richard Biener  ---
Confirmed, caused by g:f627125855075f7ffde74e48481ee961f0bc4c7b

[Bug bootstrap/97105] [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug c++/97094] Compiling big std::unordered_map became slower

2020-09-18 Thread a.morozov at drweb dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97094

--- Comment #2 from Alexander Morozov  ---
$ g++-9.3.0 -v -std=c++17
Using built-in specs.
COLLECT_GCC=g++-9.3.0
COLLECT_LTO_WRAPPER=/srv/projects/gcc/gcc-9.3.0-build/libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --enable-languages=c,c++
--prefix=/srv/projects/gcc/gcc-9.3.0-build
Thread model: posix
gcc version 9.3.0 (GCC)
$ g++-10.2.0 -v -std=c++17
Using built-in specs.
COLLECT_GCC=g++-10.2.0
COLLECT_LTO_WRAPPER=/srv/projects/gcc/gcc-10.2.0-build/libexec/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --enable-languages=c,c++
--prefix=/srv/projects/gcc/gcc-10.2.0-build
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC)

Also tried 11.0.0 20200913. The result does not look better:
$ time -p g++-9.3.0 -std=c++17 -c str_map.cc
real 6,64
user 6,06
sys 0,22
$ time -p g++-11 -std=c++17 -c str_map.cc
real 68,83
user 62,11
sys 2,76

$ g++-11 -v -std=c++17
Using built-in specs.
COLLECT_GCC=g++-11
COLLECT_LTO_WRAPPER=/srv/projects/gcc/gcc-11-20200913-build/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --enable-languages=c,c++
--prefix=/srv/projects/gcc/gcc-11-20200913-build
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200913 (experimental) (GCC)

[Bug tree-optimization/97081] [8/9/10/11 Regression] wrong code for rotate vectorization (x86 target)

2020-09-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97081

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
Started with my r10-5358-gf5c03155aa77bdb065fed3c5a0031db45a850493 PR92723 fix,
which indeed has been backported to 9 and 8.

[Bug tree-optimization/97081] [8/9/10/11 Regression] wrong code for rotate vectorization (x86 target)

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97081

Richard Biener  changed:

   What|Removed |Added

  Known to fail||10.1.0, 8.4.0, 9.3.0
   Priority|P3  |P2
  Known to work||7.5.0, 8.3.0, 9.2.0
   Target Milestone|--- |8.5
Summary|wrong code for rotate   |[8/9/10/11 Regression]
   |vectorization (x86 target)  |wrong code for rotate
   ||vectorization (x86 target)

--- Comment #4 from Richard Biener  ---
Interestingly GCC 7 created the correct

 patt_18 = patt_19 & 63;

but something broke it during GCC 10 development and was even backported.

[Bug bootstrap/97105] New: [11 regression] dumpfile.c:169:33: error: storage size of 'optgroup_options' isn't known

2020-09-18 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97105

Bug ID: 97105
   Summary: [11 regression] dumpfile.c:169:33: error: storage size
of 'optgroup_options' isn't known
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dimhen at gmail dot com
  Target Milestone: ---

r11-3264 PASS
r11-3279 FAIL

$ configure --enable-checking=release --enable-languages=c,c++,lto
--disable-multilib --enable-shared
$ make -j5
[...]

make[3]: Entering directory '/home/dimhen/build/gcc_current/gcc'
/home/dimhen/build/gcc_current/./prev-gcc/xg++
-B/home/dimhen/build/gcc_current/./prev-gcc/
-B/home/dimhen/arch-gcc/gcc_current/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
 -I/home/dimhen/src/gcc_current/libstdc++-v3/libsupc++
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
 -fno-PIE -c   -g -O2 -fno-checking -gtoggle -DIN_GCC -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -Werror   -DHAVE_CONFIG_H -I. -I.
-I/home/dimhen/src/gcc_current/gcc -I/home/dimhen/src/gcc_current/gcc/.
-I/home/dimhen/src/gcc_current/gcc/../include
-I/home/dimhen/src/gcc_current/gcc/../libcpp/include
-I/home/dimhen/build/gcc_current/./gmp -I/home/dimhen/src/gcc_current/gmp
-I/home/dimhen/build/gcc_current/./mpfr/src
-I/home/dimhen/src/gcc_current/mpfr/src -I/home/dimhen/src/gcc_current/mpc/src 
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libdecnumber/bid -I../libdecnumber
-I/home/dimhen/src/gcc_current/gcc/../libbacktrace
-I/home/dimhen/build/gcc_current/./isl/include
-I/home/dimhen/src/gcc_current/isl/include  -o dumpfile.o -MT dumpfile.o -MMD
-MP -MF ./.deps/dumpfile.TPo /home/dimhen/src/gcc_current/gcc/dumpfile.c
/home/dimhen/src/gcc_current/gcc/coretypes.h: In instantiation of 'struct
kv_pair':
/home/dimhen/src/gcc_current/gcc/dumpfile.c:169:50:   required from here
/home/dimhen/src/gcc_current/gcc/dumpfile.c:169:33: error: storage size of
'optgroup_options' isn't known
  169 | const kv_pair optgroup_options[] =
  | ^~~~
/home/dimhen/src/gcc_current/gcc/dumpfile.c: In function 'void
dump_loc(dump_flags_t, pretty_printer*, location_t)':
/home/dimhen/src/gcc_current/gcc/dumpfile.c:498:34: warning: spurious trailing
space in format [-Wformat-diag]
  498 | pp_printf (pp, "%s:%d:%d: ", LOCATION_FILE (loc),
  |  ^
/home/dimhen/src/gcc_current/gcc/dumpfile.c:501:34: warning: spurious trailing
space in format [-Wformat-diag]
  501 | pp_printf (pp, "%s:%d:%d: ",
  |  ^
/home/dimhen/src/gcc_current/gcc/dumpfile.c:505:26: warning: spurious trailing
space in format [-Wformat-diag]
  505 |   pp_printf (pp, "%s: ", kind_as_string (dump_kind));
  |  ^
/home/dimhen/src/gcc_current/gcc/dumpfile.c: In member function 'void
dump_context::begin_scope(const char*, const dump_user_location_t&, const
dump_impl_location_t&)':
/home/dimhen/src/gcc_current/gcc/dumpfile.c:1122:20: warning: spurious leading
punctuation sequence '===' in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);
  |^~~
/home/dimhen/src/gcc_current/gcc/dumpfile.c:1122:27: warning: unquoted sequence
of 3 consecutive punctuation characters '===' in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);
  |   ^~~
/home/dimhen/src/gcc_current/gcc/dumpfile.c:1122:30: warning: unquoted
whitespace character '\x0a' in format [-Wformat-diag]
 1122 |   pp_printf (, "=== %s ===\n", name);
  |  ^~
make[3]: *** [Makefile:1123: dumpfile.o] Error 1
make[3]: Leaving directory '/home/dimhen/build/gcc_current/gcc'
make[2]: *** [Makefile:4793: all-stage2-gcc] Error 2
make[2]: Leaving directory '/home/dimhen/build/gcc_current'
make[1]: *** [Makefile:27160: stage2-bubble] Error 2
make[1]: Leaving directory '/home/dimhen/build/gcc_current'

[Bug tree-optimization/97081] wrong code for rotate vectorization (x86 target)

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97081

Richard Biener  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #3 from Richard Biener  ---
The following aborts with vectorization enabled:

#define EXEC_ROR2(a, b, sz) (a >> b) | (a << (64 - b))
#define TYPE unsigned long

void __attribute__((noipa))
exec_VRORudi_i(TYPE *__restrict__ pvd,
   TYPE *__restrict__ const pva, unsigned char IMM)
{
  unsigned char I2 = IMM & 63;

  for (unsigned i = 0; i < 4; i++)
pvd[i] = EXEC_ROR2(pva[i], I2, 8);
}

int main()
{
  TYPE pvd[4], pva[4] = { 0x0102030405060708, 0x0102030405060708,
0x0102030405060708, 0x0102030405060708 };
  exec_VRORudi_i (pvd, pva, 7);
  if (pvd[0] != 0x10020406080a0c0e)
__builtin_abort ();
  return 0;
}


creates

  patt_9 = -_25;
  patt_8 = patt_9 & 31;
  vect_patt_27.7_28 = vect__4.6_5 >> _25;
  vect_patt_22.8_29 = vect__4.6_5 << patt_8;
  vect_patt_23.9_30 = vect_patt_27.7_28 | vect_patt_22.8_29;
  _7 = _4 r>> _25;


I have a patch.

[Bug tree-optimization/97104] [11 Regression] aarch64, SVE: ICE in vect_get_loop_mask since r11-3070-g783dc66f9cc

2020-09-18 Thread acoplan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97104

Alex Coplan  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Target||aarch64
   Target Milestone|--- |11.0
  Known to fail||11.0

[Bug tree-optimization/97104] New: [11 Regression] aarch64, SVE: ICE in vect_get_loop_mask since r11-3070-g783dc66f9cc

2020-09-18 Thread acoplan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97104

Bug ID: 97104
   Summary: [11 Regression] aarch64, SVE: ICE in
vect_get_loop_mask since r11-3070-g783dc66f9cc
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

For the following testcase:

int a, b, c, d;
short e;
void f() {
  unsigned g;
  for (; d; d++) {
g = c == 0 ? 1 : b / c;
e = a ? g : a;
  }
}

AArch64 GCC ICEs at -O1 or -O2 with -ftree-vectorize -march=armv8.2-a+sve since
r11-3070-g783dc66f9ccb0019c3dad2701bb9110286758d70:

commit 783dc66f9ccb0019c3dad2701bb9110286758d70 (HEAD)
Author: Richard Biener 
Date:   Wed Sep 9 09:36:46 2020

enable live condition vectorization

To reproduce:

$ aarch64-none-elf-gcc -O2 -ftree-vectorize -march=armv8.2-a+sve test.c
during GIMPLE pass: vect
test.c: In function 'f':
test.c:3:6: internal compiler error: in operator[], at vec.h:880
3 | void f() {
  |  ^
0x10637d9 vec::operator[](unsigned int)
/home/alecop01/toolchain/src/gcc/gcc/vec.h:880
0x10637d9 vec::operator[](unsigned int)
/home/alecop01/toolchain/src/gcc/gcc/vec.h:1451
0x10637d9 vect_get_loop_mask(gimple_stmt_iterator*, auto_vec*, unsigned int, tree_node*, unsigned int)
/home/alecop01/toolchain/src/gcc/gcc/tree-vect-loop.c:8487
0x1044e00 vectorizable_condition
/home/alecop01/toolchain/src/gcc/gcc/tree-vect-stmts.c:10216
0x105a73e vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
/home/alecop01/toolchain/src/gcc/gcc/tree-vect-stmts.c:10859
0x1061099 vect_transform_loop_stmt
/home/alecop01/toolchain/src/gcc/gcc/tree-vect-loop.c:8700
0x107db5d vect_transform_loop(_loop_vec_info*, gimple*)
/home/alecop01/toolchain/src/gcc/gcc/tree-vect-loop.c:9134
0x10a3c34 try_vectorize_loop_1
/home/alecop01/toolchain/src/gcc/gcc/tree-vectorizer.c:1094
0x10a43b6 try_vectorize_loop
/home/alecop01/toolchain/src/gcc/gcc/tree-vectorizer.c:1151
0x10a46f0 vectorize_loops()
/home/alecop01/toolchain/src/gcc/gcc/tree-vectorizer.c:1230
0xf392f7 execute
/home/alecop01/toolchain/src/gcc/gcc/tree-ssa-loop.c:414
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/97102] [nvptx] PTX JIT compilation failed when using aliases

2020-09-18 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97102

--- Comment #3 from Tobias Burnus  ---
(In reply to Tobias Burnus from comment #2)
> PTX ISA Notes
> .alias directive introduced in PTX ISA 6.3.

Which is CUDA 10.0, cf.
https://docs.nvidia.com/cuda/archive/10.0/cuda-toolkit-release-notes/index.html#cuda-general-new-features

[Bug target/96789] x264: sub4x4_dct() improves when vectorization is disabled

2020-09-18 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96789

--- Comment #14 from rguenther at suse dot de  ---
On Fri, 18 Sep 2020, linkw at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96789
> 
> --- Comment #13 from Kewen Lin  ---
> >   2) on Power, the conversion from unsigned char to unsigned short is nop
> > conversion, when we counting scalar cost, it's counted, then add costs 32
> > totally onto scalar cost. Meanwhile, the conversion from unsigned short to
> > signed short should be counted but it's not (need to check why further). 
> 
> UH to SH conversion is true when calling vect_nop_conversion_p, so it's not
> even put into the cost vector. 
> 
> tree_nop_conversion_p's comments saying:
> 
> /* Return true iff conversion from INNER_TYPE to OUTER_TYPE generates
>no instruction.  */
> 
> I may miss something here, but UH to SH conversion does need one explicit
> extend instruction *extsh*, the precision/mode equality check looks wrong for
> this conversion.

Well, it isn't a RTL predicate and it only needs extension because
there's never a HImode pseudo but always SImode subregs.

[Bug target/97102] [nvptx] PTX JIT compilation failed when using aliases

2020-09-18 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97102

--- Comment #2 from Tobias Burnus  ---
Created attachment 49239
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49239=edit
Draft patch

PTX ISA Notes
.alias directive introduced in PTX ISA 6.3.

Thus, it does not work everywhere :-(

Patch – I did bump '.version' - but that probably has more side effects than
desirable.

[Bug tree-optimization/97053] [10/11 Regression] an O2, O3 codegen bug

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97053

--- Comment #13 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:87ae45cdbd7b70a4c92d5137552228ed9ad9e9e7

commit r8-10518-g87ae45cdbd7b70a4c92d5137552228ed9ad9e9e7
Author: Jakub Jelinek 
Date:   Wed Sep 16 09:42:33 2020 +0200

store-merging: Consider also overlapping stores earlier in the by bitpos
sorting [PR97053]

As the testcases show, if we have something like:
  MEM  [ + 8B] = {};
  MEM[(short *) ] = 5;
  _5 = *x_4(D);
  MEM  [ + 2B] = _5;
  MEM[(char *) + 16B] = 88;
  MEM[(int *) + 20B] = 1;
then in sort_by_bitpos the stores are almost like in the given order,
except the first store is after the = _5; store.
We can't coalesce the = 5; store with = _5;, because the latter is MEM_REF,
while the former INTEGER_CST, and we can't coalesce the = _5 store with
the = {} store because the former is MEM_REF, the latter INTEGER_CST.
But we happily coalesce the remaining 3 stores, which is wrong, because the
= _5; store overlaps those and is in between them in the program order.
We already have code to deal with similar cases in check_no_overlap, but we
deal only with the following stores in sort_by_bitpos order, not the
earlier
ones.

The following patch checks also the earlier ones.  In
coalesce_immediate_stores
it computes the first one that needs to be checked (all the ones whose
bitpos + bitsize is smaller or equal to merged_store->start don't need to
be
checked and don't need to be checked even for any following attempts
because
of the sort_by_bitpos sorting) and the end of that (that is the first store
in the merged_store).

2020-09-16  Jakub Jelinek  

PR tree-optimization/97053
* gimple-ssa-store-merging.c (check_no_overlap): Add FIRST_ORDER,
START, FIRST_EARLIER and LAST_EARLIER arguments.  Return false if
any stores between FIRST_EARLIER inclusive and LAST_EARLIER
exclusive
has order in between FIRST_ORDER and LAST_ORDER and overlaps the to
be merged store.
(imm_store_chain_info::try_coalesce_bswap): Add FIRST_EARLIER
argument.
Adjust check_no_overlap caller.
(imm_store_chain_info::coalesce_immediate_stores): Add
first_earlier
and last_earlier variables, adjust them during iterations.  Adjust
check_no_overlap callers, call check_no_overlap even when extending
overlapping stores by extra INTEGER_CST stores.

* gcc.dg/store_merging_31.c: New test.
* gcc.dg/store_merging_32.c: New test.

(cherry picked from commit bd909071ac04e94f4b6f0baab64d0687ec55681d)

[Bug tree-optimization/97053] [10/11 Regression] an O2, O3 codegen bug

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97053

--- Comment #12 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:a24744c1ed89e255f3db5b3981519f538d231886

commit r9-8918-ga24744c1ed89e255f3db5b3981519f538d231886
Author: Jakub Jelinek 
Date:   Wed Sep 16 09:42:33 2020 +0200

store-merging: Consider also overlapping stores earlier in the by bitpos
sorting [PR97053]

As the testcases show, if we have something like:
  MEM  [ + 8B] = {};
  MEM[(short *) ] = 5;
  _5 = *x_4(D);
  MEM  [ + 2B] = _5;
  MEM[(char *) + 16B] = 88;
  MEM[(int *) + 20B] = 1;
then in sort_by_bitpos the stores are almost like in the given order,
except the first store is after the = _5; store.
We can't coalesce the = 5; store with = _5;, because the latter is MEM_REF,
while the former INTEGER_CST, and we can't coalesce the = _5 store with
the = {} store because the former is MEM_REF, the latter INTEGER_CST.
But we happily coalesce the remaining 3 stores, which is wrong, because the
= _5; store overlaps those and is in between them in the program order.
We already have code to deal with similar cases in check_no_overlap, but we
deal only with the following stores in sort_by_bitpos order, not the
earlier
ones.

The following patch checks also the earlier ones.  In
coalesce_immediate_stores
it computes the first one that needs to be checked (all the ones whose
bitpos + bitsize is smaller or equal to merged_store->start don't need to
be
checked and don't need to be checked even for any following attempts
because
of the sort_by_bitpos sorting) and the end of that (that is the first store
in the merged_store).

2020-09-16  Jakub Jelinek  

PR tree-optimization/97053
* gimple-ssa-store-merging.c (check_no_overlap): Add FIRST_ORDER,
START, FIRST_EARLIER and LAST_EARLIER arguments.  Return false if
any stores between FIRST_EARLIER inclusive and LAST_EARLIER
exclusive
has order in between FIRST_ORDER and LAST_ORDER and overlaps the to
be merged store.
(imm_store_chain_info::try_coalesce_bswap): Add FIRST_EARLIER
argument.
Adjust check_no_overlap caller.
(imm_store_chain_info::coalesce_immediate_stores): Add
first_earlier
and last_earlier variables, adjust them during iterations.  Adjust
check_no_overlap callers, call check_no_overlap even when extending
overlapping stores by extra INTEGER_CST stores.

* gcc.dg/store_merging_31.c: New test.
* gcc.dg/store_merging_32.c: New test.

(cherry picked from commit bd909071ac04e94f4b6f0baab64d0687ec55681d)

[Bug c++/97103] ICE on nested requires expression template template instantiation

2020-09-18 Thread mateusz.pusz at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97103

--- Comment #1 from Mateusz Pusz  ---
: In instantiation of 'constexpr const bool
valid_template_arguments class quantity>':

:8:15:   required from here

:6:32: internal compiler error: in tsubst, at cp/pt.c:15447

6 |   requires requires { typename Q; };  //
two representation types

  |   ~^~~~

0x1b755e9 internal_error(char const*, ...)

???:0

0x686d2b fancy_abort(char const*, int, char const*)

???:0

0x896a1b tsubst(tree_node*, tree_node*, int, tree_node*)

???:0

0x709a42 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)

???:0

0x709725 tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)

???:0

0x89ac2f instantiate_decl(tree_node*, bool, bool)

???:0

0x79044e maybe_instantiate_decl(tree_node*)

???:0

0x7935e8 mark_used(tree_node*, int)

???:0

0x90bab7 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)

???:0

0x862cec c_parse_file()

???:0

0x9d3702 c_common_parse_file()

???:0

Please submit a full bug report,

with preprocessed source if appropriate.

Please include the complete backtrace with any bug report.

See  for instructions.

Compiler returned: 1

[Bug c++/97103] New: ICE on nested requires expression template template instantiation

2020-09-18 Thread mateusz.pusz at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97103

Bug ID: 97103
   Summary: ICE on nested requires expression template template
instantiation
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mateusz.pusz at gmail dot com
  Target Milestone: ---

```
template
class quantity {};

template typename Q>
inline constexpr bool valid_template_arguments = requires {
  requires requires { typename Q; };
};
static_assert(valid_template_arguments);
```

Might be related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66564.

[Bug tree-optimization/97095] [11 regression] ICE at gcc/toplev.c:327 starting with r11-3223

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97095

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:3ea069da14c5f6276ae26d2109e9ae0765c09199

commit r11-3277-g3ea069da14c5f6276ae26d2109e9ae0765c09199
Author: Richard Biener 
Date:   Fri Sep 18 11:34:31 2020 +0200

tree-optimization/97095 - fix typo in vectorizable_live_operation

This fixes a typo introduced with the last change and not noticed
because those vectorizer access macros are not type safe ...

2020-09-18  Richard Biener  

PR tree-optimization/97095
* tree-vect-loop.c (vectorizable_live_operation): Get
the SLP vector type from the correct object.

* gfortran.dg/pr97095.f: New testcase.

[Bug tree-optimization/97095] [11 regression] ICE at gcc/toplev.c:327 starting with r11-3223

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97095

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #3 from Richard Biener  ---
Fixed.

[Bug middle-end/97073] [8/9/10/11 Regression] Miscompilation with -m32 -O1 -march=i686

2020-09-18 Thread sirl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97073

Franz Sirl  changed:

   What|Removed |Added

  Known to work|6.3.1   |

--- Comment #7 from Franz Sirl  ---
No, my fault. At that machine I still used a testcase much closer to the
original code and that one passed. With the testcase in the bugreport it also
aborts.
Sorry for not re-checking!

[Bug libstdc++/97088] 17_intro/names.cc and experimental/names.cc fail with --disable-libstdcxx-pch

2020-09-18 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97088

--- Comment #2 from Christophe Lyon  ---
(In reply to jos...@codesourcery.com from comment #1)
> On Thu, 17 Sep 2020, clyon at gcc dot gnu.org wrote:
> 
> > This happens because the testcase does
> > #define x (
> > and "x" is used as parameter names in several function prototypes in 
> > newlib's
> > math.h
> 
> That's a bug in newlib, which should be fixed there.

OK, so you mean that prototypes like
extern int __isinff (float x);
should not name their parameters? I can certainly submit the simple patch to
newlib.

Regarding the problem with glibc, the problem is in ucontext.h, where struct
_libc_fpstate is declared as:
struct _libc_fpstate
{
  struct
  {
unsigned int sign1:1;
unsigned int unused:15;
unsigned int sign2:1;
unsigned int exponent:14;
unsigned int j:1;
unsigned int mantissa1:31;
unsigned int mantissa0:32;
  } fpregs[8];
  unsigned int fpsr:32;
  unsigned int fpcr:32;
  unsigned char ftype[8];
  unsigned int init_flag;
};

The offending field is 'j', because libstdc++'s 17_intro/names.cc defines 'j'
as '('. Do you mean that field should also be renamed? That sounds odd.

[Bug analyzer/97090] gcc.dg/analyzer/malloc-vs-local-1b.c fails on arm

2020-09-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97090

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
I see on i686-linux:
XPASS: gcc.dg/analyzer/feasibility-1.c  (test for warnings, line 58)
FAIL: gcc.dg/analyzer/malloc-vs-local-1b.c  (test for bogus messages, line 170)
FAIL: gcc.dg/analyzer/pr96713.c (test for excess errors)
XPASS: gcc.dg/analyzer/unknown-fns-4.c  (test for warnings, line 13)
but none of this on x86_64-linux.

[Bug target/96789] x264: sub4x4_dct() improves when vectorization is disabled

2020-09-18 Thread linkw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96789

--- Comment #13 from Kewen Lin  ---
>   2) on Power, the conversion from unsigned char to unsigned short is nop
> conversion, when we counting scalar cost, it's counted, then add costs 32
> totally onto scalar cost. Meanwhile, the conversion from unsigned short to
> signed short should be counted but it's not (need to check why further). 

UH to SH conversion is true when calling vect_nop_conversion_p, so it's not
even put into the cost vector. 

tree_nop_conversion_p's comments saying:

/* Return true iff conversion from INNER_TYPE to OUTER_TYPE generates
   no instruction.  */

I may miss something here, but UH to SH conversion does need one explicit
extend instruction *extsh*, the precision/mode equality check looks wrong for
this conversion.

[Bug analyzer/97090] gcc.dg/analyzer/malloc-vs-local-1b.c fails on arm

2020-09-18 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97090

Christophe Lyon  changed:

   What|Removed |Added

 Target|arm |arm aarch64

--- Comment #2 from Christophe Lyon  ---
Saw it on aarch64 cross-compiler too, if that's easier to reproduce.

[Bug middle-end/97073] [8/9/10/11 Regression] Miscompilation with -m32 -O1 -march=i686

2020-09-18 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97073

--- Comment #6 from Jakub Jelinek  ---
The only explanation would be that -msse2 -mstv was enabled...  In that case
the bitwise logical op is done through pandn instruction.

[Bug middle-end/97073] [8/9/10/11 Regression] Miscompilation with -m32 -O1 -march=i686

2020-09-18 Thread sirl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97073

--- Comment #5 from Franz Sirl  ---
(In reply to Jakub Jelinek from comment #3)
> This broke in between r102000 (still good) and r104000 (already
> miscompiled), so I don't believe that 6.3.1 worked.

Hmm, maybe something in 6.3.1 is masking the bug? Yesterday I used "gcc version
6.3.1 20170216 (Red Hat 6.3.1-3) (GCC)" from
devtoolset-6-gcc-6.3.1-3.1.el7.x86_64 to try.

But in the meantime I built 6.5.0 myself and surely enough it shows the bug
too?

[Bug analyzer/97090] gcc.dg/analyzer/malloc-vs-local-1b.c fails on arm

2020-09-18 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97090

--- Comment #1 from Christophe Lyon  ---
I see random results from one run to another, so it's likely that something is
not initialized correctly.

[Bug bootstrap/96378] ICE: Solaris/SPARCv9 bootstrap stage2 segfault compiling stdc++.h.gch/O2ggnu++0x.gch

2020-09-18 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96378

Eric Botcazou  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-09-18
 CC||ebotcazou at gcc dot gnu.org
 Status|UNCONFIRMED |WAITING

--- Comment #1 from Eric Botcazou  ---
What does 'gcc -v' print exactly?  It looks like you're trying to bootstrap a
64-bit compiler with a 32-bit toolchain.

[Bug tree-optimization/97089] [11 regression] execution FAILs for gfortran.dg/array_constructor_11.f90 after r11-3258

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97089

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:0f6150a5d368fc30540dac31e29f1d6d40f207d3

commit r11-3276-g0f6150a5d368fc30540dac31e29f1d6d40f207d3
Author: Richard Biener 
Date:   Fri Sep 18 09:22:57 2020 +0200

tree-optimization/97089 - fix bogus unsigned division replacement

This fixes bogus replacing of an unsigned (-x)/y division by
-(x/y).

2020-09-18  Richard Biener  

PR tree-optimization/97089
* tree-ssa-sccvn.c (visit_nary_op): Do not replace unsigned
divisions.

[Bug tree-optimization/97089] [11 regression] execution FAILs for gfortran.dg/array_constructor_11.f90 after r11-3258

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97089

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #3 from Richard Biener  ---
Fixed.

[Bug target/97102] [nvptx] PTX JIT compilation failed when using aliases

2020-09-18 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97102

--- Comment #1 from Tobias Burnus  ---
(In reply to Tobias Burnus from comment #0)
> .visible .func (.param.u32 %value_out) foo

https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#kernel-and-function-directives-alias

has the example:

.visible .func bar(.param .u32 p);
.alias bar, foo;

And the note:
.alias directive requires sm_30 or higher.

[Bug tree-optimization/97098] vect_bb_slp_mark_live_stmts() loops forever on test case using -O3

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97098

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #5 from Richard Biener  ---
Fixed.

[Bug tree-optimization/97098] vect_bb_slp_mark_live_stmts() loops forever on test case using -O3

2020-09-18 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97098

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Richard Biener :

https://gcc.gnu.org/g:080ddd8a81ea39e92542fa7d7e2d7d27ee741710

commit r11-3275-g080ddd8a81ea39e92542fa7d7e2d7d27ee741710
Author: Richard Biener 
Date:   Fri Sep 18 09:00:12 2020 +0200

tree-optimization/97098 - fix compile-time hog in SLP live

This fixes a missed early-out in SLP live stmt marking when
all scalar stmts were already visited (oops).

2020-09-18  Richard Biener  

PR tree-optimization/97098
* tree-vect-slp.c (vect_bb_slp_mark_live_stmts): Do not
recurse to children when all stmts were already visited.

[Bug target/97102] New: [nvptx] PTX JIT compilation failed when using aliases

2020-09-18 Thread burnus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97102

Bug ID: 97102
   Summary: [nvptx] PTX JIT compilation failed when using aliases
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: openmp
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: burnus at gcc dot gnu.org
CC: vries at gcc dot gnu.org
  Target Milestone: ---

[Found when testing a patch for PR96390, which works with GCN offloading but
not with nvptx]

When compiling the following with -fopenmp
--
#pragma omp declare target
int foo () { return 42; }
int bar () __attribute__((alias ("foo")));
#pragma omp end declare target

int
main ()
{
  int n;
  #pragma omp target map(from:n)
n = bar ();
  if (n != 42)
__builtin_abort ();
}
--

it fails with when running with:

libgomp: Link error log ptxas application ptx input, line 89; error   : Label
expected for argument 0 of instruction 'call'
ptxas application ptx input, line 89; fatal   : Call target not recognized
ptxas fatal   : Ptx assembly aborted due to errors

libgomp: cuLinkAddData (ptx_code) error: a PTX JIT compilation failed


The generated PTX has:

// BEGIN GLOBAL FUNCTION DECL: foo
.visible .func (.param.u32 %value_out) foo;

// BEGIN GLOBAL FUNCTION DEF: foo
.visible .func (.param.u32 %value_out) foo
{
.reg.u32 %value;
.reg.u32 %r22;
.reg.u32 %r23;
mov.u32 %r22, 42;
mov.u32 %r23, %r22;
mov.u32 %value, %r23;
st.param.u32[%value_out], %value;
ret;
}
...
call (%value_in), bar;
--

Namely: 'bar' only appears in the call.

[Bug libstdc++/84949] -ffast-math bugged with respect to NaNs

2020-09-18 Thread kretz at kde dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84949

--- Comment #8 from Matthias Kretz (Vir)  ---
I've been doing a lot of research into the numeric_limits intent/meaning
recently. I also implemented and used alternative interpretations of "has NaN"
and "is IEC559". My conclusion: std::numeric_limits means "has NaN bitpattern"
and "has IEC559 bit layout" not "has NaNs with NaN behavior" and "has IEC559
behavior". The former are still useful even if the latter don't hold. The C++
standard could be clearer on this matter though.
Thus, it seems the status quo is working as intended. It's just that we're
missing a standard interface to ask for behavior conformance.

Any progress on this issue must go via WG21.

Besides: my patch in #6 was not accepted (ABI concerns: specifically ABI
breakage from using different -f... flags), so should this PR be closed?

[Bug libstdc++/97101] New: noexcept specifier in std::bind_front()

2020-09-18 Thread ashtumspam at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97101

Bug ID: 97101
   Summary: noexcept specifier in std::bind_front()
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ashtumspam at gmail dot com
  Target Milestone: ---

#include 
#include 

int main()
{
std::cout << noexcept(std::bind_front([] {})) << std::endl;
}

Output:
0


The mistake is in this line:
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/functional#L908

[Bug tree-optimization/97098] vect_bb_slp_mark_live_stmts() loops forever on test case using -O3

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97098

Richard Biener  changed:

   What|Removed |Added

 CC||dimhen at gmail dot com

--- Comment #3 from Richard Biener  ---
*** Bug 97087 has been marked as a duplicate of this bug. ***

[Bug middle-end/97087] [11 regression] 70x slow -O3

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97087

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|ASSIGNED|RESOLVED

--- Comment #3 from Richard Biener  ---
Dup, I have a patch.

*** This bug has been marked as a duplicate of bug 97098 ***

[Bug tree-optimization/97098] vect_bb_slp_mark_live_stmts() loops forever on test case using -O3

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97098

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed||2020-09-18
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #2 from Richard Biener  ---
Mine.

[Bug tree-optimization/97095] [11 regression] ICE at gcc/toplev.c:327 starting with r11-3223

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97095

Richard Biener  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
   Last reconfirmed||2020-09-18
 Ever confirmed|0   |1
   Target Milestone|--- |11.0
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Richard Biener  ---
Mine.

[Bug c++/97094] Compiling big std::unordered_map became slower

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97094

--- Comment #1 from Richard Biener  ---
Can you try to specify an explicit -std=c++xy?

[Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |10.3

[Bug tree-optimization/97089] [11 regression] execution FAILs for gfortran.dg/array_constructor_11.f90 after r11-3258

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97089

Richard Biener  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1
   Target Milestone|--- |11.0
   Last reconfirmed||2020-09-18
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Richard Biener  ---
I will have a look.

[Bug middle-end/97087] [11 regression] 70x slow -O3

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97087

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Target Milestone|--- |11.0
   Keywords||needs-bisection
   Last reconfirmed||2020-09-18
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Confirmed, mine.  Curious which change triggered it.

 tree slp vectorization :   7.13 ( 98%)   0.01 (100%)   7.15 ( 98%)
228 kB (  8%)

[Bug tree-optimization/97085] [11 Regression] aarch64, SVE: ICE in gimple_expand_vec_cond_expr since r11-2610-ga1ee6d507b

2020-09-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97085

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.0