[Bug tree-optimization/86141] C++ Related Optimization Problem

2018-06-22 Thread aaron_sami_abassi at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86141

--- Comment #17 from ASA  ---
It would seem that the heuristics problem has something to do with the same
function being called more than once from main.

I conducted the following experiments:

* Repeating the call to DisplayView1Type
* Commenting the second call to DisplayViewType

And in each case when a specific function was called more than once, the
compiler refused to inline the function invocation from main.

In case this helps.

[Bug c++/86186] Unqualified calls of std::get lead to ADL issues

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86186

--- Comment #4 from Jonathan Wakely  ---
If you want to suggest that GCC should have a new warning, then say that.

Don't past valid code and incorrectly claim that clang rejects it, or provide a
link to a bug in libc++ which is completely irrelevant to GCC (we don't care
that libc++ had a bug and then fixed it, that's not a GCC problem!)

I've spent hours and hours processing your bug reports this week, and far too
many of them have been confusing, poorly described, or just plain wrong. SOme
have been real bugs, so thank you for that, but you're also causing me to waste
a lot of time.

[Bug c++/86186] Unqualified calls of std::get lead to ADL issues

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86186

--- Comment #3 from Jonathan Wakely  ---
(In reply to zhonghao from comment #2)
> (In reply to Jonathan Wakely from comment #1)
> > (In reply to zhonghao from comment #0)
> > > A previous version of clang++ does not produce any error messages for the
> > > above code, but it was fixed in 
> > > https://bugs.llvm.org/show_bug.cgi?id=20092
> > 
> > No, you've completely misunderstood the llvm bug report.
> 
> Never the less, g++ accepts the code, but clang++ rejects it, right?

No, clang accepts it. Do you understand any of the bugs you're reporting? You
seem to be blindly copying code between bugzillas and making totally incorrect
claims about what the other compiler does.


> My g++ is 8.0.1 20180413, my clang++ is 7.0.0 (trunk 329990).
> 
> The warning message of clang++ is as follow:
> 17:5: warning: equality comparison result unused
>   [-Wunused-comparison]
>  t1 == t2; // error: static_assert failed ""
>  ~~~^
> code2.c.cpp:17:5: note: use '=' to turn this equality comparison into an
>   assignment
>  t1 == t2; // error: static_assert failed ""
> ^~
> =
> 1 warning generated.
> 
> The message sounds reasonable, but g++ does not produce any warning
> messages. Shall g++ make the improvement?

We already have an enhancement request to add something like clang's
-Wunused-comparison, see PR 53598

[Bug c++/86186] Unqualified calls of std::get lead to ADL issues

2018-06-22 Thread zhonghao at pku dot org.cn
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86186

--- Comment #2 from zhonghao at pku dot org.cn ---
(In reply to Jonathan Wakely from comment #1)
> (In reply to zhonghao from comment #0)
> > A previous version of clang++ does not produce any error messages for the
> > above code, but it was fixed in https://bugs.llvm.org/show_bug.cgi?id=20092
> 
> No, you've completely misunderstood the llvm bug report.

Never the less, g++ accepts the code, but clang++ rejects it, right?

My g++ is 8.0.1 20180413, my clang++ is 7.0.0 (trunk 329990).

The warning message of clang++ is as follow:
17:5: warning: equality comparison result unused
  [-Wunused-comparison]
 t1 == t2; // error: static_assert failed ""
 ~~~^
code2.c.cpp:17:5: note: use '=' to turn this equality comparison into an
  assignment
 t1 == t2; // error: static_assert failed ""
^~
=
1 warning generated.

The message sounds reasonable, but g++ does not produce any warning messages.
Shall g++ make the improvement?

[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function

2018-06-22 Thread sgk at troutmask dot apl.washington.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281

--- Comment #7 from Steve Kargl  ---
On Fri, Jun 22, 2018 at 10:36:04PM +, pault at gcc dot gnu.org wrote:
> 
> I don't know how this got past my regtesting...
> 
> The regression on assumed_charlen_function_7.f90 was entirely my
> fault. I found the failure, corrected on my tree after saving
> the diff and then cleaned the tree for another commit.
> Result - the legacy option was lost.

Thanks for the quick fix.

I know the joy of juggling patches for several
different bugs leading to this type of problem.

[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function

2018-06-22 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281

--- Comment #6 from Paul Thomas  ---
Hi Rainer and Steve,

I don't know how this got past my regtesting...

The regression on assumed_charlen_function_7.f90 was entirely my fault. I found
the failure, corrected on my tree after saving the diff and then cleaned the
tree for another commit. Result - the legacy option was lost.

Mea culpa, mea maxima culpa.

Paul

[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function

2018-06-22 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281

--- Comment #5 from Paul Thomas  ---
Author: pault
Date: Fri Jun 22 22:31:17 2018
New Revision: 261975

URL: https://gcc.gnu.org/viewcvs?rev=261975=gcc=rev
Log:
2018-06-22  Paul Thomas  
Rainer Orth  

PR fortran/86281
* resolve.c (resolve_contained_fntype): Check for the charlen
before testing the length.

2018-06-22  Paul Thomas  

PR fortran/86281
* gfortran.dg/assumed_charlen_function_7.f90: Add -std=legacy.


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

[Bug c++/86219] [8/9 Regression] ICE in coerce_template_parms, at cp/pt.c:8515

2018-06-22 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86219

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #5 from Jason Merrill  ---
Fixed.

[Bug c++/86219] [8/9 Regression] ICE in coerce_template_parms, at cp/pt.c:8515

2018-06-22 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86219

--- Comment #3 from Jason Merrill  ---
Author: jason
Date: Fri Jun 22 21:57:07 2018
New Revision: 261972

URL: https://gcc.gnu.org/viewcvs?rev=261972=gcc=rev
Log:
PR c++/86219 - ICE with erroneous initializer in template.

* constexpr.c (fold_non_dependent_expr): Add complain parm.
* call.c, expr.c, init.c, pt.c, semantics.c, typeck.c, typeck2.c:
Pass it.
* call.c (build_cxx_call): Don't mess with builtins in a template.
* typeck2.c (store_init_value): If fold_non_dependent_expr didn't
produce a constant value, go back to the uninstantiated form.

Added:
trunk/gcc/testsuite/g++.dg/template/conv15.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/constexpr.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/expr.c
trunk/gcc/cp/init.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c
trunk/gcc/cp/typeck.c
trunk/gcc/cp/typeck2.c

[Bug c++/86219] [8/9 Regression] ICE in coerce_template_parms, at cp/pt.c:8515

2018-06-22 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86219

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Fri Jun 22 21:57:32 2018
New Revision: 261973

URL: https://gcc.gnu.org/viewcvs?rev=261973=gcc=rev
Log:
PR c++/86219 - ICE with erroneous initializer in template.

* constexpr.c (fold_non_dependent_expr): Add complain parm.
* typeck2.c (store_init_value): Pass tf_warning_or_error.

Added:
branches/gcc-8-branch/gcc/testsuite/g++.dg/template/conv15.C
Modified:
branches/gcc-8-branch/gcc/cp/ChangeLog
branches/gcc-8-branch/gcc/cp/constexpr.c
branches/gcc-8-branch/gcc/cp/cp-tree.h
branches/gcc-8-branch/gcc/cp/typeck2.c

[Bug target/85358] PowerPC: Using -mabi=ieeelongdouble -mcpu=power9 breaks __ibm128

2018-06-22 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85358

Michael Meissner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Michael Meissner  ---
Fixed in the trunk and on the GCC 8.x branch.

[Bug target/85657] Make __ibm128 a separate type, even if long double uses the IBM double-double format

2018-06-22 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85657

Michael Meissner  changed:

   What|Removed |Added

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

--- Comment #8 from Michael Meissner  ---
Originally as the problem report said we thought __ibm128 and __float128 should
be separate types from the long double type.  On June 5th, 2018, we changed the
compiler to use the long double type for __ibm128 if the default long double
type is IBM extended double and __float128 if the default long double type is
IEEE 128-bit.  We made the default mangling for __ibm128 be "g", the same as
long double using IBM extended double format.

The changes have also been backported to GCC 8.x.

[Bug c++/86210] [6/7 Regression] Missing -Wnonnull warning for function defined in the same TU

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86210

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:33:58 2018
New Revision: 261970

URL: https://gcc.gnu.org/viewcvs?rev=261970=gcc=rev
Log:
Backported from mainline
2018-06-20  Jakub Jelinek  

PR c++/86210
* c-common.c (check_nonnull_arg): Use fold_for_warn.  Adjust obsolete
comment.

* g++.dg/warn/Wnonnull4.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wnonnull4.C
Modified:
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-common.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/86231] [6/7 Regression] vrp_meet causes wrong-code

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86231

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:33:07 2018
New Revision: 261969

URL: https://gcc.gnu.org/viewcvs?rev=261969=gcc=rev
Log:
Backported from mainline
2018-06-20  Jakub Jelinek  

PR tree-optimization/86231
* tree-vrp.c (union_ranges): For (  [  )  ] or (   )[   ] range and
anti-range don't overwrite *vr0min before using it to compute *vr0max.

* gcc.dg/tree-ssa/vrp119.c: New test.
* gcc.c-torture/execute/pr86231.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/execute/pr86231.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/tree-ssa/vrp119.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-vrp.c

[Bug middle-end/85878] [6/7 Regression] ICE in convert_mode_scalar, at expr.c:287

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85878

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:30:06 2018
New Revision: 261968

URL: https://gcc.gnu.org/viewcvs?rev=261968=gcc=rev
Log:
Backported from mainline
2018-06-15  Jakub Jelinek  

PR middle-end/85878
* expr.c (expand_assignment): Only call store_expr for halves if the
mode is the same.

* gfortran.fortran-torture/compile/pr85878.f90: New test.

Added:
   
branches/gcc-7-branch/gcc/testsuite/gfortran.fortran-torture/compile/pr85878.f90
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/expr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/85945] [6/7 Regression] ICE in resolve_subreg_use, at lower-subreg.c:751

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85945

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:29:24 2018
New Revision: 261967

URL: https://gcc.gnu.org/viewcvs?rev=261967=gcc=rev
Log:
Backported from mainline
2018-06-14  Jakub Jelinek  

PR target/85945
* lower-subreg.c (find_decomposable_subregs): Don't decompose float
subregs of multi-word pseudos unless the float mode has word size.

* gcc.c-torture/compile/pr85945.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/compile/pr85945.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/lower-subreg.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/86025] ICE with -Wduplicated-branches and OpenMP critical

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86025

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:28:36 2018
New Revision: 261966

URL: https://gcc.gnu.org/viewcvs?rev=261966=gcc=rev
Log:
Backported from mainline
2018-06-04  Jakub Jelinek  

PR c++/86025
* tree.c (inchash::add_expr): Handle IDENTIFIER_NODE.

* c-c++-common/gomp/pr86025.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/gomp/pr86025.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree.c

[Bug c/85696] OpenMP with variably modified and default(none) won't compile

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85696

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:27:25 2018
New Revision: 261964

URL: https://gcc.gnu.org/viewcvs?rev=261964=gcc=rev
Log:
Backported from mainline
2018-05-11  Jakub Jelinek  

PR c/85696
* c-omp.c (c_omp_predetermined_sharing): Return
OMP_CLAUSE_DEFAULT_SHARED for artificial vars with integral type.

* c-typeck.c (c_finish_omp_clauses): Don't use
c_omp_predetermined_sharing, instead just check TREE_READONLY.

* cp-tree.h (cxx_omp_predetermined_sharing_1): New prototype.
* cp-gimplify.c (cxx_omp_predetermined_sharing): New wrapper around
cxx_omp_predetermined_sharing_1.  Rename old function to ...
(cxx_omp_predetermined_sharing_1): ... this.
* semantics.c (finish_omp_clauses): Use cxx_omp_predetermined_sharing_1
instead of cxx_omp_predetermined_sharing.

* c-c++-common/gomp/pr85696.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/gomp/pr85696.c

[Bug c++/85952] Bogus -Wunused-but-set-variable warning with array structured binding

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85952

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:27:41 2018
New Revision: 261965

URL: https://gcc.gnu.org/viewcvs?rev=261965=gcc=rev
Log:
Backported from mainline
2018-05-29  Jakub Jelinek  

PR c++/85952
* init.c (build_aggr_init): For structured binding initialized from
array call mark_rvalue_use on the initializer.

* g++.dg/warn/Wunused-var-33.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wunused-var-33.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/init.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c/85696] OpenMP with variably modified and default(none) won't compile

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85696

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:25:04 2018
New Revision: 261963

URL: https://gcc.gnu.org/viewcvs?rev=261963=gcc=rev
Log:
Backported from mainline
2018-05-11  Jakub Jelinek  

PR c/85696
* c-omp.c (c_omp_predetermined_sharing): Return
OMP_CLAUSE_DEFAULT_SHARED for artificial vars with integral type.

* c-typeck.c (c_finish_omp_clauses): Don't use
c_omp_predetermined_sharing, instead just check TREE_READONLY.

* cp-tree.h (cxx_omp_predetermined_sharing_1): New prototype.
* cp-gimplify.c (cxx_omp_predetermined_sharing): New wrapper around
cxx_omp_predetermined_sharing_1.  Rename old function to ...
(cxx_omp_predetermined_sharing_1): ... this.
* semantics.c (finish_omp_clauses): Use cxx_omp_predetermined_sharing_1
instead of cxx_omp_predetermined_sharing.

* c-c++-common/gomp/pr85696.c: New test.

Modified:
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-omp.c
branches/gcc-7-branch/gcc/c/ChangeLog
branches/gcc-7-branch/gcc/c/c-typeck.c
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-gimplify.c
branches/gcc-7-branch/gcc/cp/cp-tree.h
branches/gcc-7-branch/gcc/cp/semantics.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85662] [8/9 Regression] "error: non-constant condition for static assertion" from __builtin_offsetof in C++

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85662

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:23:03 2018
New Revision: 261962

URL: https://gcc.gnu.org/viewcvs?rev=261962=gcc=rev
Log:
Backported from mainline
2018-06-22  Jakub Jelinek  

PR c++/85662
* g++.dg/ext/offsetof3.C: New test.

2018-05-10  Jakub Jelinek  

PR c++/85662
* c-common.h (fold_offsetof_1): Removed.
(fold_offsetof): Add TYPE argument defaulted to size_type_node and
CTX argument defaulted to ERROR_MARK.
* c-common.c (fold_offsetof_1): Renamed to ...
(fold_offsetof): ... this.  Remove wrapper function.  Add TYPE
argument, convert the pointer constant to TYPE and use size_binop
with PLUS_EXPR instead of fold_build_pointer_plus if type is not
a pointer type.  Adjust recursive calls.

* c-fold.c (c_fully_fold_internal): Use fold_offsetof rather than
fold_offsetof_1, pass TREE_TYPE (expr) as TYPE to it and drop the
fold_convert_loc.
* c-typeck.c (build_unary_op): Use fold_offsetof rather than
fold_offsetof_1, pass argtype as TYPE to it and drop the
fold_convert_loc.

* cp-gimplify.c (cp_fold): Use fold_offsetof rather than
fold_offsetof_1, pass TREE_TYPE (x) as TYPE to it and drop the
fold_convert.

* g++.dg/ext/offsetof2.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/offsetof2.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/offsetof3.C
Modified:
branches/gcc-7-branch/gcc/c-family/ChangeLog
branches/gcc-7-branch/gcc/c-family/c-common.c
branches/gcc-7-branch/gcc/c-family/c-common.h
branches/gcc-7-branch/gcc/c/ChangeLog
branches/gcc-7-branch/gcc/c/c-fold.c
branches/gcc-7-branch/gcc/c/c-typeck.c
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-gimplify.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85659] [6/7 Regression] ICE with inline assembly inside virtual function

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85659

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:20:53 2018
New Revision: 261961

URL: https://gcc.gnu.org/viewcvs?rev=261961=gcc=rev
Log:
Backported from mainline
2018-05-06  Jakub Jelinek  

PR c++/85659
* cfgexpand.c (expand_asm_stmt): Don't create a temporary if
the type is addressable.  Don't force op into register if it has
BLKmode.

* g++.dg/ext/asm14.C: New test.
* g++.dg/ext/asm15.C: New test.
* g++.dg/ext/asm16.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/asm14.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/asm15.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/asm16.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/cfgexpand.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug web/85578] broken links in gcc-8.0.1-RC-20180427/INSTALL/specific.html, and out of date prerequisites.html

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85578

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:20:02 2018
New Revision: 261960

URL: https://gcc.gnu.org/viewcvs?rev=261960=gcc=rev
Log:
Backported from mainline
2018-05-01  Jakub Jelinek  

PR web/85578
* doc/install.texi2html: Replace _002d with - and _002a with * in
generated html files using sed.

Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/doc/install.texi2html

[Bug tree-optimization/85529] [7 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85529

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:19:32 2018
New Revision: 261959

URL: https://gcc.gnu.org/viewcvs?rev=261959=gcc=rev
Log:
Backported from mainline
2018-04-27  Jakub Jelinek  

PR tree-optimization/85529
* tree-ssa-reassoc.c (optimize_range_tests_var_bound): Add FIRST_BB
argument.  Don't call get_nonzero_bits if opcode is ERROR_MARK_NODE,
rhs2 def stmt's bb is dominated by first_bb and it isn't an obvious
zero extension or masking of the MSB bit.
(optimize_range_tests): Add FIRST_BB argument, pass it through
to optimize_range_tests_var_bound.
(maybe_optimize_range_tests, reassociate_bb): Adjust
optimize_range_tests callers.

* gcc.c-torture/execute/pr85529-1.c: New test.
* gcc.c-torture/execute/pr85529-2.c: New test.
* gcc.dg/pr85529.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/execute/pr85529-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/execute/pr85529-2.c
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr85529.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-reassoc.c

[Bug tree-optimization/85446] [7 Regression] wrong-code on riscv64

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85446

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:18:32 2018
New Revision: 261958

URL: https://gcc.gnu.org/viewcvs?rev=261958=gcc=rev
Log:
Backported from mainline
2018-04-19  Jakub Jelinek  

PR tree-optimization/85446
* match.pd ((intptr_t) x eq/ne CST to x eq/ne (typeof x) cst): Require
the integral and pointer types to have the same precision.

Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/match.pd

[Bug jit/85384] libgccjit does not work if --with-gcc-major-version is used

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85384

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:16:41 2018
New Revision: 261957

URL: https://gcc.gnu.org/viewcvs?rev=261957=gcc=rev
Log:
2018-06-22  Jakub Jelinek  

Backported from mainline
2018-04-18  David Malcolm  

PR jit/85384
* acx.m4 (GCC_BASE_VER): Remove \$\$ from sed expression.

* configure.ac (gcc-driver-name.h): Honor --with-gcc-major-version
by using gcc_base_ver to generate a gcc_driver_version, and use
it when generating GCC_DRIVER_NAME.
* configure: Regenerate.

* configure: Regenerate.

Modified:
branches/gcc-7-branch/ChangeLog
branches/gcc-7-branch/config/ChangeLog
branches/gcc-7-branch/config/acx.m4
branches/gcc-7-branch/configure
branches/gcc-7-branch/fixincludes/ChangeLog
branches/gcc-7-branch/fixincludes/configure
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/configure
branches/gcc-7-branch/gcc/configure.ac
branches/gcc-7-branch/libada/ChangeLog
branches/gcc-7-branch/libada/configure
branches/gcc-7-branch/libatomic/ChangeLog
branches/gcc-7-branch/libatomic/configure
branches/gcc-7-branch/libcc1/ChangeLog
branches/gcc-7-branch/libcc1/configure
branches/gcc-7-branch/libcilkrts/ChangeLog
branches/gcc-7-branch/libcilkrts/configure
branches/gcc-7-branch/libffi/ChangeLog
branches/gcc-7-branch/libffi/configure
branches/gcc-7-branch/libgcc/ChangeLog
branches/gcc-7-branch/libgcc/configure
branches/gcc-7-branch/libgfortran/ChangeLog
branches/gcc-7-branch/libgfortran/configure
branches/gcc-7-branch/libgomp/ChangeLog
branches/gcc-7-branch/libgomp/configure
branches/gcc-7-branch/libhsail-rt/ChangeLog
branches/gcc-7-branch/libhsail-rt/configure
branches/gcc-7-branch/libitm/ChangeLog
branches/gcc-7-branch/libitm/configure
branches/gcc-7-branch/libmpx/ChangeLog
branches/gcc-7-branch/libmpx/configure
branches/gcc-7-branch/libobjc/ChangeLog
branches/gcc-7-branch/libobjc/configure
branches/gcc-7-branch/liboffloadmic/ChangeLog
branches/gcc-7-branch/liboffloadmic/configure
branches/gcc-7-branch/liboffloadmic/plugin/configure
branches/gcc-7-branch/libquadmath/ChangeLog
branches/gcc-7-branch/libquadmath/configure
branches/gcc-7-branch/libsanitizer/ChangeLog
branches/gcc-7-branch/libsanitizer/configure
branches/gcc-7-branch/libssp/ChangeLog
branches/gcc-7-branch/libssp/configure
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/configure
branches/gcc-7-branch/libvtv/ChangeLog
branches/gcc-7-branch/libvtv/configure

[Bug c++/86288] New: Recognize __gnu and/or __gnu__ as attribute-namespace

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86288

Bug ID: 86288
   Summary: Recognize __gnu and/or __gnu__ as attribute-namespace
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

Libstdc++ can't use C++11 attribute syntax for GNU-specific attributes like
[[gnu::nonnull]], because those identifiers are not reserved names. We can use
__nonnull__ but only "gnu" is recognized for the namespace.

Could G++ be extended to also accept [[__gnu__::__nonnull__]] ?

__gnu__ doesn't seem to clash with anything predefined by GCC, or defined by
Glibc.

[Bug c++/84463] [6/7 Regression] Supposedly-incompliant "error: '* key0' is not a constant expression"

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84463

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:12:32 2018
New Revision: 261956

URL: https://gcc.gnu.org/viewcvs?rev=261956=gcc=rev
Log:
Backported from mainline
2018-04-18  Jakub Jelinek  

PR c++/84463
* typeck.c (cp_build_addr_expr_1): Move handling of offsetof-like
tricks from here to ...
* cp-gimplify.c (cp_fold) : ... here.  Only use it
if INDIRECT_REF's operand is INTEGER_CST cast to pointer type.

* g++.dg/cpp0x/constexpr-nullptr-1.C: Add -O1 to dg-options.
* g++.dg/cpp0x/constexpr-nullptr-2.C: Expect different diagnostics
in two cases.  Uncomment two other tests and add expected dg-error for
them.
* g++.dg/init/struct2.C: Cast to int rather than long to avoid
-Wnarrowing diagnostics on some targets for c++11.
* g++.dg/parse/array-size2.C: Remove xfail.
* g++.dg/cpp0x/constexpr-84463.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-84463.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-gimplify.c
branches/gcc-7-branch/gcc/cp/typeck.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-1.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-2.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/init/struct2.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/parse/array-size2.C

[Bug rtl-optimization/85431] UBSAN: ../../gcc/dse.c:303:15: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int'

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85431

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:11:28 2018
New Revision: 261955

URL: https://gcc.gnu.org/viewcvs?rev=261955=gcc=rev
Log:
Backported from mainline
2018-04-17  Jakub Jelinek  

PR rtl-optimization/85431
* dse.c (record_store): Ignore zero width stores.

Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/dse.c

[Bug target/85430] [7 Regression] ICE: SIGSEGV in memory_operand at recog.c:1358/9 with -O2 -fno-tree-ccp -fno-tree-fre

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85430

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:10:59 2018
New Revision: 261954

URL: https://gcc.gnu.org/viewcvs?rev=261954=gcc=rev
Log:
Backported from mainline
2018-04-17  Jakub Jelinek  

PR target/85430
* config/i386/i386.md (*ashlqi3_1_slp): Use alu1 type instead of alu.

* gcc.dg/pr85430.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr85430.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/i386.md
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug rtl-optimization/85300] [6/7 Regression] ICE in exact_int_to_float_conversion_p, at simplify-rtx.c:895

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85300

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:10:17 2018
New Revision: 261953

URL: https://gcc.gnu.org/viewcvs?rev=261953=gcc=rev
Log:
Backported from mainline
2018-04-10  Jakub Jelinek  

PR rtl-optimization/85300
* combine.c (subst): Handle subst of CONST_SCALAR_INT_P new_rtx also
into FLOAT and UNSIGNED_FLOAT like ZERO_EXTEND, return a CLOBBER if
simplify_unary_operation fails.

* gcc.dg/pr85300.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr85300.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/combine.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/85313] gcc/fortran/openmp.c: 2 * confused logic ?

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85313

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:09:32 2018
New Revision: 261952

URL: https://gcc.gnu.org/viewcvs?rev=261952=gcc=rev
Log:
Backported from mainline
2018-04-10  Jakub Jelinek  

PR fortran/85313
* openmp.c (resolve_omp_do): Remove bogus if (j < i) break;.
(resolve_oacc_nested_loops): Likewise.  Formatting fix.

* gfortran.dg/gomp/pr85313.f90: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/gomp/pr85313.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/openmp.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/85257] [6/7 Regression] wrong code with -O -fno-tree-ccp and reading zeroed vector member

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85257

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:08:47 2018
New Revision: 261951

