[Bug tree-optimization/61247] vectorization fails for unsigned is used for IV but casted to int before using as the index (and then casted for internal type)

2016-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61247

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
Summary|vectorization fails if  |vectorization fails for
   |conversion from unsigned|unsigned is used for IV but
   |int to signed int is|casted to int before using
   |involved|as the index (and then
   ||casted for internal type)
   Severity|minor   |enhancement

--- Comment #2 from Andrew Pinski  ---
t999.cc:12:17: note: not vectorized: data ref analysis failed _4 = *_18;
t999.cc:12:17: note: bad data references.
Creating dr for *_18
analyze_innermost: failed: evolution of base is not affine.
base_address:
offset from base address:
constant offset from base address:
step:
aligned to:
base_object: *_18

[Bug c++/78011] [DR325] Compiler error when initializing a member of template type where the second template argument is a typedef

2016-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78011

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE
   Target Milestone|5.5 |---
Summary|Compiler error when |[DR325] Compiler error when
   |initializing a member of|initializing a member of
   |template type where the |template type where the
   |second template argument is |second template argument is
   |a typedef   |a typedef

--- Comment #5 from Andrew Pinski  ---
DR 325 also applies here.

Actually this is a dup of bug 52595 since that was fixed in GCC 6.  Anyways the
C++ standard is not fully clear here :).

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

[Bug c++/52595] [DR 325] commas and non-static data member initializers don't mix

2016-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52595

Andrew Pinski  changed:

   What|Removed |Added

 CC||b.stanimirov at abv dot bg

--- Comment #14 from Andrew Pinski  ---
*** Bug 78011 has been marked as a duplicate of this bug. ***

[Bug c++/78011] Compiler error when initializing a member of template type where the second template argument is a typedef

2016-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78011

--- Comment #4 from Andrew Pinski  ---
PR 52595

[Bug c++/78011] Compiler error when initializing a member of template type where the second template argument is a typedef

2016-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78011

--- Comment #3 from Andrew Pinski  ---
PR 57

[Bug c++/78011] Compiler error when initializing a member of template type where the second template argument is a typedef

2016-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78011

--- Comment #2 from Andrew Pinski  ---
There is most likely a dup about this bug.  (Oh and a C++ defect report; the
comma is confusing things).

[Bug fortran/48298] [F03] User-Defined Derived-Type IO (DTIO)

2016-10-17 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48298

--- Comment #28 from Jerry DeLisle  ---
Author: jvdelisle
Date: Tue Oct 18 04:14:25 2016
New Revision: 241294

URL: https://gcc.gnu.org/viewcvs?rev=241294=gcc=rev
Log:
2016-10-17  Jerry DeLisle  

PR fortran/48298
* io/io.h: Move size_used from dtp to unit structure. Add bool
has_size to unit structure.
* read.c (read_x): Use has_size and size_used.
* transfer.c (read_sf_internal,read_sf,read_block_form,
read_block_form4): Likewise.
(data_transfer_init): If parent, initialize the size variables.
(finalize_transfer): Set the size variable using size_used in
gfc_unit. (write_block): Delete bogus/dead code.

* gfortran.dg/dtio_17.f90: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/dtio_17.f90
Modified:
trunk/gcc/testsuite/ChangeLog
trunk/libgfortran/ChangeLog
trunk/libgfortran/io/io.h
trunk/libgfortran/io/read.c
trunk/libgfortran/io/transfer.c

[Bug fortran/77978] stop codes misinterpreted in both f2003 and f2008

2016-10-17 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77978

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |5.5

--- Comment #7 from kargl at gcc dot gnu.org ---
Fixed on 5, 6, and 7.

[Bug fortran/77978] stop codes misinterpreted in both f2003 and f2008

2016-10-17 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77978

--- Comment #6 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon Oct 17 23:22:54 2016
New Revision: 241286

URL: https://gcc.gnu.org/viewcvs?rev=241286=gcc=rev
Log:
2016-10-17  Steven G. Kargl  

Backport from trunk
PR fortran/77978
* match.c (gfc_match_stopcode): Fix error reporting for several
deficiencies in matching stop-codes.

2016-10-17  Steven G. Kargl  

PR fortran/77978
* gfortran.dg/pr77978_1.f90: New test.
* gfortran.dg/pr77978_2.f90: Ditto.
* gfortran.dg/pr77978_3.f90: Ditto.

Added:
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/pr77978_1.f90
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/pr77978_2.f90
branches/gcc-5-branch/gcc/testsuite/gfortran.dg/pr77978_3.f90
Modified:
branches/gcc-5-branch/gcc/fortran/ChangeLog
branches/gcc-5-branch/gcc/fortran/match.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/77916] [6/7 Regression] ICE in verify_gimple_in_cfg: invalid (pointer) operands to plus/minus

2016-10-17 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77916

--- Comment #4 from Bill Schmidt  ---
Author: wschmidt
Date: Mon Oct 17 22:08:56 2016
New Revision: 241281

URL: https://gcc.gnu.org/viewcvs?rev=241281=gcc=rev
Log:
[gcc]

2016-10-17  Bill Schmidt  

PR tree-optimization/77916
* gimple-ssa-strength-reduction.c (create_add_on_incoming_edge):
Don't allow a MINUS_EXPR for pointer arithmetic for either known
or unknown strides.
(record_increment): Increments of -1 for unknown strides just use
a multiply initializer like other negative values.
(analyze_increments): Remove stopgap solution for -1 increment
applied to pointer arithmetic.

[gcc/testsuite]

2016-10-17  Bill Schmidt  

PR tree-optimization/77916
* gcc.dg/torture/pr77916.c: New.


Added:
trunk/gcc/testsuite/gcc.dg/torture/pr77916.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimple-ssa-strength-reduction.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/77978] stop codes misinterpreted in both f2003 and f2008

2016-10-17 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77978

--- Comment #5 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon Oct 17 21:29:31 2016
New Revision: 241280

URL: https://gcc.gnu.org/viewcvs?rev=241280=gcc=rev
Log:
2016-10-17  Steven G. Kargl  

PR fortran/77978
* match.c (gfc_match_stopcode): Fix error reporting for several
deficiencies in matching stop-codes.

2016-10-17  Steven G. Kargl  

PR fortran/77978
* gfortran.dg/pr77978_1.f90: New test.
* gfortran.dg/pr77978_2.f90: Ditto.
* gfortran.dg/pr77978_3.f90: Ditto.

Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/pr77978_1.f90
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/pr77978_2.f90
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/pr77978_3.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/match.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug c++/78014] -Wformat -vs- size_t

2016-10-17 Thread tromey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78014

--- Comment #3 from Tom Tromey  ---
(In reply to jos...@codesourcery.com from comment #2)

> Likewise an expression where the user did "typedef size_t my_size_t;" and 
> then used my_size_t.  And what about expressions resulting from arithmetic 
> on size_t values?  So it may be hard for the compiler to tell exactly what 
> expressions are appropriate for use with %zu (even without direct use of 
> __SIZE_TYPE__).

I think it's still preferable for gcc to be better about this even if it
can't be perfect.

First, in my particular case, I think all the types in question are just
"size_t" -- it's common to use this in spidermonkey.

Second, the problem I have is that I wanted to enable -Wformat.  So, I
wrote a bunch of patches -- which then failed to build on other arches.
In this case, if gcc had warned about size_t/%lu mixups in the code, while
perhaps I wouldn't have caught every possible cross-arch build bug, I
certainly would have far fewer of them.

[Bug fortran/77978] stop codes misinterpreted in both f2003 and f2008

2016-10-17 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77978

--- Comment #4 from kargl at gcc dot gnu.org ---
Author: kargl
Date: Mon Oct 17 19:57:12 2016
New Revision: 241279

URL: https://gcc.gnu.org/viewcvs?rev=241279=gcc=rev
Log:
2016-10-17  Steven G. Kargl  

PR fortran/77978
* match.c (gfc_match_stopcode): Fix error reporting for several
deficiencies in matching stop-codes.

2016-10-17  Steven G. Kargl  

PR fortran/77978
* gfortran.dg/pr77978_1.f90: New test.
* gfortran.dg/pr77978_2.f90: Ditto.
* gfortran.dg/pr77978_3.f90: Ditto.

Added:
trunk/gcc/testsuite/gfortran.dg/pr77978_1.f90
trunk/gcc/testsuite/gfortran.dg/pr77978_2.f90
trunk/gcc/testsuite/gfortran.dg/pr77978_3.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/match.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/78014] -Wformat -vs- size_t

2016-10-17 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78014

--- Comment #2 from joseph at codesourcery dot com  ---
I think this is essentially the same as bug 77970 - making such warnings 
smarter about the case of standard typedefs.

