[Bug fortran/90329] Incompatibility between gfortran and C lapack calls

2019-06-21 Thread kkylheku at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329

--- Comment #46 from Kaz Kylheku  ---
C pseudocode in light of previous comment:

   double abused_fortran_fn(double x, double y, char str[1], int len)
   {
  if (len != 1)
return abused_fortran_fn(x, y, str, 1); /* full call, not tail! */

  return tail_call_sibling(x, y, str, len);  
   }

[Bug fortran/90329] Incompatibility between gfortran and C lapack calls

2019-06-21 Thread kkylheku at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90329

Kaz Kylheku  changed:

   What|Removed |Added

 CC||kkylheku at gmail dot com

--- Comment #45 from Kaz Kylheku  ---
Hi everyone.

Pardon my ignorance of C-Fortran bridging matters, but does any of the
following make sense?

The Fortran subroutine has no idea whether the word where the argument is
supposed to be is really the argument, or just some unrelated part of the stack
(because the caller didn't pass the argument).

Can't the Fortran routine check whether that word has the expected value 1?
Then in that case, just pretend it's the argument (whether that is the case, or
whether that 1 is just a spurious value that looks like the right argument). In
this case, just do all the tail calling to sibling routines happily, who will
get the right string length.

If the word does not have value 1, then, uh oh: treat it suspiciously! The
function can then *call itself* with with a *copy* of the arguments, including
the correct length 1. When that call returns, it returns.   The recursively
invoked activation will of course the value of 1, and then act cool.

The downside is that there is a performance penalty with this check and extra
recursive call. When the callers are fixed to pass the argument, the penalty is
reduced, but the check is still being made.

[Bug c++/85125] constant expression with const_cast UB does not emit error

2019-06-21 Thread david at doublewise dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85125

--- Comment #4 from David Stone  ---
*** Bug 86623 has been marked as a duplicate of this bug. ***

[Bug c++/55004] [meta-bug] constexpr issues

2019-06-21 Thread david at doublewise dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
Bug 55004 depends on bug 86623, which changed state.

Bug 86623 Summary: constexpr evaluation fails to give an error for modifying a 
const object
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86623

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug c++/86623] constexpr evaluation fails to give an error for modifying a const object

2019-06-21 Thread david at doublewise dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86623

David Stone  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||david at doublewise dot net
 Resolution|--- |DUPLICATE

--- Comment #2 from David Stone  ---
Closing as duplicate

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

[Bug c++/85125] constant expression with const_cast UB does not emit error

2019-06-21 Thread david at doublewise dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85125

David Stone  changed:

   What|Removed |Added

 CC||david at doublewise dot net

--- Comment #3 from David Stone  ---
Here is a reproduction that does not require const_cast:


struct S {
int a = 1;
int * ptr = &a;
};

constexpr bool f() {
auto const s = S{};
*s.ptr = 2;
return s.a == 2;
}

static_assert(f());


See it live: https://godbolt.org/z/30O7_j

[Bug c++/90947] [9/10 Regression] Simple lookup table of array of strings is miscompiled

2019-06-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90947

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #4 from Martin Sebor  ---
Patch: https://gcc.gnu.org/ml/gcc-patches/2019-06/msg01365.html

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

--- Comment #7 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 21:58:19 2019
New Revision: 272576

URL: https://gcc.gnu.org/viewcvs?rev=272576&root=gcc&view=rev
Log:
2019-06-21  Paolo Carlini  

PR c++/90909
* g++.dg/other/final7.C: New.

Added:
trunk/gcc/testsuite/g++.dg/other/final7.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug go/86535] FreeBSD/PowerPC64 - Building Go Frontend support for gcc 7.3.0 fails

2019-06-21 Thread clhamilto at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86535

--- Comment #21 from Curtis Hamilton  ---
Created attachment 46510
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46510&action=edit
FreeBSD/X86_64 GCC8 build log

GccGo doesn't build on FreeBSD X86 either.  It has similar issues to those I
got on powerpc64. Attached is the build log.

[Bug c++/67184] Missed optimization with C++11 final specifier

2019-06-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67184

Paolo Carlini  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org

--- Comment #13 from Paolo Carlini  ---
Unfortunately I have to re-open this: the fix, as-is, caused c++/90909.

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

Paolo Carlini  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Assignee|paolo.carlini at oracle dot com|unassigned at gcc dot 
gnu.org

--- Comment #6 from Paolo Carlini  ---
Fixed by reverting completely (for the time being) the offending change.

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

--- Comment #5 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:47:40 2019
New Revision: 272574

URL: https://gcc.gnu.org/viewcvs?rev=272574&root=gcc&view=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Removed:
trunk/gcc/testsuite/g++.dg/other/final3.C
trunk/gcc/testsuite/g++.dg/other/final4.C
trunk/gcc/testsuite/g++.dg/other/final5.C

[Bug tree-optimization/69445] Fail to devirtualize call to base class function even though derived class type is 'final'

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69445

--- Comment #5 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:47:40 2019
New Revision: 272574

URL: https://gcc.gnu.org/viewcvs?rev=272574&root=gcc&view=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Removed:
trunk/gcc/testsuite/g++.dg/other/final3.C
trunk/gcc/testsuite/g++.dg/other/final4.C
trunk/gcc/testsuite/g++.dg/other/final5.C

[Bug c++/67184] Missed optimization with C++11 final specifier

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67184

--- Comment #12 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:47:40 2019
New Revision: 272574

URL: https://gcc.gnu.org/viewcvs?rev=272574&root=gcc&view=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Removed:
trunk/gcc/testsuite/g++.dg/other/final3.C
trunk/gcc/testsuite/g++.dg/other/final4.C
trunk/gcc/testsuite/g++.dg/other/final5.C

[Bug c++/90909] [10 Regression] call devirtualized to pure virtual

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90909

--- Comment #4 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:46:51 2019
New Revision: 272573

URL: https://gcc.gnu.org/viewcvs?rev=272573&root=gcc&view=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Added:
trunk/gcc/testsuite/g++.dg/other/final6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/67184] Missed optimization with C++11 final specifier

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67184

--- Comment #11 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:46:51 2019
New Revision: 272573

URL: https://gcc.gnu.org/viewcvs?rev=272573&root=gcc&view=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Added:
trunk/gcc/testsuite/g++.dg/other/final6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/69445] Fail to devirtualize call to base class function even though derived class type is 'final'

2019-06-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69445

--- Comment #4 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Fri Jun 21 20:46:51 2019
New Revision: 272573

URL: https://gcc.gnu.org/viewcvs?rev=272573&root=gcc&view=rev
Log:
/cp
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* call.c (build_over_call): Devirtualize when the final overrider
comes from the base.

/testsuite
2019-06-21  Paolo Carlini  

PR c++/90909
Revert:
2019-05-21  Paolo Carlini  

PR c++/67184
PR c++/69445
* g++.dg/other/final3.C: New.
* g++.dg/other/final4.C: Likewise.
* g++.dg/other/final5.C: Likewise.

* g++.dg/other/final6.C: New.

Added:
trunk/gcc/testsuite/g++.dg/other/final6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/61490] accepts-invalid: qualified-name in friend function definition

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61490

--- Comment #2 from Marek Polacek  ---
Author: mpolacek
Date: Fri Jun 21 20:43:47 2019
New Revision: 272572

URL: https://gcc.gnu.org/viewcvs?rev=272572&root=gcc&view=rev
Log:
PR c++/61490 - qualified-id in friend function definition.
* decl.c (grokdeclarator): Diagnose qualified-id in friend function
definition.  Improve location for diagnostics of friend functions.

* g++.dg/diagnostic/friend2.C: New test.
* g++.dg/diagnostic/friend3.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/diagnostic/friend2.C
trunk/gcc/testsuite/g++.dg/diagnostic/friend3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/61490] accepts-invalid: qualified-name in friend function definition

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61490

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #3 from Marek Polacek  ---
Fixed.

[Bug c++/60223] [c++11] ICE with C++11-style default template parameter

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60223

--- Comment #8 from Marek Polacek  ---
Fixed on trunk but I'll leave it open because I want to fix it for 9.2 also.

[Bug fortran/51991] Wrong error message with variables named "SAVE*"

2019-06-21 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51991