URL: https://gcc.gnu.org/viewcvs?rev=261951=gcc=rev
Log:
Backported from mainline
2018-04-07  Jakub Jelinek  

PR tree-optimization/85257
* fold-const.c (native_encode_vector): If not all elts could fit
and off is -1, return 0 rather than offset.
* tree-ssa-sccvn.c (vn_reference_lookup_3): Pass
(offset - offset2) / BITS_PER_UNIT as 4th argument to
native_encode_expr.  Verify len * BITS_PER_UNIT >= maxsizei.  Don't
adjust buffer in native_interpret_expr call.

* gcc.dg/pr85257.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr85257.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/fold-const.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-sccvn.c

[Bug debug/85252] [6/7 Regression] ICE with -g for static zero-length array initialization

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85252

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:08:00 2018
New Revision: 261950

URL: https://gcc.gnu.org/viewcvs?rev=261950=gcc=rev
Log:
Backported from mainline
2018-04-06  Jakub Jelinek  

PR debug/85252
* dwarf2out.c (rtl_for_decl_init): For STRING_CST initializer only
build CONST_STRING if TYPE_MAX_VALUE is non-NULL and is INTEGER_CST.

* gcc.dg/debug/pr85252.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/debug/pr85252.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/dwarf2out.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85210] [7 Regression] ICE with broken structured binding in template

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85210

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:07:16 2018
New Revision: 261949