Of course an expression resulting from sizeof must be considered 
appropriate for %zu.  Likewise _Alignof.  Likewise SIZE_MAX, but headers 
or predefines just define it to use an appropriate constant suffix, so 
without looking at the macro being expanded there's nothing to distinguish 
it from any constant where the user wrong such a suffix directly.  
Likewise an expression where the user did "typedef size_t my_size_t;" and 
then used my_size_t.  And what about expressions resulting from arithmetic 
on size_t values?  So it may be hard for the compiler to tell exactly what 
expressions are appropriate for use with %zu (even without direct use of 
__SIZE_TYPE__).

[Bug c++/78014] -Wformat -vs- size_t

2016-10-17 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78014

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||diagnostic
   Severity|normal  |enhancement

--- Comment #1 from Andrew Pinski  ---
Since size_t is a typedef, long int might be typedef so size_t works there.

I don't see a reason for a warning on those targets.  Yes a warning for
portability would be nice but I don't know if it is easy to do and if people
want it turned on by default.

[Bug c++/78014] New: -Wformat -vs- size_t

2016-10-17 Thread tromey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78014

Bug ID: 78014
   Summary: -Wformat -vs- size_t
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tromey at gcc dot gnu.org
  Target Milestone: ---

Compile this test program with -Wformat:

#include 

int main() {
  size_t x = 0;

  printf("got %lu\n", x);
}

I expected this to give a warning, because the correct format should
be %zu.  %lu happens to be correct on this machine, but on a 32-bit
machine it is not.

[Bug c++/77656] 64-bit integral template parameter gets incorrectly sized as 32-bits

2016-10-17 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77656

--- Comment #2 from Jason Merrill  ---
(In reply to Jakub Jelinek from comment #1)
> Perhaps tsubst of TEMPLATE_PARM_INDEX instead of just
> return convert_from_reference (unshare_expr (arg));
> also convert it to the TEMPLATE_PARM_INDEX's type (if it is integral type
> only, or when?)?

That would work, but the arg ought to already have the right type from
convert_nontype_argument.  I'll take a look.

[Bug libstdc++/77987] [6/7 Regression] unique_ptr<T[]> reset rejects cv-compatible pointers

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77987

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||5.4.0
 Resolution|--- |FIXED
   Target Milestone|--- |6.3
Summary|unique_ptr reset   |[6/7 Regression]
   |rejects cv-compatible   |unique_ptr reset
   |pointers|rejects cv-compatible
   ||pointers
  Known to fail||6.2.0, 7.0

--- Comment #5 from Jonathan Wakely  ---
Fixed for 6.3

[Bug libstdc++/77987] unique_ptr<T[]> reset rejects cv-compatible pointers

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77987

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 18:21:26 2016
New Revision: 241276

URL: https://gcc.gnu.org/viewcvs?rev=241276=gcc=rev
Log:
PR77987 Fix unique_ptr::reset(U) for T != U

PR libstdc++/77987
* include/bits/unique_ptr.h (unique_ptr::reset(U)): Copy
value to pointer of the correct type to swap, to support conversions
allowed by LWG 2118 / N4089.
* testsuite/20_util/unique_ptr/assign/assign_neg.cc: Move test for
incompatible deleters from ...
* testsuite/20_util/unique_ptr/assign/cv_qual.cc: ... here.
* testsuite/20_util/unique_ptr/modifiers/cv_qual.cc: Move tests for
incompatible pointers to ...
* testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: ... here. Move
destructor definition to base class. Test for invalid derived-to-base
conversion.

Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/bits/unique_ptr.h
   
branches/gcc-6-branch/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/20_util/unique_ptr/assign/cv_qual.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/cv_qual.cc
   
branches/gcc-6-branch/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/reset_neg.cc

[Bug fortran/61420] [5/6/7 Regression] [OOP] type-bound procedure returning a procedure pointer fails to compile

2016-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61420

--- Comment #11 from Paul Thomas  ---
Author: pault
Date: Mon Oct 17 17:52:05 2016
New Revision: 241274

URL: https://gcc.gnu.org/viewcvs?rev=241274=gcc=rev
Log:
2016-10-17  Paul Thomas  

PR fortran/61420
PR fortran/78013
* resolve.c (resolve_variable): Obtain the typespec for a
variable expression, when the variable is a function result
that is a procedure pointer.

2016-10-17  Paul Thomas  

PR fortran/61420
PR fortran/78013
* gfortran.dg/proc_ptr_49.f90: New test.

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

[Bug fortran/78013] unexpected 'has no IMPLICIT type' error for a type-bound function returning a procedure pointer

2016-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78013

--- Comment #2 from Paul Thomas  ---
Author: pault
Date: Mon Oct 17 17:52:05 2016
New Revision: 241274

URL: https://gcc.gnu.org/viewcvs?rev=241274=gcc=rev
Log:
2016-10-17  Paul Thomas  

PR fortran/61420
PR fortran/78013
* resolve.c (resolve_variable): Obtain the typespec for a
variable expression, when the variable is a function result
that is a procedure pointer.

2016-10-17  Paul Thomas  

PR fortran/61420
PR fortran/78013
* gfortran.dg/proc_ptr_49.f90: New test.

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

[Bug target/77308] surprisingly large stack usage for sha512 on arm

2016-10-17 Thread edlinger at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77308

--- Comment #11 from Bernd Edlinger  ---
Author: edlinger
Date: Mon Oct 17 17:46:59 2016
New Revision: 241273

URL: https://gcc.gnu.org/viewcvs?rev=241273=gcc=rev
Log:
2016-10-17  Bernd Edlinger  

PR target/77308
* config/arm/arm.c (arm_emit_coreregs_64bit_shift): Clear the result
register explicitly.
* config/arm/arm.md (ashldi3, ashrdi3, lshrdi3): Don't FAIL if
optimizing for size.

testsuite:
2016-10-17  Bernd Edlinger  

PR target/77308
* gcc.target/arm/pr77308.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/arm/pr77308.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.c
trunk/gcc/config/arm/arm.md
trunk/gcc/testsuite/ChangeLog

[Bug c/77992] Provide feature to initialize padding bytes to avoid information leaks

2016-10-17 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77992

--- Comment #16 from joseph at codesourcery dot com  ---
Obviously any fields implicitly inserted like that must be ignored by the 
front ends when processing positional initializers - an initializer { 1, 
2, 3 } must initialize three explicitly declared fields and ignore any 
inserted padding fields between them (to be implicitly initialized with 
0).

Presumably you'd want such padding fields to be inserted for unused bits 
in the presence of bit-fields, and you'd want to make sure unnamed 
bit-fields, and bits unused as a result of an unnamed bit-field of width 
0, get properly initialized as well in the presence of such an option.

[Bug c/78000] -Wimplicit-function-declaration inhibited with macro from system headers

2016-10-17 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78000

--- Comment #1 from joseph at codesourcery dot com  ---
As I've said before, we have to stop doing individual ad hoc fixes for 
bugs like this; there are too many of them.  We have to work out the 
general principles for which warnings should or should not be inhibited 
for macros from system headers (roughly, the question is whether the macro 
or its user is responsible for the warning) and then design APIs that make 
it easy to get it right for each individual warning - and review existing 
warnings systematically.  Failing that, disable inhibiting such warnings 
for macros from system headers globally.

[Bug fortran/61420] [5/6/7 Regression] [OOP] type-bound procedure returning a procedure pointer fails to compile

2016-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61420

Paul Thomas  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org

--- Comment #10 from Paul Thomas  ---
Created attachment 39825
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39825=edit
Patch for this and PR78013

2016-10-17  Paul Thomas  

PR fortran/61420
PR fortran/78013
* resolve.c (resolve_variable): Obtain the typespec for a
variable expression, when the variable is a function result
that is a procedure pointer.

2016-10-17  Paul Thomas  

PR fortran/61420
PR fortran/78013
* gfortran.dg/proc_ptr_49.f90: New test.

I'll submit to the list in a little while (~1 hour).

Paul

[Bug fortran/61420] [5/6/7 Regression] [OOP] type-bound procedure returning a procedure pointer fails to compile

2016-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61420

Paul Thomas  changed:

   What|Removed |Added

 CC||pault at gcc dot gnu.org

--- Comment #9 from Paul Thomas  ---
*** Bug 78013 has been marked as a duplicate of this bug. ***

[Bug fortran/78013] unexpected 'has no IMPLICIT type' error for a type-bound function returning a procedure pointer

2016-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78013

Paul Thomas  changed:

   What|Removed |Added

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

--- Comment #1 from Paul Thomas  ---
This is an exact duplicate of PR61420. I will post the fix for both there.

Paul

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

[Bug libstdc++/77641] std::variant copy-initialization fails for type with non-trivial constexpr ctor

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77641

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #5 from Jonathan Wakely  ---
.

[Bug libstdc++/77322] [C++11] std::function::swap should be noexcept.

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77322

Jonathan Wakely  changed:

   What|Removed |Added

   Target Milestone|--- |6.3

--- Comment #6 from Jonathan Wakely  ---
Fixed for 5.5 and 6.3 too

[Bug libstdc++/72820] std::function can't store types with overloaded operator new

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72820

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.3