--- Comment #17 from kargl at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #15)
> Compiling the test in comment 10 gives now
> 
> pr51991_2.f90:3:7:
> 
> 3 |   save1 = something wrong
>   |   1
> Error: Invalid character in name at (1)
> pr51991_2.f90:8:6:
> 
> 8 |   data1 = something wrong
>   |  1
> Error: Syntax error in DATA statement at (1)
> 
> The first error before revision r272556 was
> 
> pr51991_2.f90:3:6:
> 
> 3 |   save1 = something wrong
>   |  1
> Error: Syntax error in SAVE statement at (1)
> 
> It seems there is a similar problem with DATA (and may be others) and the
> location of (1) is not set to the right place.

I just realized that your code isn't even close to conforming.

subroutine sav
  integer :: save1
  save1 = something wrong
end subroutine sav

What part of "something wrong" is a valid RHS expression

Please don't waste my time with silly code.

For the record, this compiles just fine

subroutine sav
  integer :: save1
  save1 = 1
end subroutine sav

[Bug c++/60223] [c++11] ICE with C++11-style default template parameter

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60223

--- Comment #7 from Marek Polacek  ---
Author: mpolacek
Date: Fri Jun 21 20:32:06 2019
New Revision: 272571

URL: https://gcc.gnu.org/viewcvs?rev=272571&root=gcc&view=rev
Log:
PR c++/60223 - ICE with T{} in non-deduced context.
* pt.c (unify): Allow COMPOUND_LITERAL_P in a non-deduced context.

* g++.dg/cpp0x/nondeduced1.C: New test.
* g++.dg/cpp0x/nondeduced2.C: New test.
* g++.dg/cpp0x/nondeduced3.C: New test.
* g++.dg/cpp0x/nondeduced4.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced1.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced2.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced3.C
trunk/gcc/testsuite/g++.dg/cpp0x/nondeduced4.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/67884] Missing error message on required allocatable attribute

2019-06-21 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67884

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|NEW |RESOLVED
 CC||kargl at gcc dot gnu.org
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |kargl at gcc dot gnu.org
   Target Milestone|--- |10.0

--- Comment #4 from kargl at gcc dot gnu.org ---
Fixed on trunk.  Thanks for bug report.

[Bug c++/64235] Internal compiler error (Segmentation fault)

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64235

--- Comment #4 from Marek Polacek  ---
Author: mpolacek
Date: Fri Jun 21 20:26:54 2019
New Revision: 272570

URL: https://gcc.gnu.org/viewcvs?rev=272570&root=gcc&view=rev
Log:
PR c++/64235 - missing syntax error with invalid alignas.
* parser.c (cp_parser_std_attribute_spec): Commit to tentative parse
if there's a missing close paren.

* g++.dg/parse/alignas1.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/parse/alignas1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/64235] Internal compiler error (Segmentation fault)

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64235

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #5 from Marek Polacek  ---
Fixed.

[Bug fortran/67884] Missing error message on required allocatable attribute

2019-06-21 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67884

--- Comment #3 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Fri Jun 21 20:24:01 2019
New Revision: 272569

URL: https://gcc.gnu.org/viewcvs?rev=272569&root=gcc&view=rev
Log:
2019-06-21  Steven G. Kargl  

PR fortran/67884
* resolve.c (deferred_requirements) : Check only the result variable.
(resolve_fl_procedure): Check deferred requirements on functions.

2019-06-21  Steven G. Kargl  

PR fortran/67884
* gfortran.dg/dummy_procedure_8.f90: Remove a test that is ...
* gfortran.dg/pr67884.f90: ... covered here.  New test.

Added:
trunk/gcc/testsuite/gfortran.dg/pr67884.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/dummy_procedure_8.f90

[Bug libstdc++/81797] gcc 7.1.0 fails to build on macOS 10.13 (High Sierra):

2019-06-21 Thread jens4303 at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797

--- Comment #82 from Jens-S. Vöckler  ---
I had some prior issues with w.r.t 32bits. Tinkering, this script does build a
gcc 9.1 on macOS 10.14.5 on APFS. I didn't create it for beauty, and it's
specific to my setup. The resulting compiler is unable to generate 32bit stuff.

#!/bin/bash
#
here="$PWD"
trap 'cd "$here"' EXIT

prefix=/opt/gcc-9.1.0
if [[ ! -d $prefix ]]; then
echo "FATAL: No such directory: $prefix" 1>&2
exit 1
fi

# fix for fink interference
PATH=$(echo $PATH | \
   tr -d '\012' | \
   tr ':' '\012' | \
   fgrep -v /sw/bin | \
   tr '\012' ':')
export PATH="$PATH:/sw/bin";
echo "PATH=$PATH"

set -v
test -d gcc-9.1.0 || gtar xJf gcc-9.1.0.tar.xz
cd gcc-9.1.0

test -d gmp-6.1.2 || gtar xJf ../gmp-6.1.2.tar.xz
test -e gmp || ln -s gmp-6.1.2 gmp

test -d mpfr-4.0.2 || gtar xJf ../mpfr-4.0.2.tar.xz
test -e mpfr || ln -s mpfr-4.0.2 mpfr

test -d mpc-1.1.0 || gtar xzf ../mpc-1.1.0.tar.gz
test -e mpc || ln -s mpc-1.1.0 mpc

test -d isl-0.18 || gtar xjf ../isl-0.18.tar.bz2
test -e isl || ln -s isl-0.18 isl

mkdir objdir
cd objdir
set +v

../configure "--prefix=$prefix" \
--enable-languages=c,c++,fortran,lto,objc,obj-c++ \
--with-system-zlib \
--disable-multilib \
--with-cpu=core2 \
--enable-threads \
   
"--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
test $? -eq 0 || exit 2

make -j 3 BOOT_CFLAGS='-O' bootstrap
test $? -eq 0 || exit 42

make install

---&< snip, snip &<---

$ file /opt/gcc-9.1.0/bin/g++ 
/opt/gcc-9.1.0/bin/g++: Mach-O 64-bit executable x86_64

$ /opt/gcc/bin/g++ hello.cc -o hello 
$ file hello
hello: Mach-O 64-bit executable x86_64
$ otool -L hello
hello:
/opt/gcc-9.1.0/lib/libstdc++.6.dylib (compatibility version 7.0.0,
current version 7.26.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 1252.250.1)
/opt/gcc-9.1.0/lib/libgcc_s.1.dylib (compatibility version 1.0.0,
current version 1.0.0)
$ ./hello 
Hello, world

[Bug c++/90490] [9 Regression] ICE on noexcept with decltype expression

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90490

Marek Polacek  changed:

   What|Removed |Added

Summary|[9/10 Regression] ICE on|[9 Regression] ICE on
   |noexcept with decltype  |noexcept with decltype
   |expression  |expression

--- Comment #7 from Marek Polacek  ---
Fixed on trunk so far.

[Bug c++/90490] [9/10 Regression] ICE on noexcept with decltype expression

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90490

--- Comment #6 from Marek Polacek  ---
Author: mpolacek
Date: Fri Jun 21 20:19:24 2019
New Revision: 272568

URL: https://gcc.gnu.org/viewcvs?rev=272568&root=gcc&view=rev
Log:
PR c++/90490 - fix decltype issues in noexcept-specifier.
* except.c (build_noexcept_spec): Call
instantiate_non_dependent_expr_sfinae before
build_converted_constant_expr instead of calling
instantiate_non_dependent_expr after it.  Add
processing_template_decl_sentinel.

* g++.dg/cpp0x/noexcept43.C: New test.
* g++.dg/cpp0x/noexcept44.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept43.C
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept44.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/except.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/90875] warnings about switch values outside range don't have associated option

2019-06-21 Thread mbelivea at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

Matthew Beliveau  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Matthew Beliveau  ---
Actually fixed now.

[Bug other/44209] [meta-bug] Some warnings are not linked to diagnostics options

2019-06-21 Thread mbelivea at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44209
Bug 44209 depends on bug 90875, which changed state.

Bug 90875 Summary: warnings about switch values outside range don't have 
associated option
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

[Bug c++/90875] warnings about switch values outside range don't have associated option

2019-06-21 Thread mbelivea at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