URL: https://gcc.gnu.org/viewcvs?rev=261949=gcc=rev
Log:
Backported from mainline
2018-04-06  Jakub Jelinek  

PR c++/85210
* pt.c (tsubst_decomp_names): Return error_mark_node and assert
errorcount is set if tsubst doesn't return a VAR_DECL.

* g++.dg/cpp1z/decomp42.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp42.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/pt.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85208] ICE with #pragma weak and structured binding

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85208

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:06:41 2018
New Revision: 261948

URL: https://gcc.gnu.org/viewcvs?rev=261948=gcc=rev
Log:
Backported from mainline
2018-04-05  Jakub Jelinek  

PR c++/85208
* decl.c (start_decl): For DECL_DECOMPOSITION_P decls, don't call
maybe_apply_pragma_weak here...
(cp_maybe_mangle_decomp): ... but call it here instead.

* g++.dg/cpp1z/decomp41.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/decomp41.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/decl.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug inline-asm/85022] [6/7 Regression] internal compiler error: in write_dependence_p, at alias.c:3003

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85022

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:58:44 2018
New Revision: 261939

URL: https://gcc.gnu.org/viewcvs?rev=261939=gcc=rev
Log:
Backported from mainline
2018-03-23  Jakub Jelinek  

PR inline-asm/85022
* emit-rtl.c (init_emit_regs): Indicate that VOIDmode MEMs don't have
known size by default.

Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/emit-rtl.c