--- Comment #4 from Jonathan Wakely  ---
Fixed for 5.5 and 6.3 too

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 17:03:09 2016
New Revision: 241263

URL: https://gcc.gnu.org/viewcvs?rev=241263=gcc=rev
Log:
Backport fixes to std::experimental::sample

PR libstdc++/77994
* include/experimental/algorithm (experimental::sample): Convert size
argument to iterator difference type. Fix invalid use of input
iterator. Defend against overloaded comma operator.

Modified:
branches/gcc-5-branch/libstdc++-v3/ChangeLog
branches/gcc-5-branch/libstdc++-v3/include/experimental/algorithm
   
branches/gcc-5-branch/libstdc++-v3/testsuite/experimental/algorithm/sample.cc

[Bug libstdc++/77322] [C++11] std::function::swap should be noexcept.

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77322

--- Comment #5 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 17:03:31 2016
New Revision: 241266

URL: https://gcc.gnu.org/viewcvs?rev=241266=gcc=rev
Log:
Add noexcept to std::function swap

Backport from mainline:
2016-08-22  Jonathan Wakely  

PR libstdc++/77322
* doc/xml/manual/intro.xml: Document DR 2062 change.
* include/std/functional (function::swap): Add noexcept.
(swap(function

[Bug libstdc++/72820] std::function can't store types with overloaded operator new

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72820

--- Comment #3 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 17:03:19 2016
New Revision: 241264

URL: https://gcc.gnu.org/viewcvs?rev=241264=gcc=rev
Log:
Use ::new to avoid finding overloaded operator new

Backport from mainline:
2016-08-06  Jonathan Wakely  

PR libstdc++/72820
* include/std/functional (_Function_base::_Base_manager::_M_clone):
Qualify new operator.
* testsuite/20_util/function/cons/72820.cc: New test.

Added:
branches/gcc-5-branch/libstdc++-v3/testsuite/20_util/function/cons/72820.cc
Modified:
branches/gcc-5-branch/libstdc++-v3/ChangeLog
branches/gcc-5-branch/libstdc++-v3/include/std/functional

[Bug fortran/67091] [OOP] Bad result for type-bound procedures returning pointers to the intrinsic function ASSOCIATED

2016-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67091

Paul Thomas  changed:

   What|Removed |Added

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

--- Comment #5 from Paul Thomas  ---
I have left this for so long now that it is not worth backporting to 5-branch.

Sorry about that.

Paul

[Bug libstdc++/72820] std::function can't store types with overloaded operator new

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72820

--- Comment #2 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 16:50:43 2016
New Revision: 241250

URL: https://gcc.gnu.org/viewcvs?rev=241250=gcc=rev
Log:
Use ::new to avoid finding overloaded operator new

Backport from mainline:
2016-08-06  Jonathan Wakely  

PR libstdc++/72820
* include/std/functional (_Function_base::_Base_manager::_M_clone):
Qualify new operator.
* testsuite/20_util/function/cons/72820.cc: New test.

Added:
branches/gcc-6-branch/libstdc++-v3/testsuite/20_util/function/cons/72820.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/std/functional

[Bug libstdc++/77322] [C++11] std::function::swap should be noexcept.

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77322

--- Comment #4 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 16:50:53 2016
New Revision: 241252

URL: https://gcc.gnu.org/viewcvs?rev=241252=gcc=rev
Log:
Add noexcept to std::function swap

Backport from mainline:
2016-08-22  Jonathan Wakely  

PR libstdc++/77322
* doc/xml/manual/intro.xml: Document DR 2062 change.
* include/std/functional (function::swap): Add noexcept.
(swap(function

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

--- Comment #3 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 16:50:37 2016
New Revision: 241249

URL: https://gcc.gnu.org/viewcvs?rev=241249=gcc=rev
Log:
Backport fixes to std::experimental::sample

PR libstdc++/77994
* include/experimental/algorithm (experimental::sample): Convert size
argument to iterator difference type. Fix invalid use of input
iterator. Defend against overloaded comma operator.

Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/include/experimental/algorithm
   
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/algorithm/sample.cc

[Bug fortran/78013] New: unexpected 'has no IMPLICIT type' error for a type-bound function returning a procedure pointer

2016-10-17 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78013

Bug ID: 78013
   Summary: unexpected 'has no IMPLICIT type' error for a
type-bound function returning a procedure pointer
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pault at gcc dot gnu.org
  Target Milestone: ---

Reported at
https://groups.google.com/forum/#!topic/comp.lang.fortran/OIEdfZunBPk

module m

   implicit none

   abstract interface
  function I_f() result( r )
 real :: r
  end function I_f
   end interface

   type, abstract :: a_t
  private
  procedure(I_f), nopass, pointer :: m_f => null()
   contains
  private
  procedure, pass(this), public :: f => get_f
   end type a_t

contains

   function get_f( this ) result( f_ptr )

  class(a_t), intent(in)  :: this
  procedure(I_f), pointer :: f_ptr

  f_ptr => this%m_f

   end function get_f

end module m 

Upon compilation,
function get_f( this ) result( f_ptr )
   1
Error: Symbol 'get_f' at (1) has no IMPLICIT type

ifort compiles it without problem.

I have a fix, which is just regtesting.

Paul

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

Jonathan Wakely  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #2 from Jonathan Wakely  ---
Fixed, thanks for reporting the problem.

I'm also fixing std::experimental::sample for GCC 5.5 and 6.3

[Bug tree-optimization/77943] [5/6 Regression] Optimization incorrectly commons noexcept calls with non-noexcept calls

2016-10-17 Thread redbeard0531 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77943

--- Comment #12 from Mathias Stearn  ---
We were hoping to replace many places in our code that does the following with
noexcept attributes on functions:

> try {doStuffThatShouldntThrow();} catch(...) {std::terminate();}

We wanted to take advantage of noexcept preventing exceptions from propagating
in a way that causes the terminate handler to be invoked at the throw site
rather than the catch site. We've avoided doing this so far because of the bugs
that we've found, leaving us with low confidence that we can rely on it. Can
you think of any similar cases that are likely to cause issues? Where do you
think it makes sense to focus our testing?

The scariest issues we've seen were a combination of failures to enforce
noexcept (like this bug) combined with noexcept causing try/catch blocks to be
optimized out. That lead to an exception thrown from a noexcept function
bypassing the surrounding catch block and escaping two layers of protection and
reaching code that really should never see them. Are there any compiler flags
we can use to tell it not to eliminate the catches based on noexcept
annotations?

We've also noticed that 'throw()' annotations have fewer issues, but have
avoided them because they are deprecated. As compiler writers, would you trust
'throw()' more or suggest we stick with noexcept?

[Bug target/78012] -mfpxx produces assembly code using odd FP registers on MIPS

2016-10-17 Thread aurelien at aurel32 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78012

--- Comment #1 from Aurelien Jarno  ---
Created attachment 39824
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39824=edit
Reduced testcase

[Bug target/78012] New: -mfpxx produces assembly code using odd FP registers on MIPS

2016-10-17 Thread aurelien at aurel32 dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78012

Bug ID: 78012
   Summary: -mfpxx produces assembly code using odd FP registers
on MIPS
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: aurelien at aurel32 dot net
  Target Milestone: ---
  Host: mipsel-linux-gnu
Target: mipsel-linux-gnu
 Build: mipsel-linux-gnu

Created attachment 39823
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39823=edit
Original testcase

The attached testcase (taken from the ergo software [1]) produces assembly code
with odd FP registers when using the FPxx abi.

$ gcc -mfpxx -O2 -c fun-p86c.i
/tmp/ccpv3phk.s: Assembler messages:
/tmp/ccpv3phk.s:1883: Error: float register should be even, was 15
/tmp/ccpv3phk.s:2586: Error: float register should be even, was 15

I have also attached a reduced version of the testcase, that said it also
outputs a lot of warnings about uninitialized variables.

[1] http://ergoscf.org/

[Bug c++/78011] Compiler error when initializing a member of template type where the second template argument is a typedef

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78011

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-10-17
 CC||marxin at gcc dot gnu.org
  Known to work||6.2.0, 7.0
   Target Milestone|--- |5.5
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed.

[Bug libstdc++/77994] std::sample uses incorrect integer types internally

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77994

--- Comment #1 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 14:39:23 2016
New Revision: 241245

URL: https://gcc.gnu.org/viewcvs?rev=241245=gcc=rev
Log:
PR77994 Convert std::sample size argument to suitable type

PR libstdc++/77994
* include/bits/stl_algo.h (sample): Convert size argument to iterator
difference type.
* include/experimental/algorithm (experimental::sample): Likewise.
* testsuite/25_algorithms/sample/2.cc: New test.

Added:
trunk/libstdc++-v3/testsuite/25_algorithms/sample/2.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/stl_algo.h
trunk/libstdc++-v3/include/experimental/algorithm

[Bug c++/78011] New: Compiler error when initializing a member of template type where the second template argument is a typedef

2016-10-17 Thread b.stanimirov at abv dot bg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78011

Bug ID: 78011
   Summary: Compiler error when initializing a member of template
type where the second template argument is a typedef
   Product: gcc
   Version: 5.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: b.stanimirov at abv dot bg
  Target Milestone: ---

Repro:

typedef int int32;

struct foo
{
  std::map bar = std::map{};
};

If the initialization is removed, or if it's in a function and not in a class,
it compiles fine.

Live demo: http://ideone.com/8hWLnn

[Bug c/77992] Provide feature to initialize padding bytes to avoid information leaks

2016-10-17 Thread kjlu at gatech dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77992

--- Comment #15 from Kangjie Lu  ---
(In reply to Richard Biener from comment #14)
> Re-opening as an enhacement request for sth like -fexplict-padding adding
> artificial fields to structures padding.
> 
> Patches welcome (hint: look into stor-layout.c, start_record_layout /
> finish_record_layout, place_field).

Sounds great! 
Thanks for the hint.
Since we have been working on preventing uninitialized data leaks for quite a
while, we are interested in implementing this gcc feature.
Once we finish the beta version, we will ask gcc for review and test.

[Bug tree-optimization/77937] [7 Regression] ICE: in replace_one_candidate, at gimple-ssa-strength-reduction.c:3370

2016-10-17 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77937

Bill Schmidt  changed:

   What|Removed |Added

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

--- Comment #16 from Bill Schmidt  ---
Fixed.  Further work for similar issues is being done under
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77916.

[Bug tree-optimization/77937] [7 Regression] ICE: in replace_one_candidate, at gimple-ssa-strength-reduction.c:3370

2016-10-17 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77937

--- Comment #15 from Bill Schmidt  ---
Author: wschmidt
Date: Mon Oct 17 14:24:21 2016
New Revision: 241244

URL: https://gcc.gnu.org/viewcvs?rev=241244=gcc=rev
Log:
[gcc]

2016-10-17  Bill Schmidt  

Backport from mainline
2016-10-12  Bill Schmidt  

PR tree-optimization/77937
* gimple-ssa-strength-reduction.c (analyze_increments): Use
POINTER_TYPE_P on the candidate type to determine whether
candidates in this chain require pointer arithmetic.

2016-10-13  Bill Schmidt  

PR tree-optimization/77937
* gimple-ssa-strength-reduction.c (analyze_increments): Set cost
to infinite when we have a pointer with an increment of -1.

[gcc/testsuite]

2016-10-17  Bill Schmidt  

Backport from mainline
2016-10-13  Bill Schmidt  

PR tree-optimization/77937
* gcc.dg/torture/pr77937-1.c: New.
* gcc.dg/torture/pr77937-2.c: New.


Added:
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77937-1.c
branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr77937-2.c
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/gimple-ssa-strength-reduction.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/77937] [7 Regression] ICE: in replace_one_candidate, at gimple-ssa-strength-reduction.c:3370

2016-10-17 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77937

--- Comment #14 from Bill Schmidt  ---
Author: wschmidt
Date: Mon Oct 17 14:22:22 2016
New Revision: 241243

URL: https://gcc.gnu.org/viewcvs?rev=241243=gcc=rev
Log:
[gcc]

2016-10-17  Bill Schmidt  

Backport from mainline
2016-10-12  Bill Schmidt  

PR tree-optimization/77937
* gimple-ssa-strength-reduction.c (analyze_increments): Use
POINTER_TYPE_P on the candidate type to determine whether
candidates in this chain require pointer arithmetic.

2016-10-13  Bill Schmidt  

PR tree-optimization/77937
* gimple-ssa-strength-reduction.c (analyze_increments): Set cost
to infinite when we have a pointer with an increment of -1.

[gcc/testsuite]

2016-10-17  Bill Schmidt  

Backport from mainline
2016-10-13  Bill Schmidt  

PR tree-optimization/77937
* gcc.dg/torture/pr77937-1.c: New.
* gcc.dg/torture/pr77937-2.c: New.


Added:
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77937-1.c
branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr77937-2.c
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/gimple-ssa-strength-reduction.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug sanitizer/77966] Corrupt function with -fsanitize-coverage=trace-pc

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77966

Martin Liška  changed:

   What|Removed |Added

 CC||dodji at gcc dot gnu.org,
   ||dvyukov at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org,
   ||kcc at gcc dot gnu.org
  Component|target  |sanitizer

--- Comment #8 from Martin Liška  ---
Ok, after discussion with Jakub, I'm going to create a patch that would enable
aggressive loop optimizations when -fsanitize=leak or -fsanitize=unreachable is
enabled (a different sanitization disable them).

[Bug tree-optimization/77988] [7 Regression] ICE on valid code at -Os and above on x86_64-linux-gnu: verify_gimple failed

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77988

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug tree-optimization/77988] [7 Regression] ICE on valid code at -Os and above on x86_64-linux-gnu: verify_gimple failed

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77988

--- Comment #3 from Richard Biener  ---
Author: rguenth
Date: Mon Oct 17 13:46:34 2016
New Revision: 241242

URL: https://gcc.gnu.org/viewcvs?rev=241242=gcc=rev
Log:
2016-10-17  Richard Biener  

PR tree-optimization/77988
* tree-vrp.c (remove_range_assertions): Use replace_uses_by.

* gcc.dg/torture/pr77988.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr77988.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-vrp.c

[Bug c++/78004] [6/7 Regression] g++ segfaults when compiling qt 4.8.7

2016-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

Markus Trippelsdorf  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 CC||rsandifo at gcc dot gnu.org

--- Comment #9 from Markus Trippelsdorf  ---
Started with r230488:

commit ed9eac2c3d9bb4c0e6fb8fe128a197aa8687b337
Author: rsandifo 
Date:   Tue Nov 17 18:51:55 2015 +

Extend tree-call-cdce to calls whose result is used

[Bug c++/65856] -Wsuggest-override shall not report a warning on final method

2016-10-17 Thread a.volkov at rusbitech dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65856

--- Comment #13 from Alexander Volkov  ---
There was no response, so I created a new bugreport:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010

[Bug c++/78010] New: --Wsuggest-override reports a redundant warning on a 'final' method

2016-10-17 Thread a.volkov at rusbitech dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010

Bug ID: 78010
   Summary: --Wsuggest-override reports a redundant warning on a
'final' method
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: a.volkov at rusbitech dot ru
  Target Milestone: ---

Hi,

gcc reports a warning on a 'final' method which is not specified as 'virtual':
struct A {
  virtual void f();
};
struct B : A {
  void f() final;
};

There is no need to suggest adding override for B::f(): without the 'virtual'
specifier 'final' means that B::f() is an overrider.

[Bug tree-optimization/77943] [5/6 Regression] Optimization incorrectly commons noexcept calls with non-noexcept calls

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77943

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #11 from Martin Liška  ---
Fixed on all active branches.

[Bug tree-optimization/77943] [5/6 Regression] Optimization incorrectly commons noexcept calls with non-noexcept calls

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77943

--- Comment #10 from Martin Liška  ---
Author: marxin
Date: Mon Oct 17 13:19:04 2016
New Revision: 241240

URL: https://gcc.gnu.org/viewcvs?rev=241240=gcc=rev
Log:
Do not merge BBs with a different EH landing pads (PR

Backported from mainline
2016-10-13  Martin Liska  

PR tree-optimization/77943
* g++.dg/tree-ssa/pr77943.C: New test.
Backported from mainline
2016-10-13  Martin Liska  

PR tree-optimization/77943
* tree-ssa-tail-merge.c (merge_stmts_p): Do not merge BBs with
a different EH landing pads.

Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/tree-ssa/pr77943.C
Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/testsuite/ChangeLog
branches/gcc-5-branch/gcc/tree-ssa-tail-merge.c

[Bug tree-optimization/77943] [5/6 Regression] Optimization incorrectly commons noexcept calls with non-noexcept calls

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77943

--- Comment #9 from Martin Liška  ---
Author: marxin
Date: Mon Oct 17 13:17:53 2016
New Revision: 241239

URL: https://gcc.gnu.org/viewcvs?rev=241239=gcc=rev
Log:
Do not merge BBs with a different EH landing pads (PR

Backported from mainline
2016-10-13  Martin Liska  

PR tree-optimization/77943
* g++.dg/tree-ssa/pr77943.C: New test.
Backported from mainline
2016-10-13  Martin Liska  

PR tree-optimization/77943
* tree-ssa-tail-merge.c (merge_stmts_p): Do not merge BBs with
a different EH landing pads.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/tree-ssa/pr77943.C
Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/testsuite/ChangeLog
branches/gcc-6-branch/gcc/tree-ssa-tail-merge.c

[Bug target/77966] Corrupt function with -fsanitize-coverage=trace-pc

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77966

--- Comment #7 from Martin Liška  ---
Yes, the reason is that aggressive loop optimizations are disabled if a
-fsanitize is enabled.

If you want to catch the out of bounds access to wq_lock array, you can use
-fsanitize=undefined.

[Bug c++/78004] [6/7 Regression] g++ segfaults when compiling qt 4.8.7

2016-10-17 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

Richard Earnshaw  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #8 from Richard Earnshaw  ---
(In reply to Richard Earnshaw from comment #7)
> (In reply to Natanael Copa from comment #4)
> > It seems to be reproducible on 32 bit x86 too with:
> > 
> > $ g++  -v
> > Using built-in specs.
> > COLLECT_GCC=g++
> > COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-alpine-linux-musl/6.2.1/lto-wrapper
> > Target: i586-alpine-linux-musl
> > Configured with: /home/ncopa/aports/main/gcc/src/gcc-6.2.0/configure
> > --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
> > --build=i586-alpine-linux-musl --host=i586-alpine-linux-musl
> > --target=i586-alpine-linux-musl --with-pkgversion='Alpine 6.2.1'
> > --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
> > --disable-multilib --disable-nls --disable-werror --disable-symvers
> > --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend
> > --enable-languages=c,c++,objc,java,fortran,ada --with-arch=i586
> > --with-tune=generic --enable-cld --disable-libssp --disable-libmpx
> > --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads
> > --enable-tls --with-system-zlib --with-linker-hash-style=gnu
> > Thread model: posix
> > gcc version 6.2.1 20160822 (Alpine 6.2.1)
> 
> You say this is on ARM, but this is clearly a configuration for an x86
> compiler.

Ignore that, I see you said "also".

[Bug c++/78004] [6/7 Regression] g++ segfaults when compiling qt 4.8.7

2016-10-17 Thread rearnsha at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

Richard Earnshaw  changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #7 from Richard Earnshaw  ---
(In reply to Natanael Copa from comment #4)
> It seems to be reproducible on 32 bit x86 too with:
> 
> $ g++  -v
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-alpine-linux-musl/6.2.1/lto-wrapper
> Target: i586-alpine-linux-musl
> Configured with: /home/ncopa/aports/main/gcc/src/gcc-6.2.0/configure
> --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
> --build=i586-alpine-linux-musl --host=i586-alpine-linux-musl
> --target=i586-alpine-linux-musl --with-pkgversion='Alpine 6.2.1'
> --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
> --disable-multilib --disable-nls --disable-werror --disable-symvers
> --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend
> --enable-languages=c,c++,objc,java,fortran,ada --with-arch=i586
> --with-tune=generic --enable-cld --disable-libssp --disable-libmpx
> --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads
> --enable-tls --with-system-zlib --with-linker-hash-style=gnu
> Thread model: posix
> gcc version 6.2.1 20160822 (Alpine 6.2.1)

You say this is on ARM, but this is clearly a configuration for an x86
compiler.

[Bug fortran/78009] New: [OOP] polymorphic component of derived type array slice handling error

2016-10-17 Thread daanvanvugt at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78009

Bug ID: 78009
   Summary: [OOP] polymorphic component of derived type array
slice handling error
   Product: gcc
   Version: 6.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daanvanvugt at gmail dot com
  Target Milestone: ---

When setting a component of a polymorphic type in an array memory offsets of
the base type are used. This only occurs if it is nested in another allocatable
array.

See the attached program for an example. Expected output is
1 0
1 0
... etc
instead a different memory region is set to 1.

program test
  type :: t
integer :: a
  end type t
  type, extends(t) :: tt
integer :: b
  end type tt
  type :: group
class(t), allocatable, dimension(:) :: unit
  end type group

  type(group), allocatable, dimension(:) :: groups
  allocate(groups(1))
  allocate(tt::groups(1)%unit(10))
  groups(1)%unit(:)%a = 1

  select type (units => groups(1)%unit)
  type is (tt)
  do i=1,10
write(*,*) units(i)%a, units(i)%b
  end do
  end select
end program test

[Bug c++/78006] [5/6/7 Regression] Segmentation fault with 'using' and generic lambda trailing return types

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78006

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
  Known to work||5.3.0
   Keywords||error-recovery,
   ||ice-on-invalid-code
   Last reconfirmed||2016-10-17
 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|Segmentation fault with |[5/6/7 Regression]
   |'using' and generic lambda  |Segmentation fault with
   |trailing return types   |'using' and generic lambda
   ||trailing return types
   Target Milestone|--- |5.5
  Known to fail||5.4.0, 6.2.0, 7.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with r231713.

Error message with GCC 5.3.0:

pr78006.cpp: In substitution of ‘template x(TFs&&
...):: [with auto:1 = int]’:
pr78006.cpp:15:19:   required from here
pr78006.cpp:9:24: error: expansion pattern ‘void’ contains no argument packs
 return [](auto) -> rt { };
^
pr78006.cpp: In function ‘int main()’:
pr78006.cpp:15:19: error: no match for call to ‘(x(TFs&& ...) [with TFs =
{main()::}]::) (int)’
 x([](int){})(0);
   ^
pr78006.cpp:15:19: note: candidate: rt (*)(auto:1) 
pr78006.cpp:15:19: note:   candidate expects 2 arguments, 2 provided
pr78006.cpp:9:24: note: candidate: template x(TFs&&
...):: [with auto:1 = auto:1; TFs = {main()::}]
 return [](auto) -> rt { };
^
pr78006.cpp:9:24: note:   substitution of deduced template arguments resulted
in errors seen above

[Bug libfortran/66756] libgfortran: ThreadSanitizer: lock-order-inversion

2016-10-17 Thread Melven.Roehrig-Zoellner at DLR dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66756

Melven.Roehrig-Zoellner at DLR dot de changed:

   What|Removed |Added

 CC||Melven.Roehrig-Zoellner@DLR
   ||.de

--- Comment #4 from Melven.Roehrig-Zoellner at DLR dot de ---
I also obtain this with GCC 6.1.0.

Identical setup leads to:

> ./a.out 
==
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=5480)
  Cycle in lock order graph: M20 (0x7f0a157f3b60) => M21 (0x7d58f3d0) =>
M20

  Mutex M21 acquired here while holding mutex M20 in main thread:
#0 pthread_mutex_lock
/tools/modulesystem/tools/gcc/gcc-6.1.0/src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:3308
(libtsan.so.0+0x00035c7e)
#1 __gthread_mutex_lock ../libgcc/gthr-default.h:748
(libgfortran.so.3+0x000e4078)
#2 insert_unit
/tools/modulesystem/tools/gcc/gcc-6.1.0/src/libgfortran/io/unit.c:220
(libgfortran.so.3+0x000e4078)
#3 main test.f90:3 (a.out+0x00400b30)

Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative
warning message

  Mutex M20 acquired here while holding mutex M21 in main thread:
#0 pthread_mutex_lock
/tools/modulesystem/tools/gcc/gcc-6.1.0/src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:3308
(libtsan.so.0+0x00035c7e)
#1 __gthread_mutex_lock ../libgcc/gthr-default.h:748
(libgfortran.so.3+0x000e4ab6)
#2 close_unit_1
/tools/modulesystem/tools/gcc/gcc-6.1.0/src/libgfortran/io/unit.c:707
(libgfortran.so.3+0x000e4ab6)
#3 main test.f90:3 (a.out+0x00400b30)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock)
../libgcc/gthr-default.h:748 in __gthread_mutex_lock
==
ThreadSanitizer: reported 1 warnings


This prevents me from doing automated thread-sanitizer tests in our Fortran
software.

[Bug c++/77999] GCC diagnoses usage of STL literal operators as invalid.

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77999

Jonathan Wakely  changed:

   What|Removed |Added

 CC||emsr at gcc dot gnu.org

--- Comment #2 from Jonathan Wakely  ---
Ed, do you fancy taking a look at this?

[Bug libstdc++/77987] unique_ptr<T[]> reset rejects cv-compatible pointers

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77987

--- Comment #3 from Jonathan Wakely  ---
Fixed on trunk so far.

[Bug libstdc++/77998] clang rejects std::thread from trunk

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77998

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #3 from Jonathan Wakely  ---
Fixed.

[Bug libstdc++/77998] clang rejects std::thread from trunk

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77998

--- Comment #2 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 12:23:09 2016
New Revision: 241236

URL: https://gcc.gnu.org/viewcvs?rev=241236=gcc=rev
Log:
PR77998 Remove std::thread::_Invoker::result_type

PR libstdc++/77998
* include/std/future (__future_base::_Deferred_state)
(__future_base::_Async_state_impl): Use decltype to deduce return
type, instead of _Invoker::result_type.
* include/std/thread (thread::_Invoker::operator()): Likewise.
(thread::_Invoker::result_type): Remove.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/std/future
trunk/libstdc++-v3/include/std/thread

[Bug c++/78004] [6/7 Regression] g++ segfaults when compiling qt 4.8.7

2016-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

Markus Trippelsdorf  changed:

   What|Removed |Added

Summary|g++ 6.2.1 segfaults when|[6/7 Regression] g++
   |compiling qt 4.8.7 on arm   |segfaults when compiling qt
   ||4.8.7

--- Comment #6 from Markus Trippelsdorf  ---
markus@x4 tmp % cat qdeclarativeanimation.ii
struct QVariant {
  ~QVariant();
};
struct A {
  QVariant toValue;
};
extern "C" {
void atan2(int, int);
float sqrtf(float);
}
int a, b;
void QDeclarativeParentAnimationtransition() {
  float c;
  A d;
  if (b)
c = sqrtf(a);
  atan2(0, c);
}

markus@x4 tmp % g++ -c -O2 qdeclarativeanimation.ii
qdeclarativeanimation.ii: In function ‘void
QDeclarativeParentAnimationtransition()’:
qdeclarativeanimation.ii:12:6: error: missing PHI def
 void QDeclarativeParentAnimationtransition() {
  ^
c_5 = PHI 
qdeclarativeanimation.ii:12:6: internal compiler error: verify_gimple failed
0xda8090 verify_gimple_in_cfg(function*, bool)
../../gcc/gcc/tree-cfg.c:5208
0xc89707 execute_function_todo
../../gcc/gcc/passes.c:1965
0xc8a7dc execute_todo
../../gcc/gcc/passes.c:2015

[Bug libstdc++/41861] [DR 887][C++0x] does not use monotonic_clock

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41861

--- Comment #13 from Jonathan Wakely  ---
(In reply to Roman Fietze from comment #12)
> Sorry if it is inappropriate to ask for any changes, but how can it be, that
> there is no fix for this bug for years in any of the GCC releases? 

Because it's not possible to implement the C++ requirements purely in terms of
POSIX, so it requires a new API in the C library, which is complicated. All the
information you need to investigate that is provided in this bug report and the
enclosed links.

> With this bug condition_variable::wait_until is completely unusable on many

I find that hard to believe.

[Bug libstdc++/41861] [DR 887][C++0x] does not use monotonic_clock

2016-10-17 Thread roman.fietze at telemotive dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41861

--- Comment #12 from Roman Fietze  ---
Sorry if it is inappropriate to ask for any changes, but how can it be, that
there is no fix for this bug for years in any of the GCC releases? 

With this bug condition_variable::wait_until is completely unusable on many
targets with non monotonic system clocks, e.g. because they only do connect to
any time server from time to time, or targets that get their time via any other
method from a system that only connects from time to time.

I'm sure this affects e.g. many embedded systems.

If I can be of any help to get any fix into the release branches please tell
me. Be it testing or debugging.

[Bug c++/78004] g++ 6.2.1 segfaults when compiling qt 4.8.7 on arm

2016-10-17 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-10-17
 CC||trippels at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #5 from Markus Trippelsdorf  ---
util/qdeclarativeanimation.cpp:2598:6: error: missing PHI def
scale_97 = PHI <_461(248), 1.0e+0(118), (114)>
util/qdeclarativeanimation.cpp:2598:6: internal compiler error: verify_gimple
failed

Reducing...

[Bug libstdc++/77987] unique_ptr<T[]> reset rejects cv-compatible pointers

2016-10-17 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77987

--- Comment #2 from Jonathan Wakely  ---
Author: redi
Date: Mon Oct 17 12:00:44 2016
New Revision: 241235

URL: https://gcc.gnu.org/viewcvs?rev=241235=gcc=rev
Log:
PR77987 Fix unique_ptr::reset(U) for T != U

PR libstdc++/77987
* include/bits/unique_ptr.h (unique_ptr::reset(U)): Copy
value to pointer of the correct type to swap, to support conversions
allowed by LWG 2118 / N4089.
* testsuite/20_util/unique_ptr/assign/assign_neg.cc: Move test for
incompatible deleters from ...
* testsuite/20_util/unique_ptr/assign/cv_qual.cc: ... here.
* testsuite/20_util/unique_ptr/modifiers/cv_qual.cc: Move tests for
incompatible pointers to ...
* testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: ... here. Move
destructor definition to base class. Test for invalid derived-to-base
conversion.

Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/bits/unique_ptr.h
trunk/libstdc++-v3/testsuite/20_util/unique_ptr/assign/assign_neg.cc
trunk/libstdc++-v3/testsuite/20_util/unique_ptr/assign/cv_qual.cc
trunk/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/cv_qual.cc
trunk/libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/reset_neg.cc

[Bug c++/78004] g++ 6.2.1 segfaults when compiling qt 4.8.7 on arm

2016-10-17 Thread ncopa at alpinelinux dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

--- Comment #4 from Natanael Copa  ---
It seems to be reproducible on 32 bit x86 too with:

$ g++  -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i586-alpine-linux-musl/6.2.1/lto-wrapper
Target: i586-alpine-linux-musl
Configured with: /home/ncopa/aports/main/gcc/src/gcc-6.2.0/configure
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--build=i586-alpine-linux-musl --host=i586-alpine-linux-musl
--target=i586-alpine-linux-musl --with-pkgversion='Alpine 6.2.1'
--enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
--disable-multilib --disable-nls --disable-werror --disable-symvers
--enable-__cxa_atexit --enable-default-pie --enable-cloog-backend
--enable-languages=c,c++,objc,java,fortran,ada --with-arch=i586
--with-tune=generic --enable-cld --disable-libssp --disable-libmpx
--disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads
--enable-tls --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 6.2.1 20160822 (Alpine 6.2.1)

[Bug c++/78004] g++ 6.2.1 segfaults when compiling qt 4.8.7 on arm

2016-10-17 Thread ncopa at alpinelinux dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

--- Comment #3 from Natanael Copa  ---
Created attachment 39822
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39822=edit
qdeclarativeanimation.ii.gz

It segfaults with -O1 and -O2 but not with -Os or -O0.

[Bug preprocessor/78008] New: Forbid or document #pragma pack(0)

2016-10-17 Thread dhekir at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78008

Bug ID: 78008
   Summary: Forbid or document #pragma pack(0)
   Product: gcc
   Version: 5.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dhekir at gmail dot com
  Target Milestone: ---

The GCC online doc
(https://gcc.gnu.org/onlinedocs/gcc/Structure-Layout-Pragmas.html) says that
#pragma pack is supported for compatibility with MS compilers.

However, the MSVC doc (https://msdn.microsoft.com/en-us/library/2e70t5y1.aspx)
explicitly states that, for pack(n): "Valid values are 1, 2, 4, 8, and 16."

Indeed, writing #pragma pack(0) and compiling (with VS 2010, in my case)
results in a warning:

warning C4086: expected pragma parameter to be '1', '2', '4', '8', or '16'

On GCC (I tried 5.4.0, but it seems not to have changed in quite some time),
using #pragma pack(0) results in no warnings, even with -Wall.

I found very old discussions (around gcc 2.9.5) mentioning that pack(0) is
supposed to disable the effect of #pragma pack, however this is not documented.
 If the intended behavior is the same as "#pragma pack()" (without arguments),
please document it. Otherwise, it would be best if GCC would report this
construction as a warning/error, or at least indicate in the documentation that
it should not be used.

[Bug target/78007] Important loop from 482.sphinx3 is not vectorized

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78007

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-10-17
 Blocks||53947
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
Should be relatively easy to handle with a VIEW_CONVERT, VEC_PERM_EXPR,
VIEW_CONVERT sequence.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

[Bug debug/68860] [6/7 regression] FAIL: gcc.dg/guality/pr36728-1.c -flto -O3 -g line 16/7 arg1 == 1

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68860

--- Comment #17 from Richard Biener  ---
I have a fix for that, queued into early LTO debug patches.  But the testcase
still fails...

foo (arg7=arg7@entry=30, arg6=, arg5=, 
arg4=, arg3=, arg2=, 
arg1=, arg8=7)
at
/space/rguenther/src/svn/early-lto-debug/gcc/testsuite/gcc.dg/guality/pr68860-1.c:8
8 foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7,
int arg8)

vs. w/o LTO:

foo (arg7=arg7@entry=30, arg6=6, arg5=5, arg4=4, arg3=3, arg2=2, arg1=1, 
arg8=7)
at
/space/rguenther/src/svn/early-lto-debug/gcc/testsuite/gcc.dg/guality/pr68860-1.c:8
8 foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7,
int arg8)

but location info looks good to me:

 <1><1ff>: Abbrev Number: 10 (DW_TAG_subprogram)
<200>   DW_AT_abstract_origin: <0x2b5>
<204>   DW_AT_low_pc  : 0x400570
<20c>   DW_AT_high_pc : 0x47
<214>   DW_AT_frame_base  : 1 byte block: 9c(DW_OP_call_frame_cfa)
<216>   DW_AT_GNU_all_call_sites: 1
 <2><216>: Abbrev Number: 11 (DW_TAG_formal_parameter)
<217>   DW_AT_abstract_origin: <0x306>
<21b>   DW_AT_location: 0x37 (location list)
 <2><21f>: Abbrev Number: 12 (DW_TAG_formal_parameter)
<220>   DW_AT_abstract_origin: <0x2fb>
<224>   DW_AT_location: 6 byte block: fa 5b 0 0 0 9f   
(DW_OP_GNU_parameter_ref: <0x1b6>; DW_OP_stack_value)

though the DW_OP_GNU_parameter_ref points to an extra indirection:

 <1><189>: Abbrev Number: 3 (DW_TAG_subprogram)
<18a>   DW_AT_abstract_origin: <0x2b5>
<18e>   DW_AT_inline  : 1   (inlined)
<18f>   DW_AT_sibling : <0x1c6>
 <2><193>: Abbrev Number: 4 (DW_TAG_formal_parameter)
<194>   DW_AT_abstract_origin: <0x306>
...
 <2><1b6>: Abbrev Number: 4 (DW_TAG_formal_parameter)
<1b7>   DW_AT_abstract_origin: <0x2fb>

which then ultimatively points to the early debug:

 <1><2b5>: Abbrev Number: 5 (DW_TAG_subprogram)
<2b6>   DW_AT_name: foo
<2ba>   DW_AT_decl_file   : 1
<2bb>   DW_AT_decl_line   : 8
<2bc>   DW_AT_prototyped  : 1
<2bc>   DW_AT_type: <0x2ae>
<2c0>   DW_AT_sibling : <0x32f>
...
 <2><2fb>: Abbrev Number: 6 (DW_TAG_formal_parameter)
<2fc>   DW_AT_name: (indirect string, offset: 0x3ac): arg6
<300>   DW_AT_decl_file   : 1
<301>   DW_AT_decl_line   : 8
<302>   DW_AT_type: <0x2ae>

can't seem to make parameter_ref_descriptor to directly use a reference
to the early created DIE.

[Bug target/78007] Important loop from 482.sphinx3 is not vectorized

2016-10-17 Thread ysrumyan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78007

--- Comment #1 from Yuri Rumyantsev  ---
Created attachment 39821
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39821=edit
test-case to reproduce

It is sufficient to compiler it with -Ofast option on x86 platform.

[Bug target/78007] New: Important loop from 482.sphinx3 is not vectorized

2016-10-17 Thread ysrumyan at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78007

Bug ID: 78007
   Summary: Important loop from 482.sphinx3  is not vectorized
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ysrumyan at gmail dot com
  Target Milestone: ---

The issue is related to missing support for __builtin_bswap32:

t1.c:9:3: note: function is not vectorizable.
t1.c:9:3: note: not vectorized: relevant stmt not supported: _13 =
__builtin_bswap32 (load_dst_8);

Simple reproducer is attached.

[Bug debug/68860] [6/7 regression] FAIL: gcc.dg/guality/pr36728-1.c -flto -O3 -g line 16/7 arg1 == 1

2016-10-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68860

--- Comment #16 from Jakub Jelinek  ---
Yes, see the #c4 partial patch and the following comments.

[Bug tree-optimization/78005] [7 Regression] 172.mgrid and 450.soplex miscompare

2016-10-17 Thread amker at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78005

amker at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |amker at gcc dot gnu.org

--- Comment #3 from amker at gcc dot gnu.org ---
Hmm, I did run benchmarks when first version patch was sent, but not when I
commit it.  I will investigate.

[Bug bootstrap/77995] [6 regression] bootstrap comparison failure on x86-64/Solaris

2016-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77995

Eric Botcazou  changed:

   What|Removed |Added

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

--- Comment #9 from Eric Botcazou  ---
Fixed in the upcoming 6.x release.

[Bug tree-optimization/77989] [7 Regression] -O3 causes verify_gimple fail

2016-10-17 Thread amker at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77989

--- Comment #4 from amker at gcc dot gnu.org ---
The vectorized code looks good to me.  It is in VRP2 that GCC generates below
expression:

MEM[[(void *) + 49B] + 0B];

(gdb) call debug_tree(*tp)
 
unit size 
align 8 symtab 0 alias set -1 canonical type 0x7695f5e8 precision 8
min  max 
pointer_to_this >

arg 0 
sizes-gimplified public unsigned DI
size 
unit size 
align 64 symtab 0 alias set 1 canonical type 0x7697e150
pointer_to_this  reference_to_this
>
constant
arg 0 

arg 0 
constant arg 0 
pr77989.c:5:13 start: pr77989.c:5:13 finish: pr77989.c:5:14>
arg 1 >
pr77989.c:9:4 start: pr77989.c:9:3 finish: pr77989.c:9:5>
arg 1 
constant 0>
pr77989.c:12:10 start: pr77989.c:12:10 finish: pr77989.c:12:13>

which triggers the ICE.

continue looking...

[Bug debug/68860] [6/7 regression] FAIL: gcc.dg/guality/pr36728-1.c -flto -O3 -g line 16/7 arg1 == 1

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68860

--- Comment #15 from Richard Biener  ---
So with LTO early debug I now get proper debug decls but still no locations for
the parameters

 <1><1ff>: Abbrev Number: 10 (DW_TAG_subprogram)
<200>   DW_AT_abstract_origin: <0x28b>
<204>   DW_AT_low_pc  : 0x400570
<20c>   DW_AT_high_pc : 0x47
<214>   DW_AT_frame_base  : 1 byte block: 9c(DW_OP_call_frame_cfa)
<216>   DW_AT_GNU_all_call_sites: 1
 <2><216>: Abbrev Number: 11 (DW_TAG_formal_parameter)
<217>   DW_AT_abstract_origin: <0x2dc>
<21b>   DW_AT_location: 0x37 (location list)
 <2><21f>: Abbrev Number: 4 (DW_TAG_formal_parameter)
<220>   DW_AT_abstract_origin: <0x2d1>
 <2><224>: Abbrev Number: 4 (DW_TAG_formal_parameter)
<225>   DW_AT_abstract_origin: <0x2c6>
...

vs. non-LTO -O2:

 <1><282>: Abbrev Number: 13 (DW_TAG_subprogram)
<283>   DW_AT_abstract_origin: <0x1fa>
<287>   DW_AT_low_pc  : 0x400570
<28f>   DW_AT_high_pc : 0x47
<297>   DW_AT_frame_base  : 1 byte block: 9c(DW_OP_call_frame_cfa)
<299>   DW_AT_GNU_all_call_sites: 1
 <2><299>: Abbrev Number: 14 (DW_TAG_formal_parameter)
<29a>   DW_AT_abstract_origin: <0x24c>
<29e>   DW_AT_location: 0x37 (location list)
 <2><2a2>: Abbrev Number: 15 (DW_TAG_formal_parameter)
<2a3>   DW_AT_abstract_origin: <0x241>
<2a7>   DW_AT_location: 6 byte block: fa e6 0 0 0 9f   
(DW_OP_GNU_parameter_ref: <0x241>; DW_OP_stack_value)


the .optimized GIMPLE looks the same (and early LTO debug does stream
DECL_ABSTRACT_ORIGIN).  var-tracking only has NOTE_INSN_VAR_LOCATION for arg7
though.  Initial RTL looks the same:

;; # DEBUG arg2 s=> arg2

(debug_insn 8 7 0 (var_location:SI arg2 (const_int 0 [0]) [uninit]) -1
 (nil))
...

Looks like var-tracking misses to add all

(note 63 62 64 2 (var_location arg1 (debug_parameter_ref:SI arg1))
NOTE_INSN_VAR_LOCATION)
(note 64 63 65 2 (var_location arg2 (debug_parameter_ref:SI arg2))
NOTE_INSN_VAR_LOCATION)
(note 65 64 66 2 (var_location arg3 (debug_parameter_ref:SI arg3))
NOTE_INSN_VAR_LOCATION)
(note 66 65 67 2 (var_location arg4 (debug_parameter_ref:SI arg4))
NOTE_INSN_VAR_LOCATION)
(note 67 66 68 2 (var_location arg5 (debug_parameter_ref:SI arg5))
NOTE_INSN_VAR_LOCATION)
(note 68 67 44 2 (var_location arg6 (debug_parameter_ref:SI arg6))
NOTE_INSN_VAR_LOCATION)

ah, because DECL_HAS_DEBUG_ARGS_P and friends has not been LTOed yet.

[Bug tree-optimization/78005] [7 Regression] 172.mgrid and 450.soplex miscompare

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78005

Richard Biener  changed:

   What|Removed |Added

Summary|[7 Regression] 172.mgrid|[7 Regression] 172.mgrid
   |miscompares |and 450.soplex miscompare

--- Comment #2 from Richard Biener  ---
450.soplex started to fail around the same time so I suspect the same issue
(mgrid is way easier to analyze I suppose).

[Bug tree-optimization/78005] [7 Regression] 172.mgrid miscompares

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78005

Richard Biener  changed:

   What|Removed |Added

 CC||amker at gcc dot gnu.org
   Target Milestone|--- |7.0

--- Comment #1 from Richard Biener  ---
SVN log points at the various vectorizer changes.

[Bug c++/78004] g++ 6.2.1 segfaults when compiling qt 4.8.7 on arm

2016-10-17 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

ktkachov at gcc dot gnu.org changed:

   What|Removed |Added

 CC||ktkachov at gcc dot gnu.org

--- Comment #2 from ktkachov at gcc dot gnu.org ---
We'll need a preprocessed source file and the exact compile command as per
https://gcc.gnu.org/bugs/

[Bug tree-optimization/78005] New: [7 Regression] 172.mgrid miscompares

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78005

Bug ID: 78005
   Summary: [7 Regression] 172.mgrid miscompares
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---
Target: x86_64-*-*, i?86-*-*

With -Ofast on core-avx2 and bdver2, works fine with generic tuning.  Last
known good rev. is r241084, first kown bad r241120.

[Bug c++/78004] g++ 6.2.1 segfaults when compiling qt 4.8.7 on arm

2016-10-17 Thread ncopa at alpinelinux dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

--- Comment #1 from Natanael Copa  ---
Qt is built without precompiled headers. (with -no-pch)

[Bug c++/78004] New: g++ 6.2.1 segfaults when compiling qt 4.8.7 on arm

2016-10-17 Thread ncopa at alpinelinux dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78004

Bug ID: 78004
   Summary: g++ 6.2.1 segfaults when compiling qt 4.8.7 on arm
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ncopa at alpinelinux dot org
  Target Milestone: ---

make[1]: Entering directory
'/home/buildozer/aports/main/qt/src/qt-everywhere-opensource-src-4.8.7/src/declarative'
g++ -fno-aggressive-loop-optimizations -c -Os -fomit-frame-pointer -pipe -fPIC
-std=gnu++98 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W
-D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_DECLARATIVE_LIB
-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS
-DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NO_OPENTYPE
-DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_SVG_LIB -DQT_SQL_LIB -DQT_XMLPATTERNS_LIB
-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE
-D_LARGEFILE_SOURCE -I../../mkspecs/linux-g++ -I. -I../../include/QtCore
-I../../include/QtNetwork -I../../include/QtGui -I../../include/QtXmlPatterns
-I../../include/QtSql -I../../include/QtSvg -I../../include/QtScript
-I../../include -I../../include/QtDeclarative -I.rcc/release-shared -Iutil
-Igraphicsitems -Iqml -Iqml/parser -Iqml/rewriter -Idebugger
-I../3rdparty/harfbuzz/src -I.moc/release-shared -o
.obj/release-shared/qdeclarativeanimation.o util/qdeclarativeanimation.cpp
util/qdeclarativeanimation.cpp: In member function 'virtual void
QDeclarativeParentAnimation::transition(QDeclarativeStateActions&,
QDeclarativeProperties&, QDeclarativeAbstractAnimation::TransitionDirection)':
util/qdeclarativeanimation.cpp:2598:6: internal compiler error: Segmentation
fault
 void QDeclarativeParentAnimation::transition(QDeclarativeStateActions
,
  ^~~
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
make[1]: *** [Makefile:24007: .obj/release-shared/qdeclarativeanimation.o]
Error 1
make[1]: Leaving directory
'/home/buildozer/aports/main/qt/src/qt-everywhere-opensource-src-4.8.7/src/declarative'
make: *** [Makefile:711: sub-declarative-make_default-ordered] Error 2

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/armv6-alpine-linux-muslgnueabihf/6.2.1/lto-wrapper
Target: armv6-alpine-linux-muslgnueabihf
Configured with: /home/buildozer/aports/main/gcc/src/gcc-6.2.0/configure
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--build=armv6-alpine-linux-muslgnueabihf
--host=armv6-alpine-linux-muslgnueabihf
--target=armv6-alpine-linux-muslgnueabihf --with-pkgversion='Alpine 6.2.1'
--enable-checking=release --disable-fixed-point --disable-libstdcxx-pch
--disable-multilib --disable-nls --disable-werror --disable-symvers
--enable-__cxa_atexit --enable-default-pie --enable-cloog-backend
--enable-languages=c,c++,objc,java,fortran,ada --with-arch=armv6zk
--with-tune=arm1176jzf-s --with-fpu=vfp --with-float=hard
--with-abi=aapcs-linux --disable-libquadmath --disable-libssp --disable-libmpx
--disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads
--enable-tls --disable-libitm --with-system-zlib --with-linker-hash-style=gnu
Thread model: posix
gcc version 6.2.1 20160822 (Alpine 6.2.1) 


This is with musl libc on a armv8l compile server.

[Bug tree-optimization/77938] missing tailcall optimization in case when local variable escapes that goes out of scope before the possible tail call site

2016-10-17 Thread vanyacpp at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77938

--- Comment #5 from Ivan Sorokin  ---
(In reply to Andrew Pinski from comment #4)
> Related (maybe a dup really) to PR 59813.

I agree. The linked bug is just another manifestation of the same issue.

Regarding my question about excessive stack frame allocation (see my comment
#1). I checked and found out that clang allocates only 8 bytes instead of 24
(of gcc). Is this a well known issue or should I file a bug report?

[Bug bootstrap/77995] [6 regression] bootstrap comparison failure on x86-64/Solaris

2016-10-17 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77995

--- Comment #8 from Eric Botcazou  ---
Author: ebotcazou
Date: Mon Oct 17 08:54:03 2016
New Revision: 241231

URL: https://gcc.gnu.org/viewcvs?rev=241231=gcc=rev
Log:
PR bootstrap/77995
Backport from mainline
2016-10-11  Eric Botcazou  

* tree.h (build_complex_type): Add second parameter with default.
* tree.c (build_complex_type): Add NAMED second parameter and adjust
recursive call.  Create a TYPE_DECL only if NAMED is true.
(build_common_tree_nodes): Pass true in calls to build_complex_type.

Modified:
branches/gcc-6-branch/gcc/ChangeLog
branches/gcc-6-branch/gcc/tree.c
branches/gcc-6-branch/gcc/tree.h

[Bug tree-optimization/71636] Missed optimization in variable alignment test

2016-10-17 Thread prathamesh3492 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71636

--- Comment #5 from prathamesh3492 at gcc dot gnu.org ---
Fixed on trunk.

[Bug tree-optimization/77989] [7 Regression] -O3 causes verify_gimple fail

2016-10-17 Thread amker at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77989

amker at gcc dot gnu.org changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |amker at gcc dot gnu.org

--- Comment #3 from amker at gcc dot gnu.org ---
I will investigate it.

[Bug tree-optimization/71636] Missed optimization in variable alignment test

2016-10-17 Thread prathamesh3492 at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71636

--- Comment #4 from prathamesh3492 at gcc dot gnu.org ---
Author: prathamesh3492
Date: Mon Oct 17 08:48:43 2016
New Revision: 241229

URL: https://gcc.gnu.org/viewcvs?rev=241229=gcc=rev
Log:
2016-10-17  Prathamesh Kulkarni  

PR tree-optimization/71636
* match.pd (x & ((1 << b) - 1) -> x & ~(~0 << b)): New pattern.

testsuite/
* gcc.dg/pr71636-1.c: New test-case.
* gcc.dg/pr71636-2.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.dg/pr71636-1.c
trunk/gcc/testsuite/gcc.dg/pr71636-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/match.pd
trunk/gcc/testsuite/ChangeLog

[Bug c++/77967] ICE in cp_parser_type_name, at cp/parser.c:16419 (trying to add a method to a template alias)

2016-10-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77967

Martin Liška  changed:

   What|Removed |Added

 CC||jason at redhat dot com
  Known to work|4.5.4, 4.6.4, 4.7.4, 4.8.5, |
   |4.9.4, 5.4.0|
Summary|[6/7 Regression] ICE in |ICE in cp_parser_type_name,
   |cp_parser_type_name, at |at cp/parser.c:16419
   |cp/parser.c:16419 (trying   |(trying to add a method to
   |to add a method to a|a template alias)
   |template alias) |
  Known to fail|6.2.0   |

--- Comment #2 from Martin Liška  ---
Ok, the problem started with r225272 (where C++14 is selected as default
version), however adding -std=c++14 to command line options, the ICE started
with 4.9.0 (where C++14 was added).

[Bug debug/77985] DW_AT_comp_dir is omitted when filename is absolute and the file does not contain a specific typedef

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77985

--- Comment #10 from Richard Biener  ---
Please post the patch to gcc-patches@ where other people can see this and
comment.

[Bug c++/78003] [7 Regression] c++17: ICE in build_over_call, at cp/call.c:7847

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78003

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

[Bug tree-optimization/71311] [7 Regression] spec2006 test case 416.gamess fails since r235817

2016-10-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71311

--- Comment #9 from Richard Biener  ---
I can confirm the runfail on barcelona (core-avx2 seems fine).  As said the
underlying issue was latent, you can easily see if compiling rhfuhf.F w/o
-Ofast fixes it.

  1   2   >