--- Comment #4 from Matthew Beliveau  ---
Author: mbelivea
Date: Fri Jun 21 19:58:32 2019
New Revision: 272567

URL: https://gcc.gnu.org/viewcvs?rev=272567&root=gcc&view=rev
Log:
PR c++/90875 - added -Wswitch-outside-range option

Added:
trunk/gcc/testsuite/c-c++-common/Wswitch-outside-range-1.c
trunk/gcc/testsuite/c-c++-common/Wswitch-outside-range-2.c
trunk/gcc/testsuite/c-c++-common/Wswitch-outside-range-3.c
trunk/gcc/testsuite/c-c++-common/Wswitch-outside-range-4.c

[Bug fortran/90813] [10 regression] gfortran.dg/proc_ptr_51.f90 fails (SIGSEGV) after 272084

2019-06-21 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90813

Thomas Koenig  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #7 from Thomas Koenig  ---
I think we can move this to NEW.

[Bug fortran/90937] [7/8/9 Regression] ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538

2019-06-21 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90937

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #10 from Thomas Koenig  ---
Fixed on all open branches, closing.

[Bug fortran/90937] [7/8/9 Regression] ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538

2019-06-21 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90937

--- Comment #9 from Thomas Koenig  ---
Author: tkoenig
Date: Fri Jun 21 19:32:23 2019
New Revision: 272566

URL: https://gcc.gnu.org/viewcvs?rev=272566&root=gcc&view=rev
Log:
2019-06-21  Thomas Koenig  

Backport from trunk
PR fortran/90937
* trans-types.c (get_formal_from_actual_arglist): Get symbol from
current namespace so it will be freed later.  If symbol is of type
character, get an empty character length.

2019-06-21  Thomas Koenig  

Backport from trunk
PR fortran/90937
* gfortran.dg/external_procedure_4.f90: New test.


Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/trans-types.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/90937] [7/8/9 Regression] ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538

2019-06-21 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90937

--- Comment #8 from Thomas Koenig  ---
Author: tkoenig
Date: Fri Jun 21 19:30:51 2019
New Revision: 272565

URL: https://gcc.gnu.org/viewcvs?rev=272565&root=gcc&view=rev
Log:
2019-06-21  Thomas Koenig  

Backport from trunk
PR fortran/90937
* trans-types.c (get_formal_from_actual_arglist): Get symbol from
current namespace so it will be freed later.  If symbol is of type
character, get an empty character length.

2019-06-21  Thomas Koenig  

Backport from trunk
PR fortran/90937
* gfortran.dg/external_procedure_4.f90: New test.


Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/external_procedure_4.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/trans-types.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/90937] [7/8/9 Regression] ICE: in gfc_get_symbol_decl, at fortran/trans-decl.c:1538

2019-06-21 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90937

--- Comment #7 from Thomas Koenig  ---
Author: tkoenig
Date: Fri Jun 21 19:28:54 2019
New Revision: 272564

URL: https://gcc.gnu.org/viewcvs?rev=272564&root=gcc&view=rev
Log:
2019-06-21  Thomas Koenig  

Backport from trunk
PR fortran/90937
* trans-types.c (get_formal_from_actual_arglist): Get symbol from
current namespace so it will be freed later.  If symbol is of type
character, get an empty character length.

2019-06-21  Thomas Koenig  

Backport from trunk
PR fortran/90937
* gfortran.dg/external_procedure_4.f90: New test.


Added:
branches/gcc-9-branch/gcc/testsuite/gfortran.dg/external_procedure_4.f90
Modified:
branches/gcc-9-branch/gcc/fortran/ChangeLog
branches/gcc-9-branch/gcc/fortran/trans-types.c
branches/gcc-9-branch/gcc/testsuite/ChangeLog

[Bug c++/90960] declaring a member function with a computed typedef is confused as a data member definition

2019-06-21 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90960

--- Comment #2 from Alisdair Meredith  ---
I agree the second problem looks like a dupe.

It has since been pointed out to me that the first error is indeed correct, and
simply the error message is less than helpful:

[temp.spec]p8 of C++17 says:
"If a function declaration acquired its function type through a dependent type
(17.6.2.1) without using the syntactic form of a function declarator, the
program is ill-formed."

I believe this constraint is new to C++17, but so are exception specifications
in the type system that I rely on, so this bug report could be safely closed,
or treated simply as a feature request for a clearer diagnostic message that
members of dependent type can never be function declarations.

[Bug other/44209] [meta-bug] Some warnings are not linked to diagnostics options

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44209
Bug 44209 depends on bug 90875, which changed state.

Bug 90875 Summary: warnings about switch values outside range don't have 
associated option
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

[Bug c++/90875] warnings about switch values outside range don't have associated option

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

Marek Polacek  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #3 from Marek Polacek  ---
You forgot to add the new tests.

[Bug libstdc++/90920] [9 Regression] ABI incompatibility in std::rotate

2019-06-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90920

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #8 from Jonathan Wakely  ---
.

[Bug libstdc++/90920] [9 Regression] ABI incompatibility in std::rotate

2019-06-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90920

--- Comment #7 from Jonathan Wakely  ---
Fixed for 9.2

[Bug c++/90961] New: awful diagnostics for noexcept-expression with type name

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90961

Bug ID: 90961
   Summary: awful diagnostics for noexcept-expression with type
name
   Product: gcc
   Version: 10.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: ---

For

static_assert(noexcept(void));

we generate a host of bogus errors:

q2.C:1:24: error: expected primary-expression before ‘void’
1 | static_assert(noexcept(void));
  |^~~~
q2.C:1:24: error: expected ‘)’ before ‘void’
1 | static_assert(noexcept(void));
  |   ~^~~~
  |)
q2.C:1:24: error: expected ‘,’ before ‘void’
1 | static_assert(noexcept(void));
  |^~~~
  |,
q2.C:1:24: error: expected string-literal before ‘void’
1 | static_assert(noexcept(void));
  |^~~~
q2.C:1:24: error: expected ‘)’ before ‘void’
1 | static_assert(noexcept(void));
  |  ~ ^~~~
  |)
q2.C:1:29: error: expected ‘;’ before ‘)’ token
1 | static_assert(noexcept(void));
  | ^
  | ;
q2.C:1:29: error: expected unqualified-id before ‘)’ token

Instead, we should generate one error saying something like "type names not
allowed".

[Bug target/83250] _mm256_zextsi128_si256 missing for AVX2 zero extension

2019-06-21 Thread agner at agner dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83250

Agner Fog  changed:

   What|Removed |Added

 CC||agner at agner dot org

--- Comment #1 from Agner Fog  ---
I can confirm this bug.

_mm256_zextsi128_si256 and several similar intrinsic functions are supported by
Clang and MS compilers, but not by Gcc.

Test case:

   #include  

   __m256i zero_upper_part(__m256i a) {
   return _mm256_zextsi128_si256(_mm256_castsi256_si128(a));
   }

Result:
test.cpp: In function '__m256i zero_upper_part(__m256i)':
test.cpp:6:12: error: '_mm256_zextsi128_si256' was not declared in this scope
 return _mm256_zextsi128_si256(_mm256_castsi256_si128(a));
^~
test.cpp:6:12: note: suggested alternative: '_mm256_castsi128_si256'


The suggested alternative is *dangerous*: The upper part of the ymm register is
undefined after _mm256_castsi128_si256, while it is zero after
_mm256_zextsi128_si256.

_mm256_castsi128_si256 works most of the time, but sometimes a compiler will
optimize away the undefined upper part so that it no longer zero. This can give
some nasty bugs.

[Bug fortran/51991] Wrong error message with variables named "SAVE*"

2019-06-21 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51991

--- Comment #16 from Steve Kargl  ---
On Fri, Jun 21, 2019 at 06:03:42PM +, dominiq at lps dot ens.fr wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51991
> 
> --- Comment #15 from Dominique d'Humieres  ---
> Compiling the test in comment 10 gives now
> 
> pr51991_2.f90:3:7:
> 
> 3 |   save1 = something wrong
>   |   1
> Error: Invalid character in name at (1)

Not my problem.  Regression tested clean.

[Bug c++/90731] [9/10 Regression] noexcept broken for forward declarations with decltype

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90731

--- Comment #3 from Marek Polacek  ---
And using typedef:

typedef void T() noexcept(true);
T t;
void t() noexcept(true);

[Bug tree-optimization/90930] Excessive memory consumption

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90930

Richard Biener  changed:

   What|Removed |Added

  Known to work||10.0

--- Comment #9 from Richard Biener  ---
Fixed on trunk sofar, I'm going to backport this change.

[Bug tree-optimization/90930] Excessive memory consumption

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90930

--- Comment #8 from Richard Biener  ---
Author: rguenth
Date: Fri Jun 21 18:12:58 2019
New Revision: 272560

URL: https://gcc.gnu.org/viewcvs?rev=272560&root=gcc&view=rev
Log:
2019-06-21  Richard Biener  

PR tree-optimization/90930
* tree-ssa-reassoc.c (rewrite_expr_tree_parallel): Set visited
flag on new stmts to avoid re-processing them.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-reassoc.c

[Bug c++/90731] [9/10 Regression] noexcept broken for forward declarations with decltype

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90731

--- Comment #2 from Marek Polacek  ---
This test using using should compile in c++17:

using T = void() noexcept(true);
T t;
void t() noexcept(true);

[Bug fortran/51991] Wrong error message with variables named "SAVE*"

2019-06-21 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51991

--- Comment #15 from Dominique d'Humieres  ---
Compiling the test in comment 10 gives now

pr51991_2.f90:3:7:

3 |   save1 = something wrong
  |   1
Error: Invalid character in name at (1)
pr51991_2.f90:8:6:

8 |   data1 = something wrong
  |  1
Error: Syntax error in DATA statement at (1)

The first error before revision r272556 was

pr51991_2.f90:3:6:

3 |   save1 = something wrong
  |  1
Error: Syntax error in SAVE statement at (1)

It seems there is a similar problem with DATA (and may be others) and the
location of (1) is not set to the right place.

[Bug c++/90875] warnings about switch values outside range don't have associated option

2019-06-21 Thread mbelivea at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

Matthew Beliveau  changed:

   What|Removed |Added

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

--- Comment #2 from Matthew Beliveau  ---
Fixed.

[Bug other/44209] [meta-bug] Some warnings are not linked to diagnostics options

2019-06-21 Thread mbelivea at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44209
Bug 44209 depends on bug 90875, which changed state.

Bug 90875 Summary: warnings about switch values outside range don't have 
associated option
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

   What|Removed |Added

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

[Bug c++/90875] warnings about switch values outside range don't have associated option

2019-06-21 Thread mbelivea at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90875

--- Comment #1 from Matthew Beliveau  ---
Author: mbelivea
Date: Fri Jun 21 17:50:29 2019
New Revision: 272559

URL: https://gcc.gnu.org/viewcvs?rev=272559&root=gcc&view=rev
Log:
PR c++/90875 - added -Wswitch-outside-range option

* doc/invoke.texi (Wswitch-outside-range): Document.

* c.opt (Wswitch-outside-range): Added new option.
* c-warn.c (c_do_switch_warnings): Use OPT_Wswitch-outside-range.

* c-c++-common/Wswitch-outside-range-1.c: New test.
* c-c++-common/Wswitch-outside-range-2.c: New test.
* c-c++-common/Wswitch-outside-range-3.c: New test.
* c-c++-common/Wswitch-outside-range-4.c: New test.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-warn.c
trunk/gcc/c-family/c.opt
trunk/gcc/doc/invoke.texi
trunk/gcc/testsuite/ChangeLog

[Bug libstdc++/90920] [9 Regression] ABI incompatibility in std::rotate

2019-06-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90920

--- Comment #6 from Jonathan Wakely  ---
Author: redi
Date: Fri Jun 21 17:37:07 2019
New Revision: 272558

URL: https://gcc.gnu.org/viewcvs?rev=272558&root=gcc&view=rev
Log:
PR libstdc++/90920 restore previous checks for empty ranges

The change in r263433 broke the contract of the __rotate functions, by no
longer accepting empty ranges. That means that callers which inlined the
old version of std::rotate (without checks) that end up linking to a new
definition of std::__rotate (also without checks) could perform a divide
by zero and crash.

This restores the old contract of the __rotate overloads.

Backport from mainline
2019-06-19  Jonathan Wakely  

PR libstdc++/90920 partially revert r263433
* include/bits/stl_algo.h (__rotate): Restore checks for empty ranges.
(rotate): Remove checks.
* testsuite/25_algorithms/rotate/90920.cc: New test.

Added:
branches/gcc-9-branch/libstdc++-v3/testsuite/25_algorithms/rotate/90920.cc
Modified:
branches/gcc-9-branch/libstdc++-v3/ChangeLog
branches/gcc-9-branch/libstdc++-v3/include/bits/stl_algo.h

[Bug target/90912] Thread-local storage not working properly when compiling code with -fPIC and optimization on Solaris

2019-06-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90912

--- Comment #6 from Andrew Pinski  ---
(In reply to Ondřej Surý from comment #5)
> 
> That said, we did this and it has been already fixed in GCC via PR84010.

How so?  That PR is for sparc, the patches are against sparc too.

[Bug c++/78722] noexcept and function pointers

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78722

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
This is accepted with both -std=c++14 and c++17.

[Bug c++/90960] declaring a member function with a computed typedef is confused as a data member definition

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90960

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
The second problem is, I think, essentially a dup of 90731.

[Bug fortran/51991] Wrong error message with variables named "SAVE*"

2019-06-21 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51991

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|NEW |RESOLVED
 CC||kargl at gcc dot gnu.org
 Resolution|--- |FIXED
   Assignee|unassigned at gcc dot gnu.org  |kargl at gcc dot gnu.org
   Target Milestone|--- |10.0

--- Comment #14 from kargl at gcc dot gnu.org ---
Patch from comment #9 was finally committed to trunk.
I have no idea why I let it linger in bugzilla for 
so long.  Sorry about the long delay.  Thanks for the
bug report.

[Bug fortran/51991] Wrong error message with variables named "SAVE*"

2019-06-21 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51991

--- Comment #13 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Fri Jun 21 16:57:24 2019
New Revision: 272556

URL: https://gcc.gnu.org/viewcvs?rev=272556&root=gcc&view=rev
Log:
2019-06-21  Steven G. Kargl  

PR fortran/51991
* decl.c (gfc_match_save): If SAVE was not seen, return MATCH_NO
instead issuing an error message and returning MATCH_ERROR.

2019-06-21  Steven G. Kargl  

PR fortran/51991
gfortran.dg/pr51991.f90

Added:
trunk/gcc/testsuite/gfortran.dg/pr51991.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/decl.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/49332] [C++0x] noexcept ignored on function pointer

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49332

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek  ---
This still compiles without errors in C++11, but in C++17:

49332.C:4:24: error: invalid conversion from ‘void (*)()’ to ‘void (*)()
noexcept’ [-fpermissive]
4 | void (*p)() noexcept = f; // { dg-error "" }
  |^
  ||
  |void (*)()

[Bug tree-optimization/90883] Generated code is worse if returned struct is unnamed

2019-06-21 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90883

--- Comment #8 from Jeffrey A. Law  ---
Oh, yea, I kept looking at this from a DSE lens in which case it's the earlier
store that is partially dead.

But if we're storing the same value, then the latter store is totally dead and
removing the latter store is a better choice.

This might actually be fairly easy to implement, let me poke around a bit.

WRT the padding byte and the unaligned issues.  We try to keep the head of an
area aligned, but it's much less important for the tail.  And I even poked at
things in the debugger and having DSE ignore that padding byte doesn't really
help.  Really the way to go is to realize the second store is redundant because
it's storing the exact same values as the earlier store.

[Bug tree-optimization/90949] [9 Regression] null pointer check removed

2019-06-21 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90949

Jeffrey A. Law  changed:

   What|Removed |Added

Summary|[9/10 Regression] null  |[9 Regression] null pointer
   |pointer check removed   |check removed

--- Comment #8 from Jeffrey A. Law  ---
Fixed on trunk so far.  I'll backport to gcc-9 after a few days.  I'll also
evaluate if we need this in gcc-8 as well (I suspect yes, even if the bug is
currently latent there).

[Bug tree-optimization/90949] [9/10 Regression] null pointer check removed