[Bug inline-asm/85172] internal compiler error: unexpected expression '' of kind asm_expr

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85172

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:05:52 2018
New Revision: 261947

URL: https://gcc.gnu.org/viewcvs?rev=261947=gcc=rev
Log:
Backported from mainline
2018-04-04  Jakub Jelinek  

PR inline-asm/85172
* constexpr.c (cxx_eval_builtin_function_call): For calls to
builtin_valid_in_constant_expr_p functions, don't call
cxx_eval_constant_expression if argument is not
potential_constant_expression.

* g++.dg/ext/builtin13.C: New test.
* g++.dg/ext/atomic-4.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/atomic-4.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/builtin13.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/constexpr.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug rtl-optimization/85167] [6/7 Regression] shrink-wrap.c:333:15: runtime error with UBSAN

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85167

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:05:08 2018
New Revision: 261946

URL: https://gcc.gnu.org/viewcvs?rev=261946=gcc=rev
Log:
Backported from mainline
2018-04-03  Jakub Jelinek  

PR rtl-optimization/85167
* shrink-wrap.c (move_insn_for_shrink_wrap): Don't set bb_uses and
bb_defs if *split_p, instead preinitialize it to NULL.

* gcc.dg/pr85167.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr85167.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/shrink-wrap.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85147] [6/7 Regression] ICE with invalid variadic template-template parameter

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85147

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:04:25 2018
New Revision: 261945

URL: https://gcc.gnu.org/viewcvs?rev=261945=gcc=rev
Log:
Backported from mainline
2018-04-03  Jakub Jelinek  

PR c++/85147
* pt.c (fixed_parameter_pack_p_1): Punt if parm is error_mark_node.

* g++.dg/cpp0x/pr85147.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/pr85147.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/pt.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug inline-asm/85022] [6/7 Regression] internal compiler error: in write_dependence_p, at alias.c:3003

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85022

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:57:15 2018
New Revision: 261937

URL: https://gcc.gnu.org/viewcvs?rev=261937=gcc=rev
Log:
Backported from mainline
2018-03-23  Jakub Jelinek  

PR inline-asm/85022
* alias.c (write_dependence_p): Don't require for x_canonicalized
non-VOIDmode if x has VOIDmode.

* c-c++-common/torture/pr85022.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/torture/pr85022.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/alias.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85140] [6/7 Regression] ICE with invalid use of alignas

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85140

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:03:38 2018
New Revision: 261944

URL: https://gcc.gnu.org/viewcvs?rev=261944=gcc=rev
Log:
Backported from mainline
2018-04-03  Jakub Jelinek  

PR c++/85140
* name-lookup.c (handle_namespace_attrs): Return early if attributes
is error_mark_node.

* g++.dg/cpp0x/gen-attrs-64.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/name-lookup.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/84791] ICE with broken OpenMP reduction clause

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84791

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:02:52 2018
New Revision: 261943

URL: https://gcc.gnu.org/viewcvs?rev=261943=gcc=rev
Log:
Backported from mainline
2018-03-30  Jakub Jelinek  

PR c++/84791
* semantics.c (finish_omp_reduction_clause): If
OMP_CLAUSE_REDUCTION_PLACEHOLDER is error_mark_node, return true
even if processing_template_decl.

* g++.dg/gomp/pr84791.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/gomp/pr84791.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/semantics.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/85095] [6/7 Regression] worse code generated

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85095

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:02:07 2018
New Revision: 261942

URL: https://gcc.gnu.org/viewcvs?rev=261942=gcc=rev
Log:
Backported from mainline
2018-03-28  Jakub Jelinek  

PR target/85095
* config/i386/i386.md (*add3_carry_0, *addsi3_carry_zext_0,
*sub3_carry_0, *subsi3_carry_zext_0): New patterns.

* gcc.target/i386/pr85095-1.c: New test.
* gcc.target/i386/pr85095-2.c: New test.
* gcc.c-torture/execute/pr85095.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/execute/pr85095.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr85095-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr85095-2.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/i386.md
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85068] [6/7 Regression] ICE with invalid covariant return type hierarchy

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85068

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:59:31 2018
New Revision: 261940

URL: https://gcc.gnu.org/viewcvs?rev=261940=gcc=rev
Log:
Backported from mainline
2018-03-27  Jakub Jelinek  

PR c++/85068
* class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo
is NULL.  Assert if thunk_binfo is NULL then errorcount is non-zero.

* g++.dg/inherit/covariant22.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/inherit/covariant22.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/class.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/85076] [6/7 Regression] ICE with invalid template used as lambda argument

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85076

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 21:01:00 2018
New Revision: 261941

URL: https://gcc.gnu.org/viewcvs?rev=261941=gcc=rev
Log:
Backported from mainline
2018-03-27  Jakub Jelinek  

PR c++/85076
* tree.c (cp_build_reference_type): If to_type is error_mark_node,
return it right away.

* g++.dg/cpp1y/pr85076.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1y/pr85076.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/tree.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug inline-asm/85034] [6/7 Regression] -O1 internal compiler error: in elimination_costs_in_insn, at reload1.c:3633

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85034

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:58:02 2018
New Revision: 261938

URL: https://gcc.gnu.org/viewcvs?rev=261938=gcc=rev
Log:
Backported from mainline
2018-03-23  Jakub Jelinek  

PR inline-asm/85034
* function.c (match_asm_constraints_1): Don't optimize if input
doesn't satisfy general_operand predicate for output's mode.

* gcc.target/i386/pr85034.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr85034.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/function.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug inline-asm/84941] [6/7 Regression] internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1870 (reg_overlap_mentioned_p()/match_asm_constraints_1())

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84941

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:56:25 2018
New Revision: 261936

URL: https://gcc.gnu.org/viewcvs?rev=261936=gcc=rev
Log:
Backported from mainline
2018-03-22  Jakub Jelinek  

PR inline-asm/84941
* function.c (match_asm_constraints_1): Don't do the optimization
if input isn't a REG, SUBREG, MEM or constant.

* gcc.dg/pr84941.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84941.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/function.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c/84999] [7 Regression] ICE in make_vector_type, at tree.c:9561

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84999

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:55:40 2018
New Revision: 261934

URL: https://gcc.gnu.org/viewcvs?rev=261934=gcc=rev
Log:
Backported from mainline
2018-03-21  Jakub Jelinek  

PR c/84999
* c-typeck.c (build_binary_op): If c_common_type_for_size fails when
building vector comparison, diagnose it and return error_mark_node.

* c-c++-common/pr84999.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/c-c++-common/pr84999.c
Modified:
branches/gcc-7-branch/gcc/c/ChangeLog
branches/gcc-7-branch/gcc/c/c-typeck.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/84961] [7 Regression] ICE error: SSA_NAME_DEF_STMT is wrong

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84961

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:54:44 2018
New Revision: 261933

URL: https://gcc.gnu.org/viewcvs?rev=261933=gcc=rev
Log:
Backported from mainline
2018-03-21  Jakub Jelinek  

PR c++/84961
* cp-tree.h (genericize_compound_lvalue): Declare.
* typeck.c (genericize_compound_lvalue): New function.
(unary_complex_lvalue, cp_build_modify_expr): Use it.
* semantics.c (finish_asm_stmt): Replace MODIFY_EXPR, PREINCREMENT_EXPR
and PREDECREMENT_EXPR in output and "m" constrained input operands with
COMPOUND_EXPR.  Call cxx_mark_addressable on the rightmost
COMPOUND_EXPR operand.

* c-c++-common/pr43690.c: Don't expect errors on "m" (--x) and
"m" (++x) in C++.
* g++.dg/torture/pr84961-1.C: New test.
* g++.dg/torture/pr84961-2.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/torture/pr84961-1.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/torture/pr84961-2.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-tree.h
branches/gcc-7-branch/gcc/cp/semantics.c
branches/gcc-7-branch/gcc/cp/typeck.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/c-c++-common/pr43690.c

[Bug debug/84875] [6/7 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2348 on s390x

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84875

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:53:41 2018
New Revision: 261932

URL: https://gcc.gnu.org/viewcvs?rev=261932=gcc=rev
Log:
Backported from mainline
2018-03-20  Jakub Jelinek  

PR debug/84875
* dce.c (delete_unmarked_insns): Don't remove frame related noop moves
holding REG_CFA_RESTORE notes, instead turn them into a USE.

* gcc.dg/pr84875.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84875.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/dce.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c/84953] [6/7 Regression] misleading warning from strpbrk(x,"")

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84953

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:52:44 2018
New Revision: 261931

URL: https://gcc.gnu.org/viewcvs?rev=261931=gcc=rev
Log:
Backported from mainline
2018-03-20  Jakub Jelinek  

PR c/84953
* builtins.c (fold_builtin_strpbrk): For strpbrk(x, "") use type
instead of TREE_TYPE (s1) for the return value.

* gcc.dg/pr84953.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84953.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/builtins.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug sanitizer/85018] [8 Regression] Many sanitizer tests ICE since r258681

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85018

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:51:42 2018
New Revision: 261930

URL: https://gcc.gnu.org/viewcvs?rev=261930=gcc=rev
Log:
Backported from mainline
2018-03-22  Jakub Jelinek  

PR sanitizer/85018
* dwarf2asm.c (dw2_output_indirect_constant_1): Set
DECL_INITIAL (decl) to decl at the end.
* varasm.c (use_blocks_for_decl_p): Revert the 2018-03-20 change,
adjust the comment.

2018-03-20  Jakub Jelinek  

PR target/84990
* dwarf2asm.c (dw2_output_indirect_constant_1): Temporarily turn off
flag_section_anchors.
* varasm.c (use_blocks_for_decl_p): Remove hack for
dw2_force_const_mem.

2018-03-19  Jakub Jelinek  

PR sanitizer/78651
* dwarf2asm.c: Include fold-const.c.
(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
of decl rather than decl itself.

2018-03-19  Maxim Ostapenko  

PR sanitizer/78651
* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
calling assemble_variable.

* g++.dg/asan/pr78651.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/asan/pr78651.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/dwarf2asm.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/varasm.c

[Bug sanitizer/78651] Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78651

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:51:42 2018
New Revision: 261930

URL: https://gcc.gnu.org/viewcvs?rev=261930=gcc=rev
Log:
Backported from mainline
2018-03-22  Jakub Jelinek  

PR sanitizer/85018
* dwarf2asm.c (dw2_output_indirect_constant_1): Set
DECL_INITIAL (decl) to decl at the end.
* varasm.c (use_blocks_for_decl_p): Revert the 2018-03-20 change,
adjust the comment.

2018-03-20  Jakub Jelinek  

PR target/84990
* dwarf2asm.c (dw2_output_indirect_constant_1): Temporarily turn off
flag_section_anchors.
* varasm.c (use_blocks_for_decl_p): Remove hack for
dw2_force_const_mem.

2018-03-19  Jakub Jelinek  

PR sanitizer/78651
* dwarf2asm.c: Include fold-const.c.
(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
of decl rather than decl itself.

2018-03-19  Maxim Ostapenko  

PR sanitizer/78651
* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
calling assemble_variable.

* g++.dg/asan/pr78651.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/asan/pr78651.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/dwarf2asm.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/varasm.c

[Bug target/84990] [8 Regression] Boostrap broken with --enable-checking=release and Ada

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84990

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:51:42 2018
New Revision: 261930

URL: https://gcc.gnu.org/viewcvs?rev=261930=gcc=rev
Log:
Backported from mainline
2018-03-22  Jakub Jelinek  

PR sanitizer/85018
* dwarf2asm.c (dw2_output_indirect_constant_1): Set
DECL_INITIAL (decl) to decl at the end.
* varasm.c (use_blocks_for_decl_p): Revert the 2018-03-20 change,
adjust the comment.

2018-03-20  Jakub Jelinek  

PR target/84990
* dwarf2asm.c (dw2_output_indirect_constant_1): Temporarily turn off
flag_section_anchors.
* varasm.c (use_blocks_for_decl_p): Remove hack for
dw2_force_const_mem.

2018-03-19  Jakub Jelinek  

PR sanitizer/78651
* dwarf2asm.c: Include fold-const.c.
(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
of decl rather than decl itself.

2018-03-19  Maxim Ostapenko  

PR sanitizer/78651
* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
calling assemble_variable.

* g++.dg/asan/pr78651.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/asan/pr78651.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/dwarf2asm.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/varasm.c

[Bug target/84899] [6/7 Regression] ICE: in final_scan_insn_1, at final.c:3139 (error: could not split insn)

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84899

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:48:57 2018
New Revision: 261929

URL: https://gcc.gnu.org/viewcvs?rev=261929=gcc=rev
Log:
Backported from mainline
2018-03-16  Jakub Jelinek  

PR target/84899
* postreload.c (reload_combine_recognize_pattern): Perform
INTVAL addition in unsigned HOST_WIDE_INT type to avoid UB and
truncate_int_for_mode the result for the destination's mode.

* gcc.dg/pr84899.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84899.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/postreload.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/84874] [6/7 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:5800

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84874

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:47:57 2018
New Revision: 261928

URL: https://gcc.gnu.org/viewcvs?rev=261928=gcc=rev
Log:
Backported from mainline
2018-03-16  Jakub Jelinek  

PR c++/84874
* g++.dg/cpp1z/desig8.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/desig8.C
Modified:
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/85994] Comparison failure in 64-bit libgcc *_{sav,res}ms64*.o on Solaris/x86

2018-06-22 Thread daniel.santos at pobox dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85994

--- Comment #11 from Daniel Santos  ---
Thank you Rainer!

[Bug tree-optimization/84841] [7 Regression] ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84841

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:46:37 2018
New Revision: 261927

URL: https://gcc.gnu.org/viewcvs?rev=261927=gcc=rev
Log:
Backported from mainline
2018-03-16  Jakub Jelinek  

PR tree-optimization/84841
* tree-ssa-reassoc.c (INTEGER_CONST_TYPE): Change to 1 << 4 from
1 << 3.
(FLOAT_ONE_CONST_TYPE): Define.
(constant_type): Return FLOAT_ONE_CONST_TYPE for -1.0 and 1.0.
(sort_by_operand_rank): Put entries with higher constant_type last
rather than first to match comments.

* gcc.dg/pr84841.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84841.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-reassoc.c

[Bug c++/84874] [6/7 Regression] internal compiler error: in reshape_init_class, at cp/decl.c:5800

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84874

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:44:39 2018
New Revision: 261926

URL: https://gcc.gnu.org/viewcvs?rev=261926=gcc=rev
Log:
Backported from mainline
2018-03-16  Jakub Jelinek  

PR c++/84874
* decl.c (reshape_init_class): Don't assert d->cur->index == field
if d->cur->index is a FIELD_DECL, instead set field to d->cur->index.

* g++.dg/cpp1z/desig7.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1z/desig7.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/decl.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/79085] [6/7 Regression] ICE with placement new to unaligned location

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79085

--- Comment #12 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:43:53 2018
New Revision: 261925

URL: https://gcc.gnu.org/viewcvs?rev=261925=gcc=rev
Log:
Backported from mainline
2018-03-15  Jakub Jelinek  

PR c++/79085
* calls.c (expand_call): For TREE_ADDRESSABLE rettype ignore alignment
check and use address of target always.

* g++.dg/opt/pr79085.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/opt/pr79085.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/calls.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/84222] [6/7 Regression] [[deprecated]] class complains about internal class usage

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84222

--- Comment #11 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:43:09 2018
New Revision: 261924

URL: https://gcc.gnu.org/viewcvs?rev=261924=gcc=rev
Log:
Backported from mainline
2018-03-15  Jakub Jelinek  

PR c++/84222
* cp-tree.h (cp_warn_deprecated_use): Declare.
* tree.c (cp_warn_deprecated_use): New function.
* typeck2.c (build_functional_cast): Use it.
* decl.c (grokparms): Likewise.
(grokdeclarator): Likewise.  Temporarily push nested class scope
around grokparms call for out of class member definitions.

* g++.dg/warn/deprecated.C (T::member3): Change dg-warning to dg-bogus.
* g++.dg/warn/deprecated-6.C (T::member3): Likewise.
* g++.dg/warn/deprecated-13.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/deprecated-13.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/cp-tree.h
branches/gcc-7-branch/gcc/cp/decl.c
branches/gcc-7-branch/gcc/cp/tree.c
branches/gcc-7-branch/gcc/cp/typeck2.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/deprecated-6.C
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/deprecated.C

[Bug target/84860] ICE in emit_move_insn, at expr.c:3717

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84860

--- Comment #4 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:41:55 2018
New Revision: 261923

URL: https://gcc.gnu.org/viewcvs?rev=261923=gcc=rev
Log:
Backported from mainline
2018-03-15  Jakub Jelinek  

PR target/84860
* optabs.c (emit_conditional_move): Pass address of cmode's copy
rather than address of cmode as last argument to prepare_cmp_insn.

* gcc.c-torture/compile/pr84860.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.c-torture/compile/pr84860.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/optabs.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c/84853] [7 Regression] ICE: verify_gimple failed (expand_shift_1)

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84853

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:40:45 2018
New Revision: 261922

URL: https://gcc.gnu.org/viewcvs?rev=261922=gcc=rev
Log:
Backported from mainline
2018-03-15  Jakub Jelinek  

PR c/84853
* c-typeck.c (build_binary_op) :
If code1 is INTEGER_TYPE, only allow code0 VECTOR_TYPE if it has
INTEGER_TYPE element type.

* gcc.dg/pr84853.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84853.c
Modified:
branches/gcc-7-branch/gcc/c/ChangeLog
branches/gcc-7-branch/gcc/c/c-typeck.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c/86287] New: AddressSanitizer: heap-use-after-free on bootstrap with -O3

2018-06-22 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86287

Bug ID: 86287
   Summary: AddressSanitizer: heap-use-after-free on bootstrap
with -O3
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

I have just tried to bootstrap trunk revision 261907 with address
sanitizer and got this:

==14968==ERROR: AddressSanitizer: heap-use-after-free on address 0x6110004afa94
at pc 0x0295ba08 bp 0x7ffcee5bc280 sp 0x7ffcee5bc278
READ of size 4 at 0x6110004afa94 thread T0
#0 0x295ba07 in vect_transform_loop_stmt
../../trunk/gcc/tree-vect-loop.c:8332
#1 0x29a1ffc in vect_transform_loop(_loop_vec_info*)
../../trunk/gcc/tree-vect-loop.c:8567
#2 0x2a232dd in try_vectorize_loop_1 ../../trunk/gcc/tree-vectorizer.c:757
#3 0x2a26163 in try_vectorize_loop ../../trunk/gcc/tree-vectorizer.c:807

Configure line was

../trunk/configure --prefix=/home/dcb/gcc/results.261907.asan \
--with-build-config=bootstrap-asan \
--disable-multilib \
--disable-werror \
--enable-checking=df,extra,fold,rtl,yes \
--enable-languages=c,c++,fortran