2019-06-21 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90949

--- Comment #7 from Jeffrey A. Law  ---
Author: law
Date: Fri Jun 21 16:36:00 2019
New Revision: 272555

URL: https://gcc.gnu.org/viewcvs?rev=272555&root=gcc&view=rev
Log:
PR tree-optimization/90949
* tree-ssa-copy.c (fini_copy_prop): Use reset_flow_sensitive_info.
* tree-ssanames.c (reset_flow_sensitive_info): Reset non-null state.

* gcc.c-torture/execute/pr90949.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr90949.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-copy.c
trunk/gcc/tree-ssanames.c

[Bug c++/90960] New: declaring a member function with a computed typedef is confused as a data member definition

2019-06-21 Thread alisdairm at me dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90960

Bug ID: 90960
   Summary: declaring a member function with a computed typedef is
confused as a data member definition
   Product: gcc
   Version: 9.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alisdairm at me dot com
  Target Milestone: ---

Note that this bug is a real corner case unlikely to occur in production code,
but bit us in experimental coding.  In fact, there are two bugs lurking in this
report (single test case), but it feels too obscure to tie up two issues!

The following program should compile equivalently, regardless of the definition
of the SHOW_BUG macro:

#include 

#define SHOW_ERROR 1

using namespace std;

template 
struct why_me {

#if defined(SHOW_ERROR)
   using what_the = conditional_t, void() noexcept, void()>;
#else
   using what_the = void() noexcept(is_const_v);
#endif

   what_the heck;
};

template 
void why_me::heck() noexcept(is_const_v) {}

int main() {
   why_me x = {};
   x.heck();

   why_me y = {};
   y.heck();
}


However, when SHOW_ERROR is defined, we get the following errors:

to_heck_with_it.cpp:20:6: error: no declaration matches 'void
why_me::heck()'
   20 | void why_me::heck() noexcept(is_const_v) {}
  |  ^
to_heck_with_it.cpp:16:13: note: candidate is: 'why_me::what_the
why_me::heck'
   16 |what_the heck;
  | ^~~~