with

sed 's/-O2/-O3 -funroll-loops -Wlogical-op/' < Makefile > Makefile.tmp
mv Makefile.tmp Makefile

This used to work at revision 261641, so it looks like 
someone has broken something in the last few days.

[Bug middle-end/84834] [7 Regression] ICE: tree check: expected integer_cst, have complex_cst in to_wide, at tree.h:5527

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84834

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:38:25 2018
New Revision: 261921

URL: https://gcc.gnu.org/viewcvs?rev=261921=gcc=rev
Log:
Backported from mainline
2018-03-13  Jakub Jelinek  

PR middle-end/84834
* match.pd ((A & C) != 0 ? D : 0): Use INTEGER_CST@2 instead of
integer_pow2p@2 and test integer_pow2p in condition.
(A < 0 ? C : 0): Similarly for @1.

* gcc.dg/pr84834.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84834.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/match.pd
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/84827] [7 Regression] ICE in extract_insn, at recog.c:2311

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84827

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:37:40 2018
New Revision: 261920

URL: https://gcc.gnu.org/viewcvs?rev=261920=gcc=rev
Log:
Backported from mainline
2018-03-13  Jakub Jelinek  

PR target/84827
* config/i386/i386.md (round2): For 387 fancy math, disable
pattern if -ftrapping-math -fno-fp-int-builtin-inexact.

* gcc.target/i386/pr84827.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr84827.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/i386.md
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/84786] [miscompilation] vunpcklpd accessing xmm16-22 targeting KNL

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84786

--- Comment #17 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:36:31 2018
New Revision: 261919

URL: https://gcc.gnu.org/viewcvs?rev=261919=gcc=rev
Log:
Backported from mainline
2018-03-13  Jakub Jelinek  

PR target/84786
* config/i386/sse.md (sse2_loadhpd): Use Yv constraint rather than v
on the last operand.

* gcc.target/i386/avx512f-pr84786-1.c: New test.
* gcc.target/i386/avx512f-pr84786-2.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/avx512f-pr84786-1.c
branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/avx512f-pr84786-2.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/i386/sse.md
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug target/84772] powerpc-spe: Spurious "is used uninitialized" warning, or possibly incorrect codegen for va_arg(long double)

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84772

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:35:29 2018
New Revision: 261918

URL: https://gcc.gnu.org/viewcvs?rev=261918=gcc=rev
Log:
Backported from mainline
2018-03-09  Jakub Jelinek  

PR target/84772
* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Mark va_arg_tmp
temporary TREE_ADDRESSABLE before gimplification of BUILT_IN_MEMCPY.

* gcc.dg/pr84772.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84772.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/rs6000/rs6000.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/84076] [6/7 Regression] Warning about objects through POD mistakenly claims the object is a pointer

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84076

--- Comment #9 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:34:33 2018
New Revision: 261917

URL: https://gcc.gnu.org/viewcvs?rev=261917=gcc=rev
Log:
Backported from mainline
2018-03-09  Jason Merrill  
Jakub Jelinek  

PR c++/84076
* call.c (convert_arg_to_ellipsis): Instead of cp_build_addr_expr
build ADDR_EXPR with REFERENCE_TYPE.
(build_over_call): For purposes of check_function_arguments, if
argarray[j] is ADDR_EXPR with REFERENCE_TYPE created above, use
its operand rather than the argument itself.

* g++.dg/warn/Wformat-2.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wformat-2.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/call.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/84767] [6/7 Regression] ICE with pointer to VLA

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84767

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:33:38 2018
New Revision: 261916

URL: https://gcc.gnu.org/viewcvs?rev=261916=gcc=rev
Log:
Backported from mainline
2018-03-09  Jakub Jelinek  

PR c++/84767
* tree-inline.c (copy_tree_body_r): For INDIRECT_REF of a remapped
decl, use remap_type if we want to use the type.

* g++.dg/ext/vla18.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/ext/vla18.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-inline.c

[Bug c++/80598] [7 regression] -Wunused triggers for functions used in uninstantiated templates

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80598

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:32:15 2018
New Revision: 261915

URL: https://gcc.gnu.org/viewcvs?rev=261915=gcc=rev
Log:
Backported from mainline
2018-03-08  Jason Merrill  
Jakub Jelinek  

PR c++/80598
* call.c (build_over_call): In templates set TREE_USED (first_fn) when
not calling mark_used for the benefit of -Wunused-function warning.

* g++.dg/warn/Wunused-function4.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/warn/Wunused-function4.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/call.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug tree-optimization/84739] [6/7 Regression] ICE in get_value_for_expr, at tree-ssa-ccp.c:649

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84739

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:31:10 2018
New Revision: 261914

URL: https://gcc.gnu.org/viewcvs?rev=261914=gcc=rev
Log:
Backported from mainline
2018-03-08  Jakub Jelinek  

PR tree-optimization/84739
* tree-tailcall.c (find_tail_calls): Check call arguments against
DECL_ARGUMENTS (current_function_decl) rather than
DECL_ARGUMENTS (func) when checking for tail recursion.

* gcc.dg/pr84739.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.dg/pr84739.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-tailcall.c

[Bug target/84700] [6/7 Regression] ICE on 32-bit BE powerpc targets w/ -misel -O1

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84700

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:29:34 2018
New Revision: 261913

URL: https://gcc.gnu.org/viewcvs?rev=261913=gcc=rev
Log:
Backported from mainline
2018-03-05  Jakub Jelinek  

PR target/84700
* combine.c (combine_simplify_rtx): Don't try to simplify if
if_then_else_cond returned non-NULL, but either true_rtx or false_rtx
are equal to x.

* gcc.target/powerpc/pr84700.c: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/powerpc/pr84700.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/combine.c
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/84662] [6/7 Regression] internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in is_bitfield_expr_with_lowered_type, at cp/typeck.c:1944

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84662

--- Comment #7 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 20:28:04 2018
New Revision: 261912

URL: https://gcc.gnu.org/viewcvs?rev=261912=gcc=rev
Log:
Backported from mainline
2018-03-02  Jakub Jelinek  

PR c++/84662
* pt.c (tsubst_copy_and_build) : Use
RETURN instead of return.
: Likewise.
: If op0 is error_mark_node, just return
it instead of wrapping it into CONVERT_EXPR.

* g++.dg/cpp1y/pr84662.C: New test.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp1y/pr84662.C
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/cp/pt.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug c++/86286] New: Could __attribute__ ((nothrow)) on a noexcept function turn off EH codegen?

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86286

Bug ID: 86286
   Summary: Could __attribute__ ((nothrow)) on a noexcept function
turn off EH codegen?
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: enhancement
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

We generate ideal code for a noexcept function calling a noexcept function:

int f (int i) noexcept;
int foo (int i) noexcept { return f (i); }

_Z3fooi:
.LFB1:
.cfi_startproc
jmp _Z1fi
.cfi_endproc
.LFE0:


But when a noexcept function calls a non-noexcept function there is additional
code needed to call std::terminate if an exception occurs:


_Z3gooi:
.LFB1:
.cfi_startproc
.cfi_personality 0x3,__gxx_personality_v0
.cfi_lsda 0x3,.LLSDA1
jmp _Z1gi
.cfi_endproc
.LFE1:
.globl  __gxx_personality_v0
.section.gcc_except_table,"a",@progbits
.LLSDA1:
.byte   0xff
.byte   0xff
.byte   0x1
.uleb128 .LLSDACSE1-.LLSDACSB1
.LLSDACSB1:
.LLSDACSE1:
.text


If we know that the non-noexcept function definitely won't throw (e.g. because
we've explicitly checked its preconditions, or we just have additional
knowledge about the state of the program) we can eliminate that extra code with
a nothrow wrapper:

inline int g2 (int i) __attribute__((always_inline,nothrow));
inline int g2 (int i) { return g(i); }
int good (int i) noexcept { return g2 (i); }

_Z4goodi:
.LFB3:
.cfi_startproc
jmp _Z1gi
.cfi_endproc
.LFE3:

But this is awkward and doesn't scale. It's possible wrap the call in a lambda
using the attribute, but that's still awkward, and less readable:

int good (int i) noexcept {
  return [&]() __attribute__((nothrow)) { return g (i); }();
}


Would it be possible for the nothrow attribute to do that automatically when
placed on a noexcept function? i.e. instead of the g2 wrapper we'd just do:

int good (int i) noexcept __attribute__((nothrow));
int good (int i) noexcept { return g (i); }

I'd like this to declare a function that never throws (which 'noexcept'
guarantees), but also never needs to deal with exceptions coming from below it.


There could be code today which uses both noexcept and __attribute__
((nothrow)), maybe for pre-C++11 compatibility:

#ifdef __GNUC__
# define NOTHROW __attribute__((nothrow))
#endif
#if __cplusplus >= 201103L
# define NOEXCEPT noexcept
#else
# define NOEXCEPT
#endif

void f() NOEXCEPT NOTHROW;

If we're concerned about changing the behaviour of this code (from guaranteed
termination in C++11 and later if the function exits via an exception, to UB)
then maybe a new attribute would be better.

[Bug fortran/86206] ICE in gfc_resolve_forall, at fortran/resolve.c:9989

2018-06-22 Thread anlauf at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86206

--- Comment #3 from Harald Anlauf  ---
No ICE if the module is split into two parts:

! No ICE
module zero_mod
  implicit none
contains
  pure function zero_vec(xx) result(ret)
real, intent(in) :: xx(:)
real :: ret(size(xx))
integer :: i
forall (i=1:size(xx)) ret(i) = 0.0
  end function zero_vec
end module zero_mod

module zero_mod2
  use zero_mod
  implicit none
contains
  pure function zero_mat(xx) result(ret)
real, intent(in) :: xx(:,:)
real :: ret(size(xx,1),size(xx,2))
integer :: j
forall (j=1:size(xx,2)) ret(:,j) = zero_vec(xx(:,j))
  end function zero_mat
end module

[Bug c++/81589] Possible False-Positive with decltype

2018-06-22 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81589

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #10 from Jason Merrill  ---
Sounds like this is fixed, then.

[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function

2018-06-22 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #4 from kargl at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #3)
> (In reply to Rainer Orth from comment #1)
> > Created attachment 44310 [details]
> > proposed patch
> 
> Rainer,
> 
> Many, many thanks for taking care of this.
> 
> I know what the problem with assumed_charlen_function_7.f90 is all about.
> 
> Best regards
> 
> Paul

This is probably a a slightly better patch than Rainer's
patch (although checking for a NULL pointer as he has done
is not a bad idea).  Watch for cut-n-paste.

Index: resolve.c
===
--- resolve.c   (revision 261908)
+++ resolve.c   (working copy)
@@ -3116,6 +3136,7 @@ resolve_function (gfc_expr *expr)
   /* If this is a deferred TBP with an abstract interface, its result
  cannot be an assumed length character (F2003: C418).  */
   if (sym && sym->attr.abstract && sym->attr.function
+  && sym->result->ts.type == BT_CHARACTER
   && sym->result->ts.u.cl->length == NULL)
 {
gfc_error ("ABSTRACT INTERFACE %qs at %L must not have an assumed "

[Bug target/86285] We don't mangle __ieee128 correctly using -mlong-double-64 -mabi=ieeelongdouble

2018-06-22 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86285

--- Comment #2 from Peter Bergner  ---
When we compile using -mlong-double-64 -mabi=ibmlongdouble, we get what I'd
expect:

(gdb) ptree type
  constant 128>
unit-size  constant 16>
align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x758415a8 precision:128>

[Bug c++/38658] trivial try/catch statement not eliminated

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38658

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-06-22
 Ever confirmed|0   |1

--- Comment #4 from Jonathan Wakely  ---
(In reply to Martin Sebor from comment #3)
> There are situations when throwing an exception is required to result in a
> call to std::terminate() but those require the exception to escape the
> function where it's thrown from.  Outside of those, it  seems to me that as
> long as the observable effect of the optimized code is indistinguishable
> from the original (such as in the test case) removing try/catch statements
> should be a valid optimization.

Agreed.

[Bug target/86285] We don't mangle __ieee128 correctly using -mlong-double-64 -mabi=ieeelongdouble

2018-06-22 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86285

--- Comment #1 from Peter Bergner  ---
Setting a breakpoint at rs6000_mangle_type(tree type), I'm seeing:

(gdb) p type
$23 = (const_tree) 0x758413b0
(gdb) ptree type
  constant 64>
unit-size  constant 8>
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x758413b0 precision:64
pointer_to_this >


...so somehow the __ieee128 is being changed into a long double and since we
said long double is 64-bits (ie, double), we have:

(gdb) p TYPE_MODE(type)
$24 = E_DFmode

which causes us to return NULL and we get the default mangling 'e' for long
double.

[Bug target/86285] New: We don't mangle __ieee128 correctly using -mlong-double-64 -mabi=ieeelongdouble

2018-06-22 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86285

Bug ID: 86285
   Summary: We don't mangle __ieee128 correctly using
-mlong-double-64 -mabi=ieeelongdouble
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

We don't mangle __ieee128 correctly when compiling with -mlong-double-64
-mabi=ieeelongdouble.  We should always mangle it using u9__ieee128 instead of
'e'.

bergner@pike:~$ cat ieee128.cc 
void foo(__ieee128) {}
bergner@pike:~$ g++ -S -mlong-double-64 -mabi=ibmlongdouble ieee128.cc -o- |
grep globl
.globl _Z3foou9__ieee128
bergner@pike:~$ g++ -S -mlong-double-64 -mabi=ieeelongdouble ieee128.cc -o- |
grep globl
.globl _Z3fooe

[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function

2018-06-22 Thread pault at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281

--- Comment #3 from Paul Thomas  ---
(In reply to Rainer Orth from comment #1)
> Created attachment 44310 [details]
> proposed patch

Rainer,

Many, many thanks for taking care of this.

I know what the problem with assumed_charlen_function_7.f90 is all about.

Best regards

Paul

[Bug c++/85662] [8/9 Regression] "error: non-constant condition for static assertion" from __builtin_offsetof in C++

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85662

--- Comment #11 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 17:26:44 2018
New Revision: 261910

URL: https://gcc.gnu.org/viewcvs?rev=261910=gcc=rev
Log:
PR c++/85662
* g++.dg/ext/offsetof3.C: New test.

Added:
branches/gcc-8-branch/gcc/testsuite/g++.dg/ext/offsetof3.C
Modified:
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug c++/85662] [8/9 Regression] "error: non-constant condition for static assertion" from __builtin_offsetof in C++

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85662

--- Comment #10 from Jakub Jelinek  ---
Author: jakub
Date: Fri Jun 22 17:22:43 2018
New Revision: 261909

URL: https://gcc.gnu.org/viewcvs?rev=261909=gcc=rev
Log:
PR c++/85662
* g++.dg/ext/offsetof3.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/offsetof3.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug target/84786] [miscompilation] vunpcklpd accessing xmm16-22 targeting KNL

2018-06-22 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84786

--- Comment #16 from Jakub Jelinek  ---
Created attachment 44312
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44312=edit
gcc7-pr84786.patch

Patch I'm going to bootstrap/regtest on 7.x branch now.
On the trunk/in 8.x this got fixed with r253924 aka one of the PR82370 fixes,
but that is something that IMHO shouldn't be backported.

[Bug middle-end/86284] New: Insert trap instruction in place of missing return statement on dodgy code

2018-06-22 Thread ktkachov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86284

Bug ID: 86284
   Summary: Insert trap instruction in place of missing return
statement on dodgy code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ktkachov at gcc dot gnu.org
  Target Milestone: ---

Consider a non-void function that's missing a return statement:

int test()
{
  volatile int i = 0;
}

g++ at -O2 for aarch64 will generate:
_Z4testv:
.LFB0:
.cfi_startproc
sub sp, sp, #16
.cfi_def_cfa_offset 16
str wzr, [sp, 12]
.cfi_endproc
.LFE0:
.size   _Z4testv, .-_Z4testv

No return statement. That's fine (the code is undefined), and GCC even warns
about it.

We got a suggestion that GCC could insert a trap instruction at the end of such
a function so that at runtime we get a trap rather than the execution running
off into the abyss.

GCC already inserts traps in unreachable paths in gimple-ssa-isolate-paths.c,
so maybe we can also do this when we already detect that a function is broken
in this way?

[Bug tree-optimization/86259] [8/9 Regression] min(4, strlen(s)) optimized to strlen(s) with -flto

2018-06-22 Thread joseph at codesourcery dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86259

--- Comment #13 from joseph at codesourcery dot com  ---
Well, C90 TC1 adds (to the informative Annex listing undefined behavior) 
the case of array subscripts being out of range even if they wouldn't be 
simply based on the top-level object, such as a[1][7] given the 
declaration int a[4][5].  And of course array references are defined in 
terms of equivalent pointer arithmetic, so that's *(*(a+1) + 7).  So 
certainly for array objects, once you've got to a[1] or *(a+1) - as 
opposed to [1] or &*(a+1) - you can't then get something from a[2] from 
there.  (But e.g. [1] + 1 is a perfectly valid way of writing [2].  
And at least some of the examples here may be closer to that.)

[Bug fortran/86283] New: [9 regression] ICE in gfortran.dg/interface_abstract_4.f90 (and others) starting with r261868

2018-06-22 Thread seurer at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86283

Bug ID: 86283
   Summary: [9 regression] ICE in
gfortran.dg/interface_abstract_4.f90 (and others)
starting with r261868
   Product: gcc
   Version: 9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

FAIL: gfortran.dg/interface_abstract_4.f90   -O  (internal compiler error)
FAIL: gfortran.dg/interface_abstract_4.f90   -O  (test for excess errors)

spawn -ignore SIGHUP
/home/seurer/gcc/build/gcc-trunk/gcc/testsuite/gfortran/../../gfortran
-B/home/seurer/gcc/build/gcc-trunk/gcc/testsuite/gfortran/../../
-B/home/seurer/gcc/build/gcc-trunk/powerpc64-unknown-linux-gnu/./libgfortran/
/home/seurer/gcc/gcc-trunk/gcc/testsuite/gfortran.dg/interface_abstract_4.f90
-fno-diagnostics-show-caret -fdiagnostics-color=never -O -pedantic-errors -S -o
interface_abstract_4.s
/home/seurer/gcc/gcc-trunk/gcc/testsuite/gfortran.dg/interface_abstract_4.f90:29:12:
Error: ABSTRACT INTERFACE 'f' must not be referenced at (1)
/home/seurer/gcc/gcc-trunk/gcc/testsuite/gfortran.dg/interface_abstract_4.f90:30:68:
Error: ABSTRACT INTERFACE 's' must not be referenced at (1)
f951: internal compiler error: Segmentation fault
0x10a5cd8b crash_signal
/home/seurer/gcc/gcc-trunk/gcc/toplev.c:324
0x102cc538 resolve_function
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:3119
0x102c8adf gfc_resolve_expr(gfc_expr*)
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:6741
0x102cf9f3 resolve_compcall
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:6299
0x102c9257 resolve_typebound_function
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:6408
0x102c9257 gfc_resolve_expr(gfc_expr*)
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:6752
0x102bd597 gfc_resolve_code(gfc_code*, gfc_namespace*)
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:11133
0x102d315b gfc_resolve_blocks(gfc_code*, gfc_namespace*)
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:10173
0x102bd9f7 gfc_resolve_code(gfc_code*, gfc_namespace*)
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:11123
0x102c0b9f resolve_codes
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:16581
0x102c0afb resolve_codes
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:16565
0x102c0c53 gfc_resolve(gfc_namespace*)
/home/seurer/gcc/gcc-trunk/gcc/fortran/resolve.c:16616
0x102a7557 resolve_all_program_units
/home/seurer/gcc/gcc-trunk/gcc/fortran/parse.c:6064
0x102a7557 gfc_parse_file()
/home/seurer/gcc/gcc-trunk/gcc/fortran/parse.c:6314
0x103116cf gfc_be_parse_file
/home/seurer/gcc/gcc-trunk/gcc/fortran/f95-lang.c:204


these test cases also fail:

FAIL: gfortran.dg/assumed_charlen_function_7.f90   -O  (test for excess errors)

FAIL: gfortran.dg/actual_array_offset_1.f90   -O0  (internal compiler error)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O0  (test for excess errors)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O1  (internal compiler error)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O1  (test for excess errors)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O2  (internal compiler error)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O2  (test for excess errors)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O3 -g  (internal compiler error)
FAIL: gfortran.dg/actual_array_offset_1.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/actual_array_offset_1.f90   -Os  (internal compiler error)
FAIL: gfortran.dg/actual_array_offset_1.f90   -Os  (test for excess errors)

[Bug lto/82172] Destruction of basic_string in basic_stringbuf::overflow with _GLIBCXX_USE_CXX11_ABI=0, -flto, and C++17 mode results in invalid delete

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82172

--- Comment #25 from Jonathan Wakely  ---
(In reply to Gubbins from comment #24)
> > > Does anyone know how I would raise this with someone who can fix it on the
> > > Darwin side? Or could it be worked around by gcc?
> > 
> > Linker should provide precise information to GCC.
> 
> FWIW, I have raised a bug report on the Apple Developer Bug Reporter
> regarding the similar behaviour of the OSX linker.

Dave, the fix for PR 86138 might also fix this case for Darwin - could you
check that please?

The fix is committed to the tip of trunk and gcc-8-branch and gcc-7-branch.

[Bug libstdc++/86138] [7/8 Regression] C++17: getline(istream, string) crashes on Cygwin because incompatible C++14 function is called

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86138

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #22 from Jonathan Wakely  ---
Should be fixed for 7.4 and 8.2 now.

[Bug libstdc++/86138] [7/8 Regression] C++17: getline(istream, string) crashes on Cygwin because incompatible C++14 function is called

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86138

--- Comment #21 from Jonathan Wakely  ---
Author: redi
Date: Fri Jun 22 15:58:38 2018
New Revision: 261907

URL: https://gcc.gnu.org/viewcvs?rev=261907=gcc=rev
Log:
PR libstdc++/86138 prevent implicit instantiation of COW empty rep

The explicit instantiation declarations for std::basic_string are
disabled for C++17 (and later) so that basic_string symbols get
implicitly instantiated in every translation unit that needs them.  On
targets that don't support STB_GNU_UNIQUE this leads to multiple copies
of the empty rep symbol for COW strings. In order to detect whether a
COW string needs to deallocate its storage it compares the address with
the empty rep.  When there are multiple copies of the empty rep object
the address is not unique, and so string destructors try to delete the
empty rep, which crashes.

In order to guarantee uniqueness of the _S_empty_rep_storage symbol this
patch adds an explicit instantiation declaration for just that symbol.
This means the other symbols are still implicitly instantiated in C++17
code, but for the empty rep the definition in the library gets used.

Separately, there is no need for C++17 code to implicitly instantiate
the I/O functions for strings, so this also restores the explicit
instantiation declarations for those functions.

Backport from mainline
2018-06-22  Jonathan Wakely  

PR libstdc++/86138
* include/bits/basic_string.tcc:
[__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
(basic_string::_Rep::_S_empty_rep_storage)
(basic_string::_Rep::_S_empty_rep_storage): Add explicit
instantiation declarations.
[__cplusplus > 201402] (operator>>, operator<<, getline): Re-enable
explicit instantiation declarations.
* testsuite/21_strings/basic_string/cons/char/86138.cc: New.
* testsuite/21_strings/basic_string/cons/wchar_t/86138.cc: New.

Added:
   
branches/gcc-7-branch/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/86138.cc
   
branches/gcc-7-branch/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/86138.cc
Modified:
branches/gcc-7-branch/libstdc++-v3/ChangeLog
branches/gcc-7-branch/libstdc++-v3/include/bits/basic_string.tcc

[Bug tree-optimization/86263] [9 Regression] [nvptx] casesi, tablejump

2018-06-22 Thread cesar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86263

cesar at gcc dot gnu.org changed:

   What|Removed |Added

 CC||cesar at gcc dot gnu.org

--- Comment #6 from cesar at gcc dot gnu.org ---
Created attachment 44311
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44311=edit
newlib test case

I attached a reduced test case from ecvtbuf.c. At Thomas mentioned, it's
failing with nvptx-gcc.

[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)

2018-06-22 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61247

Eric Gallager  changed:

   What|Removed |Added

 CC||egallager at gcc dot gnu.org

--- Comment #3 from Eric Gallager  ---
This came up on the mailing lists here:
https://gcc.gnu.org/ml/gcc/2018-06/msg00238.html

[Bug target/86222] ICE in final_scan_insn_1 calling strncmp() with a bound of PTRDIFF_MAX + 1

2018-06-22 Thread acsawdey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86222

--- Comment #5 from acsawdey at gcc dot gnu.org ---
Author: acsawdey
Date: Fri Jun 22 15:37:36 2018
New Revision: 261906

URL: https://gcc.gnu.org/viewcvs?rev=261906=gcc=rev
Log:
Forgot PR target/86222 in ChangeLog

Modified:
trunk/gcc/ChangeLog

[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function

2018-06-22 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281

Rainer Orth  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-06-22
 Ever confirmed|0   |1

--- Comment #2 from Rainer Orth  ---
The attached patch makes all but a single failure go away:

FAIL: gfortran.dg/assumed_charlen_function_7.f90   -O  (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/assumed_charlen_function_7.f90:18:4:
Warning: Obsolescent feature: CHARACTER(*) function 'abc_interface' at (1)

Tested on i386-pc-solaris2.11.

[Bug fortran/86281] [9 regression] SEGV in fortran/resolve.c:resolve_function

2018-06-22 Thread ro at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86281

--- Comment #1 from Rainer Orth  ---
Created attachment 44310
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44310=edit
proposed patch

[Bug libstdc++/86138] [7/8 Regression] C++17: getline(istream, string) crashes on Cygwin because incompatible C++14 function is called

2018-06-22 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86138

--- Comment #20 from Jonathan Wakely  ---
Author: redi
Date: Fri Jun 22 14:56:18 2018
New Revision: 261902

URL: https://gcc.gnu.org/viewcvs?rev=261902=gcc=rev
Log:
PR libstdc++/86138 prevent implicit instantiation of COW empty rep

The explicit instantiation declarations for std::basic_string are
disabled for C++17 (and later) so that basic_string symbols get
implicitly instantiated in every translation unit that needs them.  On
targets that don't support STB_GNU_UNIQUE this leads to multiple copies
of the empty rep symbol for COW strings. In order to detect whether a
COW string needs to deallocate its storage it compares the address with
the empty rep.  When there are multiple copies of the empty rep object
the address is not unique, and so string destructors try to delete the
empty rep, which crashes.

In order to guarantee uniqueness of the _S_empty_rep_storage symbol this
patch adds an explicit instantiation declaration for just that symbol.
This means the other symbols are still implicitly instantiated in C++17
code, but for the empty rep the definition in the library gets used.

Separately, there is no need for C++17 code to implicitly instantiate
the I/O functions for strings, so this also restores the explicit
instantiation declarations for those functions.

Backport from mainline
2018-06-22  Jonathan Wakely  

PR libstdc++/86138
* include/bits/basic_string.tcc:
[__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
(basic_string::_Rep::_S_empty_rep_storage)
(basic_string::_Rep::_S_empty_rep_storage): Add explicit
instantiation declarations.
[__cplusplus > 201402] (operator>>, operator<<, getline): Re-enable
explicit instantiation declarations.
* testsuite/21_strings/basic_string/cons/char/86138.cc: New.
* testsuite/21_strings/basic_string/cons/wchar_t/86138.cc: New.

Added:
   
branches/gcc-8-branch/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/86138.cc
   
branches/gcc-8-branch/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/86138.cc
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/include/bits/basic_string.tcc

[Bug fortran/86278] gfortran crashes with internal compiler error: segmentation fault

2018-06-22 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86278

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||kargl at gcc dot gnu.org
 Resolution|--- |WORKSFORME

--- Comment #1 from kargl at gcc dot gnu.org ---
This issues has been fixed on all active branches.  You either need to build
gfortran from sources or wait for the release of gfortran 7.4.

  1   2   3   >