to_heck_with_it.cpp:8:8: note: 'struct why_me' defined here
8 | struct why_me {
  |^~
to_heck_with_it.cpp: In instantiation of 'struct why_me':
to_heck_with_it.cpp:23:16:   required from here
to_heck_with_it.cpp:16:13: error: field 'why_me::heck' invalidly declared
function type
   16 |what_the heck;
  | ^~~~

It is not clear why the last error claims a function type is invalid here (I
believe it should be).


However, there is a second bug lurking when we do not define SHOW_ERROR (the
program compiles cleanly on other compilers):

to_heck_with_it.cpp:20:6: error: declaration of 'void why_me::heck()
noexcept (is_const_v)' has a different exception specifier
   20 | void why_me::heck() noexcept(is_const_v) {}
  |  ^
to_heck_with_it.cpp:16:13: note: from previous declaration 'void
why_me::heck()'
   16 |what_the heck;
  | ^~~~

Here, the exception specifications are clearly the same, as they are even
spelled the same, so the error is just wrong.

[Bug target/90912] Thread-local storage not working properly when compiling code with -fPIC and optimization on Solaris

2019-06-21 Thread ondrej at sury dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90912

--- Comment #5 from Ondřej Surý  ---
(In reply to Andrew Pinski from comment #4)
> Well GCC is producing correct code is GNU LD works with it.

No, not really.

> Report this bug to Sun^wOracle instead.

That said, we did this and it has been already fixed in GCC via PR84010.

[Bug middle-end/90959] New: hash_map can be copied but leads to a double-free after assignment

2019-06-21 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90959

Bug ID: 90959
   Summary: hash_map can be copied but leads to a double-free
after assignment
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

While beefing up the tests for bug 90923 I came across yet another bug in
hash_map.  The container defines a copy ctor but no assignment operator, and so
while copying a container of PODs seems to do the right thing, assigning one to
another makes them share storage and ultimately leads to a double free.  Below
is a simple test case that demonstrates this:

  {
typedef hash_map  Map;

{
  Map m1;
  void *p = &p;
  m1.put (p, 1);

  Map m2;
  m2 = m1;
}

Map m3;
  }
double free or corruption (!prev)
cc1: internal compiler error: Aborted
0x11a4b99 crash_signal
/src/gcc/git-svn/gcc/toplev.c:326
0x21447f9 xcallocator, int>
>::hash_entry>::data_free(hash_map, int> >::hash_entry*)
/src/gcc/git-svn/gcc/hash-table.h:282
0x21439ab hash_table, int> >::hash_entry, false,
xcallocator>::~hash_table()
/src/gcc/git-svn/gcc/hash-table.h:677
0x2143421 hash_map, int> >::~hash_map()
/src/gcc/git-svn/gcc/hash-map.h:30
0x2140e18 test_map_of_type_with_ctor_and_dtor
/src/gcc/git-svn/gcc/hash-map-tests.c:152
0x2141e3d selftest::hash_map_tests_c_tests()
/src/gcc/git-svn/gcc/hash-map-tests.c:257
0x20da1c5 selftest::run_tests()
/src/gcc/git-svn/gcc/selftest-run-tests.c:64
0x11a89ec toplev::run_self_tests()
/src/gcc/git-svn/gcc/toplev.c:2273

[Bug libstdc++/81797] gcc 7.1.0 fails to build on macOS 10.13 (High Sierra):

2019-06-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797

--- Comment #81 from Jonathan Wakely  ---
Basically we think there's a bug in the APFS filesystem, nobody can reproduce
it on other systems, none of us have access to such a system. It would be
really helpful if somebody seeing the error could investigate and tell us more
than "it still fails for me".

[Bug libstdc++/81797] gcc 7.1.0 fails to build on macOS 10.13 (High Sierra):

2019-06-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797

--- Comment #80 from Jonathan Wakely  ---
And the headers in $target/libstdc++-v3/include/bits are now regular files, not
symlinks?

[Bug ada/90958] New: Recent versions of GCC raise CONSTRAINT_ERROR at runtime for iterator loops with nested constrained records.

2019-06-21 Thread lburke at labprogramming dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90958

Bug ID: 90958
   Summary: Recent versions of GCC raise CONSTRAINT_ERROR at
runtime for iterator loops with nested constrained
records.
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ada
  Assignee: unassigned at gcc dot gnu.org
  Reporter: lburke at labprogramming dot net
  Target Milestone: ---

Here is source code that shows the problem:

procedure GNAT.IO.T is
  type Variant (Has : Boolean := False) is
record
  case Has is
when True => I : Integer;
when False => F : Float;
  end case;
end record;

  type VArray is array (Positive range <>) of Variant;

  type VRec (Size : Natural) is
record
  Arr : VArray (1 .. Size);
end record;

  type VRec2 (Size : Natural) is
record
  Underlying : VRec (Size);
end record;  

  procedure Test (Input : in out VRec2) is
  begin
for X of Input.Underlying.Arr loop
  if X.Has then
X.I := X.I + 1;
  end if;
end loop;
  end Test;

  Data : VArray (1 .. 3) := (
1 => (Has => True, I => 10),
2 => (Has => False, F => 10.0),
3 => (Has => True, I => 20));
  Rec : VRec := (Size => 3, Arr => Data);
  Rec2 : VRec2 := (Size => 3, Underlying => Rec);
begin
  Test (Rec2);
  Put_Line (Rec2.Underlying.Arr (3).I'Img);
end GNAT.IO.T;

Result (from compilation to run):

[ ~/test/ada/fresh ]
louis@Wolvog $ gcc -v -save-temps -c test.adb
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-lto --enable-plugin --enable-install-libiberty
--with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib
--disable-werror --enable-checking=release --enable-default-pie
--enable-default-ssp --enable-cet=auto
Thread model: posix
gcc version 9.1.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/gnat1 -quiet -dumpbase test.adb
-auxbase test -mtune=generic -march=x86-64 test.adb -o test.s
test.adb:1:18: warning: file name does not match unit name, should be
"g-io-t.adb"
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-mtune=generic' '-march=x86-64'
 as -v --64 -o test.o test.s
GNU assembler version 2.32 (x86_64-pc-linux-gnu) using BFD version (GNU
Binutils) 2.32
COMPILER_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-mtune=generic' '-march=x86-64'
[ ~/test/ada/fresh ]
louis@Wolvog $ ls
test.adb  test.ali  test.o  test.s
[ ~/test/ada/fresh ]
louis@Wolvog $ gnatbind -v -x test.ali
gnatbind -v -x test.ali

GNATBIND 9.1.0
Copyright (C) 1995-2019, Free Software Foundation, Inc.

Binding: test.ali

No errors
[ ~/test/ada/fresh ]
louis@Wolvog $ gnatlink -v test.ali -o test

GNATLINK 9.1.0
Copyright (C) 1995-2019, Free Software Foundation, Inc.
gnatlink: warning: executable name "test" may conflict with shell command
gcc -c -mtune=generic -march=x86-64 -gnatA -gnatWb -gnatiw -gnatws
/home/louis/test/ada/fresh/b~test.adb
/usr/bin/gcc b~test.o ./test.o -o test -L./
-L/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/adalib/
/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/adalib/libgnat.a -ldl -static-libgcc
[ ~/test/ada/fresh ]
louis@Wolvog $ ./test

raised CONSTRAINT_ERROR : test.adb:24 discriminant check failed


Here is code that should be functionally similar, but doesn't raise the error:

procedure GNAT.IO.T is
  type Variant (Has : Boolean := False) is
record
  case Has is
when True => I : Integer;
when False => F : Float;
  end case;
end record;

  type VArray is array (Positive range <>) of Variant;

  type VRec (Size : Natural) is
record
  Arr : VArray (1 .. Size);
end record;

  type VRec2 (Size : Natural) is
record
  Underlying : VRec (Size);
end record;

  procedure Test (Input : in out VRec2) is
  begin
for I in Input.Underlying.Arr'Range loop
  declare
X : Variant renames Input.Underlying.Arr (I);
  begin
if X.Has then
  X.I := X.I + 1;

[Bug c++/90953] [10 Regression] ICE: tree check: expected identifier_node, have tree_list in is_attribute_p, at attribs.h:155 since r272486

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90953

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #4 from Marek Polacek  ---
Fixed.

[Bug c++/90953] [10 Regression] ICE: tree check: expected identifier_node, have tree_list in is_attribute_p, at attribs.h:155 since r272486

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90953

--- Comment #3 from Marek Polacek  ---
Author: mpolacek
Date: Fri Jun 21 14:41:22 2019
New Revision: 272552

URL: https://gcc.gnu.org/viewcvs?rev=272552&root=gcc&view=rev
Log:
PR c++/90953 - ICE with -Wmissing-format-attribute.
* c-common.c (check_function_arguments_recurse): Use
get_attribute_name.
(check_missing_format_attribute): Likewise.

* g++.dg/warn/miss-format-7.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/warn/miss-format-7.C
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-common.c
trunk/gcc/testsuite/ChangeLog

[Bug lto/90957] 453.povray is miscompiled with -flto -static

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90957

Richard Biener  changed:

   What|Removed |Added

   Keywords||lto, wrong-code

--- Comment #1 from Richard Biener  ---
It might in the end be a linker issue - did you try with both gold and bfd? 
Did you try with the linker plugin?

[Bug tree-optimization/90930] Excessive memory consumption

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90930

Richard Biener  changed:

   What|Removed |Added

URL||https://gcc.gnu.org/ml/gcc-
   ||patches/2019-06/msg01316.ht
   ||ml

--- Comment #7 from Richard Biener  ---
Patch posted.

[Bug lto/90957] New: 453.povray is miscompiled with -flto -static

2019-06-21 Thread mkuvyrkov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90957

Bug ID: 90957
   Summary: 453.povray is miscompiled with -flto -static
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mkuvyrkov at gcc dot gnu.org
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 46509
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46509&action=edit
Script to reproduce

453.povray is miscompiled with -static -flto on arm-linux-gnueabihf.  The
failure confirmed vs trunk and gcc-8-branch, didn't check other releases.

Failure seems to occur only when both -static -flto are used together; -Ox
flags don't affect the outcome.

I've reduce the problem to a single object povms.o.  The failure occurs when
povms.o is compiled with "-flto -static" and the rest of benchmark is compiled
with "-static".  Compiling povms.o with "-static" makes the failure go away.

Attached is a script to reproduce: it uses Arm's pre-built cross-toolchain as
base install and replaces compiler with a freshly built one.  You need to
supply your own sources of 453.povray and an aarch32 machine.  Tested on armv7,
but armv8 should do as well.

# Produce good binary
./povray-build.sh true

# Produce bad binary
./povray-build.sh false

[Bug tree-optimization/90930] Excessive memory consumption

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90930

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #6 from Richard Biener  ---
OK, so this is

UA_StatusCode ua_namespace0(UA_Server *server) {
UA_StatusCode retVal = 0x00;

UA_UInt16 ns[1];
ns[0] = UA_Server_addNamespace(server, "http://opcfoundation.org/UA/";);
retVal |= function_ua_namespace0_0_begin(server, ns);
retVal |= function_ua_namespace0_1_begin(server, ns);
retVal |= function_ua_namespace0_2_begin(server, ns);
retVal |= function_ua_namespace0_3_begin(server, ns);
...
retVal |= function_ua_namespace0_3832_begin(server, ns);
retVal |= function_ua_namespace0_3833_begin(server, ns);
retVal |= function_ua_namespace0_3834_begin(server, ns);
retVal |= function_ua_namespace0_3834_finish(server, ns);
retVal |= function_ua_namespace0_3833_finish(server, ns);
retVal |= function_ua_namespace0_3832_finish(server, ns);
retVal |= function_ua_namespace0_3831_finish(server, ns);
...
retVal |= function_ua_namespace0_3_finish(server, ns);
retVal |= function_ua_namespace0_2_finish(server, ns);
retVal |= function_ua_namespace0_1_finish(server, ns);
retVal |= function_ua_namespace0_0_finish(server, ns);
return retVal;
}

And on aarch64 before reassoc we have

_69005 = _80495 | _80496;
_26564 = MEM[(UA_UInt16 *)&ns];
_22992 = function_ua_namespace0_7_finish.isra.0 (server_3(D), _26564);
_26565 = MEM[(UA_UInt16 *)&ns];
_22995 = function_ua_namespace0_6_finish.isra.0 (server_3(D), _26565);
_69006 = _22995 | _22992;
_57512 = _69005 | _69006;

thus non-left-associative |s which we first linearize and then
re-write into two-assoc-width.  The latter process is what leaves
stmts not marked as visited and thus we re-process things over and over...

reproducible on x86 with --param tree-reassoc-width=2.

 tree reassociation :  23.01 ( 55%)   8.65 ( 57%)  31.25 ( 55%)
 444709 kB ( 64%)

and with the fix:

 tree reassociation :   0.04 (  1%)   0.02 (  8%)   0.06 (  1%)
949 kB (  7%)

[Bug debug/90914] [9 Regression] ICE in schedule_generic_params_dies_gen, at dwarf2out.c:27153

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90914

Richard Biener  changed:

   What|Removed |Added

  Known to work|9.1.0   |10.0
Summary|[9/10 Regression] ICE in|[9 Regression] ICE in
   |schedule_generic_params_die |schedule_generic_params_die
   |s_gen, at dwarf2out.c:27153 |s_gen, at dwarf2out.c:27153
  Known to fail|10.0|9.1.0

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

[Bug debug/90914] [9 Regression] ICE in schedule_generic_params_dies_gen, at dwarf2out.c:27153

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90914

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Fri Jun 21 13:56:54 2019
New Revision: 272547

URL: https://gcc.gnu.org/viewcvs?rev=272547&root=gcc&view=rev
Log:
2019-06-21  Richard Biener  

PR debug/90914
* dwarf2out.c (prune_unused_types_walk): Always consider
function-local extern declarations as used.

* g++.dg/debug/pr90914.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/debug/pr90914.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog

[Bug libstdc++/81797] gcc 7.1.0 fails to build on macOS 10.13 (High Sierra):

2019-06-21 Thread dam at cosinux dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797

--- Comment #79 from Damien Merenne  ---
not -j1. Only the LN_S trick.

[Bug c/90956] New: Failed on the PRINT

2019-06-21 Thread oferco at inter dot net.il
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90956

Bug ID: 90956
   Summary: Failed on the PRINT
   Product: gcc
   Version: 5.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: oferco at inter dot net.il
  Target Milestone: ---

Created attachment 46508
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46508&action=edit
Code

Arduino: 1.8.9 (Windows 8.1), Board: "Arduino Nano, ATmega328P"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine
-hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files
(x86)\Arduino\tools-builder -tools C:\Program Files
(x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files
(x86)\Arduino\libraries -libraries
C:\Users\ToshibaPc\Documents\Arduino\libraries
-fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10809
-build-path C:\Users\TOSHIB~1\AppData\Local\Temp\arduino_build_826290
-warnings=all -build-cache
C:\Users\TOSHIB~1\AppData\Local\Temp\arduino_cache_410673
-prefs=build.warn_data_percentage=75
-prefs=runtime.tools.avr-gcc.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program
Files (x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.arduinoOTA.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr -verbose
C:\Users\ToshibaPc\Documents\Irrigator\SW\Orchard\RemoteUnit\RemoteUnit.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine
-hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files
(x86)\Arduino\tools-builder -tools C:\Program Files
(x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files
(x86)\Arduino\libraries -libraries
C:\Users\ToshibaPc\Documents\Arduino\libraries
-fqbn=arduino:avr:nano:cpu=atmega328 -vid-pid=1A86_7523 -ide-version=10809
-build-path C:\Users\TOSHIB~1\AppData\Local\Temp\arduino_build_826290
-warnings=all -build-cache
C:\Users\TOSHIB~1\AppData\Local\Temp\arduino_cache_410673
-prefs=build.warn_data_percentage=75
-prefs=runtime.tools.avr-gcc.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program
Files (x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.arduinoOTA.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr
-prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files
(x86)\Arduino\hardware\tools\avr -verbose
C:\Users\ToshibaPc\Documents\Irrigator\SW\Orchard\RemoteUnit\RemoteUnit.ino
Using board 'nano' from platform in folder: C:\Program Files
(x86)\Arduino\hardware\arduino\avr
Using core 'arduino' from platform in folder: C:\Program Files
(x86)\Arduino\hardware\arduino\avr
Detecting libraries used...
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os
-w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections
-fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E
-CC -mmcu=atmega328p -DF_CPU=1600L -DARDUINO=10809 -DARDUINO_AVR_NANO
-DARDUINO_ARCH_AVR "-IC:\\Program Files
(x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files
(x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs"
"C:\\Users\\TOSHIB~1\\AppData\\Local\\Temp\\arduino_build_826290\\sketch\\RemoteUnit.ino.cpp"
-o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os
-w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections
-fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E
-CC -mmcu=atmega328p -DF_CPU=1600L -DARDUINO=10809 -DARDUINO_AVR_NANO
-DARDUINO_ARCH_AVR "-IC:\\Program Files
(x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files
(x86)\\Arduino\\hardware\\arduino\\avr\\variants\\eightanaloginputs"
"-IC:\\Program Files
(x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src"
"C:\\Users\\TOSHIB~1\\AppData\\Local\\Temp\\arduino_build_826290\\sketch\\RemoteUnit.ino.cpp"
-o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os
-w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections
-fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E
-CC -mmcu=atmega328p -DF_CPU=1600L -DARDUINO=10809 -DARDUINO_AVR_NANO
-DARDUINO_ARCH_AVR "-IC:\\Program Files
(x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files
(x86)\\Arduino\\hardware\\a

[Bug c++/90953] [10 Regression] ICE: tree check: expected identifier_node, have tree_list in is_attribute_p, at attribs.h:155 since r272486

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90953

--- Comment #2 from Marek Polacek  ---
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -7601,13 +7601,13 @@ check_missing_format_attribute (tree ltype, tree rtype)
   tree ra;

   for (ra = TYPE_ATTRIBUTES (ttr); ra; ra = TREE_CHAIN (ra))
-if (is_attribute_p ("format", TREE_PURPOSE (ra)))
+if (is_attribute_p ("format", get_attribute_name (ra)))
   break;
   if (ra)
 {
   tree la;
   for (la = TYPE_ATTRIBUTES (ttl); la; la = TREE_CHAIN (la))
-   if (is_attribute_p ("format", TREE_PURPOSE (la)))
+   if (is_attribute_p ("format", get_attribute_name (la)))
  break;
   return !la;
 }

[Bug c++/90953] [10 Regression] ICE: tree check: expected identifier_node, have tree_list in is_attribute_p, at attribs.h:155 since r272486

2019-06-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90953

--- Comment #1 from Martin Liška  ---
Test-case:

$ cat jit.ii
namespace std {
union [[gnu::may_alias]] _Any_data{};
enum _Manager_operation { __get_type_info };
template  class A;
class B {
  typedef bool (*_Manager_type)(_Any_data, const _Any_data &,
_Manager_operation);
  _Any_data _M_functor;
  _Manager_type _M_manager;
};
template 
class A<_Res(_ArgTypes...)> : B {
  const type_info &target_type() const noexcept;
};
template 
const type_info &A<_Res(_ArgTypes...)>::target_type() const noexcept {
  _Any_data __typeinfo_result;
  _M_manager(__typeinfo_result, _M_functor, __get_type_info);
}
} // namespace std

[Bug c++/90953] [10 Regression] ICE: tree check: expected identifier_node, have tree_list in is_attribute_p, at attribs.h:155 since r272486

2019-06-21 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90953

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c++/90955] Wrong optimization: erroneous sum of compile-time constants

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90955

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

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

[Bug debug/90914] [9/10 Regression] ICE in schedule_generic_params_dies_gen, at dwarf2out.c:27153

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90914

Richard Biener  changed:

   What|Removed |Added

   Priority|P1  |P2
   Target Milestone|10.0|9.2
Summary|[10 Regression] ICE in  |[9/10 Regression] ICE in
   |schedule_generic_params_die |schedule_generic_params_die
   |s_gen, at dwarf2out.c:27153 |s_gen, at dwarf2out.c:27153

--- Comment #4 from Richard Biener  ---
Testing patch.  The issue is latent in 9.1.

[Bug c++/90955] Wrong optimization: erroneous sum of compile-time constants

2019-06-21 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90955

--- Comment #1 from Andrew Pinski  ---
Yes this is one of the most obvious violations of aliasing rules.  Note the
strict alias warnings in recent versions been removed as they providing too
many false positives.

Use either -fno-strict-aliasing or have an array of uint16_t and do memcpy
instead.

[Bug c++/87820] Explicit user-defined casting inside a template class working in implicit conversion inside function template

2019-06-21 Thread ExtComm.CODA at dlr dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87820

--- Comment #1 from ExtComm.CODA at dlr dot de ---
clang and intel-compiler don't fail

[Bug c++/55101] Invalid implicit conversion in initialization when source type is a template argument type

2019-06-21 Thread ExtComm.CODA at dlr dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55101

--- Comment #1 from ExtComm.CODA at dlr dot de ---
g++ (GCC) 7.3.0:  fails too

[Bug debug/90914] [10 Regression] ICE in schedule_generic_params_dies_gen, at dwarf2out.c:27153

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90914

--- Comment #3 from Richard Biener  ---
Similar to unused type pruning we have to preserve externs local to functions
since they'll be regenerated otherwise.

Index: gcc/dwarf2out.c
===
--- gcc/dwarf2out.c (revision 272545)
+++ gcc/dwarf2out.c (working copy)
@@ -29418,6 +29418,10 @@ prune_unused_types_walk (dw_die_ref die)
  if (die->die_perennial_p)
break;

+ for (c = die->die_parent; c; c = c->die_parent)
+   if (c->die_tag == DW_TAG_subprogram)
+ break;
+
  /* premark_used_variables marks external variables --- don't mark
 them here.  */
  if (get_AT (die, DW_AT_external))

[Bug c++/90955] New: Wrong optimization: erroneous sum of compile-time constants

2019-06-21 Thread lists at xandea dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90955

Bug ID: 90955
   Summary: Wrong optimization: erroneous sum of compile-time
constants
   Product: gcc
   Version: 9.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: lists at xandea dot de
  Target Milestone: ---

Created attachment 46507
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46507&action=edit
minimum working example, preprocessed

Optimisation removes accumulated constant members of a struct and replaces them
with a compile-time calculated constant. However, this constant is wrong and
the functions computes a wrong result.

The error disappears when compiling without optimisation (-O0), or accessing
the struct (e.g. ::printf("%p\n", start); ) in the function, or using
std::memcpy to temporary buffer instead of reinterpret_cast. This could be a
strict-aliasing issue, but no warning is generated.

The preprocessed code is the same for GCC 6.3.0 (from Debian) and 9.1.0 (built
locally).

Originally, this issue appeared in IPv4 pseudo header calculation related to
the UDP checksum, but I removed the unneeded struct members and operations.

user@host:/tmp$ /run/shm/prefix-gcc-9.1/bin/g++ -v -save-temps -std=c++14 -g
-O3 -Wall -pedantic -Wextra -Wstrict-aliasing bug.cpp -o bug
Using built-in specs.
COLLECT_GCC=/run/shm/prefix-gcc-9.1/bin/g++
COLLECT_LTO_WRAPPER=/dev/shm/prefix-gcc-9.1/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-9.1.0/configure --enable-languages=c,c++
--disable-multilib --prefix=/run/shm/prefix-gcc-9.1
Thread model: posix
gcc version 9.1.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++14' '-g' '-O3' '-Wall'
'-Wpedantic' '-Wextra' '-Wstrict-aliasing' '-o' 'bug' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /dev/shm/prefix-gcc-9.1/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.1.0/cc1plus
-E -quiet -v -imultiarch x86_64-linux-gnu -iprefix
/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0/ -D_GNU_SOURCE
bug.cpp -mtune=generic -march=x86-64 -std=c++14 -Wall -Wpedantic -Wextra
-Wstrict-aliasing -g -fworking-directory -O3 -fpch-preprocess -o bug.ii
ignoring nonexistent directory
"/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory
"/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0"
ignoring duplicate directory
"/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-pc-linux-gnu"
ignoring duplicate directory
"/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward"
ignoring duplicate directory
"/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/9.1.0/include"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring duplicate directory
"/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/9.1.0/include-fixed"
ignoring nonexistent directory
"/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0

/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-pc-linux-gnu

/dev/shm/prefix-gcc-9.1/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward
 /dev/shm/prefix-gcc-9.1/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0/include
 /dev/shm/prefix-gcc-9.1/bin/../lib/gcc/x86_64-pc-linux-gnu/9.1.0/include-fixed
 /usr/local/include
 /dev/shm/prefix-gcc-9.1/bin/../lib/gcc/../../include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++14' '-g' '-O3' '-Wall'
'-Wpedantic' '-Wextra' '-Wstrict-aliasing' '-o' 'bug' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'
 /dev/shm/prefix-gcc-9.1/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.1.0/cc1plus
-fpreprocessed bug.ii -quiet -dumpbase bug.cpp -mtune=generic -march=x86-64
-auxbase bug -g -O3 -Wall -Wpedantic -Wextra -Wstrict-aliasing -std=c++14
-version -o bug.s
GNU C++14 (GCC) version 9.1.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 9.1.0, GMP version 6.1.0, MPFR version 3.1.4, MPC
version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++14 (GCC) version 9.1.0 (x86_64-pc-linux-gnu)
compiled by GNU C version 9.1.0, GMP version 6.1.0, MPFR version 3.1.4, MPC
version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable che

[Bug middle-end/24639] [meta-bug] bug to track all Wuninitialized issues

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
Bug 24639 depends on bug 89296, which changed state.

Bug 89296 Summary: [7 Regression] tree copy-header masking uninitialized warning
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89296

   What|Removed |Added

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

[Bug tree-optimization/89296] [7 Regression] tree copy-header masking uninitialized warning

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89296

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #7 from Richard Biener  ---
I was going to backport to the 7 branch.

[Bug tree-optimization/90883] Generated code is worse if returned struct is unnamed

2019-06-21 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90883

--- Comment #7 from rguenther at suse dot de  ---
On Tue, 18 Jun 2019, law at redhat dot com wrote:

> slow ()
> {
>   struct C D.25898;
>   struct C D.29462;
> 
> ;;   basic block 2, loop depth 0, count 1073741824 (estimated locally), maybe
> hot
> ;;prev block 0, next block 1, flags: (NEW, REACHABLE, VISITED)
> ;;pred:   ENTRY [always]  count:1073741824 (estimated locally)
> (FALLTHRU,EXECUTABLE)
>   D.25898.a = {};
>   D.29462 = D.25898;
>   D.25898 ={v} {CLOBBER};
>   return D.29462;
> ;;succ:   EXIT [always]  count:1073741824 (estimated locally)
> 
> }
> 
> WHich still isn't sufficient to get good code.
> 
> I'm not really sure what you want DSE to do here Richi :-)

I observed that

  D.26322 = {};
  D.26322.a = {};

looks like that the later store is dead (a C testcase showing actual
layout might be nice here).  Of course DSE doesn't work this way
around but trimming might be able to trim the second store instead of
the first (to nothing)?  I also noticed that

  MEM[(struct C *)&D.26322 + 7B] = {};
  D.26322.a = {};

here the first store is at offset 7 which will result in unaligned
and or small stores.  DSE doesn't seem to exploit the fact that
we do not need to preserve the stores into the padding (in fact
we do not expand that way I think).

Given that -fno-tree-dse produces nearly optimal code
(well, RTL manages to clean up all the useless stuff) some of
the above might help.

[Bug middle-end/88784] Middle end is missing some optimizations about unsigned

2019-06-21 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784

--- Comment #28 from rguenther at suse dot de  ---
On Tue, 18 Jun 2019, helijia at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88784
> 
> --- Comment #27 from Li Jia He  ---
> Created attachment 46495
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46495&action=edit
> [v2] try to fix this issue in ifcombine(and_comparisons_1 and 
> or_comparisons_1)
> 
> This patch is similar to the previous patch, try to fix this issue in
> ifcombine(and_comparisons_1 and or_comparisons_1). Would you like to help me
> see what kind of question this patch might have again ?

It looks reasonable from a quick look.  Please post patches to 
gcc-patc...@gcc.gnu.org though.

[Bug tree-optimization/90913] [10 Regression] ICE in maybe_gen_insn, at optabs.c:7341 since r272239

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90913

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #10 from Richard Biener  ---
Should be fixed now.

[Bug sanitizer/90954] ICE: combining undefined behavior sanitizer with openmp

2019-06-21 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90954

--- Comment #1 from Martin Liška  ---
Confirmed, it's old, starting with GCC 4.9.0 where -fsanitize=undefined was
added. Can you please Jakub take a look?

[Bug middle-end/26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
Bug 26163 depends on bug 90913, which changed state.

Bug 90913 Summary: [10 Regression] ICE in maybe_gen_insn, at optabs.c:7341 
since r272239
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90913

   What|Removed |Added

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

[Bug c++/90951] [8/9/10 Regression] error initializing a constexpr array of a struct with const member

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90951

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |8.4

[Bug c++/90953] [10 Regression] ICE: tree check: expected identifier_node, have tree_list in is_attribute_p, at attribs.h:155 since r272486

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90953

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P1

[Bug tree-optimization/90913] [10 Regression] ICE in maybe_gen_insn, at optabs.c:7341 since r272239

2019-06-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90913

--- Comment #9 from Richard Biener  ---
Author: rguenth
Date: Fri Jun 21 11:10:39 2019
New Revision: 272545

URL: https://gcc.gnu.org/viewcvs?rev=272545&root=gcc&view=rev
Log:
2019-06-21  Richard Biener  

PR tree-optimization/90913
* tree-vect-loop-manip.c (vect_loop_versioning): Do not re-use
the scalar variant of if-conversion versioning.

* gfortran.dg/vect/pr90913.f90: New testcase.

Added:
trunk/gcc/testsuite/gfortran.dg/vect/pr90913.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vect-loop-manip.c

[Bug libstdc++/81797] gcc 7.1.0 fails to build on macOS 10.13 (High Sierra):

2019-06-21 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797

--- Comment #78 from Jonathan Wakely  ---
And is that using LN_S="cp -pR" ? And -j1 ?

  1   2   >