]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
7 years agoPR c++/80290 - memory-hog with std::pair.
Jason Merrill [Thu, 28 Jun 2018 00:25:21 +0000 (20:25 -0400)] 
PR c++/80290 - memory-hog with std::pair.

* pt.c (type_unification_real): Skip non-dependent conversion
check for a nested list argument.
(braced_init_depth): New.

From-SVN: r262204

7 years agoDaily bump.
GCC Administrator [Thu, 28 Jun 2018 00:16:20 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r262201

7 years ago[multiple changes]
David Edelsohn [Wed, 27 Jun 2018 20:08:21 +0000 (20:08 +0000)] 
[multiple changes]

2018-06-27  David Edelsohn  <dje.gcc@gmail.com>

        2018-06-19  Tony Reix  <tony.reix@atos.com>
            Damien Bergamini  <damien.bergamini@atos.com>
            David Edelsohn  <dje.gcc@gmail.com>

        * collect2.c (static_obj): New variable.
        (static_libs): New variable.
        (is_in_list): Uncomment declaration.
        (main): Track AIX libraries linked statically.
        (is_in_list): Uncomment definition.
        (scan_prog_file): Don't add AIX shared libraries initializer
        to constructor list if linking statically.

From-SVN: r262193

7 years agoDaily bump.
GCC Administrator [Wed, 27 Jun 2018 00:16:42 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r262169

7 years agobackport: rs6000-c.c (altivec_overloaded_builtins): Change behavior of vec_packsu...
Kelvin Nilsen [Tue, 26 Jun 2018 19:45:01 +0000 (19:45 +0000)] 
backport: rs6000-c.c (altivec_overloaded_builtins): Change behavior of vec_packsu (vector unsigned long long...

gcc/ChangeLog:

2018-06-26  Kelvin Nilsen  <kelvin@gcc.gnu.org>

Backported from mainline
2018-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Change
behavior of vec_packsu (vector unsigned long long, vector unsigned
long long) to match behavior of vec_packs with same signature.

gcc/testsuite/ChangeLog:

2018-06-26  Kelvin Nilsen  <kelvin@gcc.gnu.org>

Backported from mainline
2018-06-20  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* gcc.target/powerpc/builtins-1.c: Add dg directives to scan
for vpkudus.

From-SVN: r262164

7 years agoS/390: Fix mtune default.
Robin Dapp [Tue, 26 Jun 2018 12:23:02 +0000 (12:23 +0000)] 
S/390: Fix mtune default.

When building with --with-tune=zEC12 and calling the resulting gcc
with --march=z13 (no extra -mtune), the binary would unexpectedly be compiled
with -march=z13 -mtune=zEC12.  This patch avoids using the default tune
parameter if -march is specified as argument but the user can still
explicitly state -march=z13 -mtune=zEC12.

gcc/ChangeLog:

2018-06-26  Robin Dapp  <rdapp@linux.ibm.com>

        * config/s390/s390.h (enum processor_flags): Do not use
        default tune parameter when -march was specified.

From-SVN: r262145

7 years agore PR target/86314 (GCC 7.x and 8.x zero out "eax" before using "rax" in "lock bts")
Jakub Jelinek [Tue, 26 Jun 2018 11:54:29 +0000 (13:54 +0200)] 
re PR target/86314 (GCC 7.x and 8.x zero out "eax" before using "rax" in "lock bts")

PR target/86314
* config/i386/i386.md (setcc + movzbl to xor + setcc peephole2s):
Check reg_overlap_mentioned_p in addition to reg_set_p with the same
operands.

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

From-SVN: r262144

7 years agore PR c++/86291 (OpenMP incorrect for-loop collapsing with iterators and at least...
Jakub Jelinek [Tue, 26 Jun 2018 11:16:10 +0000 (13:16 +0200)] 
re PR c++/86291 (OpenMP incorrect for-loop collapsing with iterators and at least 5 nested loops)

PR c++/86291
* parser.c (cp_parser_omp_for_loop_init): Change for_block argument
type from vec<tree, va_gc> * to vec<tree, va_gc> *&.

* testsuite/libgomp.c++/pr86291.C: New test.

From-SVN: r262139

7 years agoDaily bump.
GCC Administrator [Tue, 26 Jun 2018 00:16:36 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r262125

7 years agobackport: re PR target/85424 (The __builtin_packlongdouble function might have issues...
Michael Meissner [Mon, 25 Jun 2018 23:28:27 +0000 (23:28 +0000)] 
backport: re PR target/85424 (The __builtin_packlongdouble function might have issues with the output overlapping the inputs)

2018-06-25  Michael Meissner  <meissner@linux.vnet.ibm.com>

Back port from trunk
2018-04-17  Michael Meissner  <meissner@linux.vnet.ibm.com>

PR target/85424
* config/rs6000/rs6000.md (pack<mode>): Do not try handle a pack
where the inputs overlap with the output.

From-SVN: r262122

7 years agore PR fortran/82972 (ICE with -finit-derived in gfc_conv_structure, at fortran/trans...
Fritz Reese [Mon, 25 Jun 2018 19:07:03 +0000 (19:07 +0000)] 
re PR fortran/82972 (ICE with -finit-derived in gfc_conv_structure, at fortran/trans-expr.c:7733 (and others))

2018-06-25  Fritz Reese  <fritzoreese@gmail.com>

PR fortran/82972
PR fortran/83088
PR fortran/85851
Backport from trunk.
* expr.c (component_initializer): Assign init expr to c->initializer.
(generate_isocbinding_initializer): New.
(gfc_generate_initializer): Call generate_isocbinding_initializer to
generate initializers for c_ptr and c_funptr with -finit-derived.

2018-06-25  Fritz Reese  <fritzoreese@gmail.com>

PR fortran/82972
PR fortran/83088
PR fortran/85851
Backport from trunk.
* gfortran.dg/init_flag_17.f90: New testcase.

From-SVN: r262106

7 years agore PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)
Jakub Jelinek [Mon, 25 Jun 2018 12:48:29 +0000 (14:48 +0200)] 
re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)

PR target/84786
* config/i386/sse.md (vshift_count): New mode attr.
(<shift_insn><mode>3<mask_name>): Use <vshift_count>N instead of vN
as last operand's constraint for VI2_AVX2_AVX512BW shifts.  Use YvN
instead of vN as last operand's constraint for VI48_AVX2 shifts.

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

From-SVN: r262014

7 years agore PR fortran/83118 (Bad intrinsic assignment of class(*) array component of derived...
Paul Thomas [Mon, 25 Jun 2018 07:52:09 +0000 (07:52 +0000)] 
re PR fortran/83118 (Bad intrinsic assignment of class(*) array component of derived type)

2018-06-25  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83118
Back port from trunk
* resolve.c (resolve_ordinary_assign): Force the creation of a
vtable for assignment of non-polymorphic expressions to an
unlimited polymorphic object.
* trans-array.c (gfc_alloc_allocatable_for_assignment): Use the
size of the rhs type for such assignments. Set the dtype, _len
and vptrs appropriately.
* trans-expr.c (gfc_trans_assignment): Force the use of the
_copy function for these assignments.

2018-06-25  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/83118
Back port from trunk
* gfortran.dg/unlimited_polymorphic_30.f03: New test.

From-SVN: r262005

7 years agoDaily bump.
GCC Administrator [Mon, 25 Jun 2018 00:16:48 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r262000

7 years agoDaily bump.
GCC Administrator [Sun, 24 Jun 2018 00:16:25 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261990

7 years agoFix phi backedge detection in backprop (PR85989)
Richard Sandiford [Sat, 23 Jun 2018 12:21:18 +0000 (12:21 +0000)] 
Fix phi backedge detection in backprop (PR85989)

Backport trunk r261064.

2018-06-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
PR tree-optimization/85989
* gimple-ssa-backprop.c (backprop::m_visited_phis): New member
variable.
(backprop::intersect_uses): Check it when deciding whether this
is a backedge reference.
(backprop::process_block): Add each phi to m_visited_phis
after visiting it, then clear it at the end.

gcc/testsuite/
PR tree-optimization/85989
* gcc.dg/torture/pr85989.c: New test.

From-SVN: r261984

7 years agoDaily bump.
GCC Administrator [Sat, 23 Jun 2018 00:16:47 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261977

7 years agobackport: re PR c++/86210 (Missing -Wnonnull warning for function defined in the...
Jakub Jelinek [Fri, 22 Jun 2018 21:33:58 +0000 (23:33 +0200)] 
backport: re PR c++/86210 (Missing -Wnonnull warning for function defined in the same TU)

Backported from mainline
2018-06-20  Jakub Jelinek  <jakub@redhat.com>

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

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

From-SVN: r261970

7 years agobackport: re PR tree-optimization/86231 (vrp_meet causes wrong-code)
Jakub Jelinek [Fri, 22 Jun 2018 21:33:07 +0000 (23:33 +0200)] 
backport: re PR tree-optimization/86231 (vrp_meet causes wrong-code)

Backported from mainline
2018-06-20  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261969

7 years agobackport: re PR middle-end/85878 (ICE in convert_mode_scalar, at expr.c:287)
Jakub Jelinek [Fri, 22 Jun 2018 21:30:06 +0000 (23:30 +0200)] 
backport: re PR middle-end/85878 (ICE in convert_mode_scalar, at expr.c:287)

Backported from mainline
2018-06-15  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261968

7 years agobackport: re PR target/85945 (ICE in resolve_subreg_use, at lower-subreg.c:751)
Jakub Jelinek [Fri, 22 Jun 2018 21:29:24 +0000 (23:29 +0200)] 
backport: re PR target/85945 (ICE in resolve_subreg_use, at lower-subreg.c:751)

Backported from mainline
2018-06-14  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261967

7 years agobackport: re PR c++/86025 (ICE with -Wduplicated-branches and OpenMP critical)
Jakub Jelinek [Fri, 22 Jun 2018 21:28:36 +0000 (23:28 +0200)] 
backport: re PR c++/86025 (ICE with -Wduplicated-branches and OpenMP critical)

Backported from mainline
2018-06-04  Jakub Jelinek  <jakub@redhat.com>

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

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

From-SVN: r261966

7 years agobackport: re PR c++/85952 (Bogus -Wunused-but-set-variable warning with array structu...
Jakub Jelinek [Fri, 22 Jun 2018 21:27:41 +0000 (23:27 +0200)] 
backport: re PR c++/85952 (Bogus -Wunused-but-set-variable warning with array structured binding)

Backported from mainline
2018-05-29  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261965

7 years agobackport: re PR c/85696 (OpenMP with variably modified and default(none) won't compile)
Jakub Jelinek [Fri, 22 Jun 2018 21:27:25 +0000 (23:27 +0200)] 
backport: re PR c/85696 (OpenMP with variably modified and default(none) won't compile)

Backported from mainline
2018-05-11  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261964

7 years agobackport: re PR c/85696 (OpenMP with variably modified and default(none) won't compile)
Jakub Jelinek [Fri, 22 Jun 2018 21:25:04 +0000 (23:25 +0200)] 
backport: re PR c/85696 (OpenMP with variably modified and default(none) won't compile)

Backported from mainline
2018-05-11  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261963

7 years agobackport: re PR c++/85662 ("error: non-constant condition for static assertion" from...
Jakub Jelinek [Fri, 22 Jun 2018 21:23:03 +0000 (23:23 +0200)] 
backport: re PR c++/85662 ("error: non-constant condition for static assertion" from __builtin_offsetof in C++)

Backported from mainline
2018-06-22  Jakub Jelinek  <jakub@redhat.com>

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

2018-05-10  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261962

7 years agobackport: re PR c++/85659 (ICE with inline assembly inside virtual function)
Jakub Jelinek [Fri, 22 Jun 2018 21:20:53 +0000 (23:20 +0200)] 
backport: re PR c++/85659 (ICE with inline assembly inside virtual function)

Backported from mainline
2018-05-06  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261961

7 years agobackport: re PR web/85578 (broken links in gcc-8.0.1-RC-20180427/INSTALL/specific...
Jakub Jelinek [Fri, 22 Jun 2018 21:20:02 +0000 (23:20 +0200)] 
backport: re PR web/85578 (broken links in gcc-8.0.1-RC-20180427/INSTALL/specific.html, and out of date prerequisites.html)

Backported from mainline
2018-05-01  Jakub Jelinek  <jakub@redhat.com>

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

From-SVN: r261960

7 years agobackport: re PR tree-optimization/85529 (wrong code at -O2 and -O3 on x86_64-linux...
Jakub Jelinek [Fri, 22 Jun 2018 21:19:32 +0000 (23:19 +0200)] 
backport: re PR tree-optimization/85529 (wrong code at -O2 and -O3 on x86_64-linux-gnu)

Backported from mainline
2018-04-27  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261959

7 years agobackport: re PR tree-optimization/85446 (wrong-code on riscv64)
Jakub Jelinek [Fri, 22 Jun 2018 21:18:32 +0000 (23:18 +0200)] 
backport: re PR tree-optimization/85446 (wrong-code on riscv64)

Backported from mainline
2018-04-19  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261958

7 years agobackport: re PR jit/85384 (libgccjit does not work if --with-gcc-major-version is...
Jakub Jelinek [Fri, 22 Jun 2018 21:16:41 +0000 (23:16 +0200)] 
backport: re PR jit/85384 (libgccjit does not work if --with-gcc-major-version is used)

2018-06-22  Jakub Jelinek  <jakub@redhat.com>

Backported from mainline
2018-04-18  David Malcolm  <dmalcolm@redhat.com>

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.

From-SVN: r261957

7 years agobackport: re PR c++/84463 (Supposedly-incompliant "error: '* key0' is not a constant...
Jakub Jelinek [Fri, 22 Jun 2018 21:12:32 +0000 (23:12 +0200)] 
backport: re PR c++/84463 (Supposedly-incompliant "error: '* key0' is not a constant expression")

Backported from mainline
2018-04-18  Jakub Jelinek  <jakub@redhat.com>

PR c++/84463
* typeck.c (cp_build_addr_expr_1): Move handling of offsetof-like
tricks from here to ...
* cp-gimplify.c (cp_fold) <case ADDR_EXPR>: ... 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.

From-SVN: r261956

7 years agobackport: re PR rtl-optimization/85431 (UBSAN: ../../gcc/dse.c:303:15: runtime error...
Jakub Jelinek [Fri, 22 Jun 2018 21:11:28 +0000 (23:11 +0200)] 
backport: re PR rtl-optimization/85431 (UBSAN: ../../gcc/dse.c:303:15: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int')

Backported from mainline
2018-04-17  Jakub Jelinek  <jakub@redhat.com>

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

From-SVN: r261955

7 years agobackport: re PR target/85430 (ICE: SIGSEGV in memory_operand at recog.c:1358/9 with...
Jakub Jelinek [Fri, 22 Jun 2018 21:10:59 +0000 (23:10 +0200)] 
backport: re PR target/85430 (ICE: SIGSEGV in memory_operand at recog.c:1358/9 with -O2 -fno-tree-ccp -fno-tree-fre)

Backported from mainline
2018-04-17  Jakub Jelinek  <jakub@redhat.com>

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

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

From-SVN: r261954

7 years agobackport: re PR rtl-optimization/85300 (ICE in exact_int_to_float_conversion_p, at...
Jakub Jelinek [Fri, 22 Jun 2018 21:10:17 +0000 (23:10 +0200)] 
backport: re PR rtl-optimization/85300 (ICE in exact_int_to_float_conversion_p, at simplify-rtx.c:895)

Backported from mainline
2018-04-10  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261953

7 years agobackport: re PR fortran/85313 (gcc/fortran/openmp.c: 2 * confused logic ?)
Jakub Jelinek [Fri, 22 Jun 2018 21:09:32 +0000 (23:09 +0200)] 
backport: re PR fortran/85313 (gcc/fortran/openmp.c: 2 * confused logic ?)

Backported from mainline
2018-04-10  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261952

7 years agobackport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading...
Jakub Jelinek [Fri, 22 Jun 2018 21:08:47 +0000 (23:08 +0200)] 
backport: re PR tree-optimization/85257 (wrong code with -O -fno-tree-ccp and reading zeroed vector member)

Backported from mainline
2018-04-07  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261951

7 years agobackport: re PR debug/85252 (ICE with -g for static zero-length array initialization)
Jakub Jelinek [Fri, 22 Jun 2018 21:08:00 +0000 (23:08 +0200)] 
backport: re PR debug/85252 (ICE with -g for static zero-length array initialization)

Backported from mainline
2018-04-06  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261950

7 years agobackport: re PR c++/85210 (ICE with broken structured binding in template)
Jakub Jelinek [Fri, 22 Jun 2018 21:07:16 +0000 (23:07 +0200)] 
backport: re PR c++/85210 (ICE with broken structured binding in template)

Backported from mainline
2018-04-06  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261949

7 years agobackport: re PR c++/85208 (ICE with #pragma weak and structured binding)
Jakub Jelinek [Fri, 22 Jun 2018 21:06:41 +0000 (23:06 +0200)] 
backport: re PR c++/85208 (ICE with #pragma weak and structured binding)

Backported from mainline
2018-04-05  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261948

7 years agobackport: re PR inline-asm/85172 (internal compiler error: unexpected expression...
Jakub Jelinek [Fri, 22 Jun 2018 21:05:52 +0000 (23:05 +0200)] 
backport: re PR inline-asm/85172 (internal compiler error: unexpected expression '<statement>' of kind asm_expr)

Backported from mainline
2018-04-04  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261947

7 years agobackport: re PR rtl-optimization/85167 (shrink-wrap.c:333:15: runtime error with...
Jakub Jelinek [Fri, 22 Jun 2018 21:05:08 +0000 (23:05 +0200)] 
backport: re PR rtl-optimization/85167 (shrink-wrap.c:333:15: runtime error with UBSAN)

Backported from mainline
2018-04-03  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261946

7 years agobackport: re PR c++/85147 (ICE with invalid variadic template-template parameter)
Jakub Jelinek [Fri, 22 Jun 2018 21:04:25 +0000 (23:04 +0200)] 
backport: re PR c++/85147 (ICE with invalid variadic template-template parameter)

Backported from mainline
2018-04-03  Jakub Jelinek  <jakub@redhat.com>

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

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

From-SVN: r261945

7 years agobackport: re PR c++/85140 (ICE with invalid use of alignas)
Jakub Jelinek [Fri, 22 Jun 2018 21:03:38 +0000 (23:03 +0200)] 
backport: re PR c++/85140 (ICE with invalid use of alignas)

Backported from mainline
2018-04-03  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261944

7 years agobackport: re PR c++/84791 (ICE with broken OpenMP reduction clause)
Jakub Jelinek [Fri, 22 Jun 2018 21:02:52 +0000 (23:02 +0200)] 
backport: re PR c++/84791 (ICE with broken OpenMP reduction clause)

Backported from mainline
2018-03-30  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261943

7 years agobackport: re PR target/85095 (worse code generated)
Jakub Jelinek [Fri, 22 Jun 2018 21:02:07 +0000 (23:02 +0200)] 
backport: re PR target/85095 (worse code generated)

Backported from mainline
2018-03-28  Jakub Jelinek  <jakub@redhat.com>

PR target/85095
* config/i386/i386.md (*add<mode>3_carry_0, *addsi3_carry_zext_0,
*sub<mode>3_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.

From-SVN: r261942

7 years agobackport: re PR c++/85076 (ICE with invalid template used as lambda argument)
Jakub Jelinek [Fri, 22 Jun 2018 21:01:00 +0000 (23:01 +0200)] 
backport: re PR c++/85076 (ICE with invalid template used as lambda argument)

Backported from mainline
2018-03-27  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261941

7 years agobackport: re PR c++/85068 (ICE with invalid covariant return type hierarchy)
Jakub Jelinek [Fri, 22 Jun 2018 20:59:31 +0000 (22:59 +0200)] 
backport: re PR c++/85068 (ICE with invalid covariant return type hierarchy)

Backported from mainline
2018-03-27  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261940

7 years agobackport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p...
Jakub Jelinek [Fri, 22 Jun 2018 20:58:44 +0000 (22:58 +0200)] 
backport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias.c:3003)

Backported from mainline
2018-03-23  Jakub Jelinek  <jakub@redhat.com>

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

From-SVN: r261939

7 years agobackport: re PR inline-asm/85034 (-O1 internal compiler error: in elimination_costs_i...
Jakub Jelinek [Fri, 22 Jun 2018 20:58:02 +0000 (22:58 +0200)] 
backport: re PR inline-asm/85034 (-O1 internal compiler error: in elimination_costs_in_insn, at reload1.c:3633)

Backported from mainline
2018-03-23  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261938

7 years agobackport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p...
Jakub Jelinek [Fri, 22 Jun 2018 20:57:15 +0000 (22:57 +0200)] 
backport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias.c:3003)

Backported from mainline
2018-03-23  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261937

7 years agobackport: re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p...
Jakub Jelinek [Fri, 22 Jun 2018 20:56:25 +0000 (22:56 +0200)] 
backport: re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1870 (reg_overlap_mentioned_p()/match_asm_constraints_1()))

Backported from mainline
2018-03-22  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261936

7 years agobackport: re PR c/84999 (ICE in make_vector_type, at tree.c:9561)
Jakub Jelinek [Fri, 22 Jun 2018 20:55:40 +0000 (22:55 +0200)] 
backport: re PR c/84999 (ICE in make_vector_type, at tree.c:9561)

Backported from mainline
2018-03-21  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261934

7 years agobackport: re PR c++/84961 (ICE error: SSA_NAME_DEF_STMT is wrong)
Jakub Jelinek [Fri, 22 Jun 2018 20:54:44 +0000 (22:54 +0200)] 
backport: re PR c++/84961 (ICE error: SSA_NAME_DEF_STMT is wrong)

Backported from mainline
2018-03-21  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261933

7 years agobackport: re PR debug/84875 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348...
Jakub Jelinek [Fri, 22 Jun 2018 20:53:41 +0000 (22:53 +0200)] 
backport: re PR debug/84875 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2348 on s390x)

Backported from mainline
2018-03-20  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261932

7 years agobackport: re PR c/84953 (misleading warning from strpbrk(x,""))
Jakub Jelinek [Fri, 22 Jun 2018 20:52:44 +0000 (22:52 +0200)] 
backport: re PR c/84953 (misleading warning from strpbrk(x,""))

Backported from mainline
2018-03-20  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261931

7 years agobackport: re PR sanitizer/85018 (Many sanitizer tests ICE since r258681)
Jakub Jelinek [Fri, 22 Jun 2018 20:51:42 +0000 (22:51 +0200)] 
backport: re PR sanitizer/85018 (Many sanitizer tests ICE since r258681)

Backported from mainline
2018-03-22  Jakub Jelinek  <jakub@redhat.com>

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  <jakub@redhat.com>

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  <jakub@redhat.com>

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  <m.ostapenko@samsung.com>

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

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

From-SVN: r261930

7 years agobackport: re PR target/84899 (ICE: in final_scan_insn_1, at final.c:3139 (error:...
Jakub Jelinek [Fri, 22 Jun 2018 20:48:57 +0000 (22:48 +0200)] 
backport: re PR target/84899 (ICE: in final_scan_insn_1, at final.c:3139 (error: could not split insn))

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261929

7 years agobackport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp...
Jakub Jelinek [Fri, 22 Jun 2018 20:47:57 +0000 (22:47 +0200)] 
backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp/decl.c:5800)

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

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

From-SVN: r261928

7 years agobackport: re PR tree-optimization/84841 (ICE: tree check: expected ssa_name, have...
Jakub Jelinek [Fri, 22 Jun 2018 20:46:37 +0000 (22:46 +0200)] 
backport: re PR tree-optimization/84841 (ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624)

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261927

7 years agobackport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp...
Jakub Jelinek [Fri, 22 Jun 2018 20:44:39 +0000 (22:44 +0200)] 
backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp/decl.c:5800)

Backported from mainline
2018-03-16  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261926

7 years agobackport: re PR c++/79085 (ICE with placement new to unaligned location)
Jakub Jelinek [Fri, 22 Jun 2018 20:43:53 +0000 (22:43 +0200)] 
backport: re PR c++/79085 (ICE with placement new to unaligned location)

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261925

7 years agobackport: re PR c++/84222 ([[deprecated]] class complains about internal class usage)
Jakub Jelinek [Fri, 22 Jun 2018 20:43:09 +0000 (22:43 +0200)] 
backport: re PR c++/84222 ([[deprecated]] class complains about internal class usage)

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261924

7 years agobackport: re PR target/84860 (ICE in emit_move_insn, at expr.c:3717)
Jakub Jelinek [Fri, 22 Jun 2018 20:41:55 +0000 (22:41 +0200)] 
backport: re PR target/84860 (ICE in emit_move_insn, at expr.c:3717)

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261923

7 years agobackport: re PR c/84853 (ICE: verify_gimple failed (expand_shift_1))
Jakub Jelinek [Fri, 22 Jun 2018 20:40:45 +0000 (22:40 +0200)] 
backport: re PR c/84853 (ICE: verify_gimple failed (expand_shift_1))

Backported from mainline
2018-03-15  Jakub Jelinek  <jakub@redhat.com>

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

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

From-SVN: r261922

7 years agobackport: re PR middle-end/84834 (ICE: tree check: expected integer_cst, have complex...
Jakub Jelinek [Fri, 22 Jun 2018 20:38:25 +0000 (22:38 +0200)] 
backport: re PR middle-end/84834 (ICE: tree check: expected integer_cst, have complex_cst in to_wide, at tree.h:5527)

Backported from mainline
2018-03-13  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261921

7 years agobackport: re PR target/84827 (ICE in extract_insn, at recog.c:2311)
Jakub Jelinek [Fri, 22 Jun 2018 20:37:40 +0000 (22:37 +0200)] 
backport: re PR target/84827 (ICE in extract_insn, at recog.c:2311)

Backported from mainline
2018-03-13  Jakub Jelinek  <jakub@redhat.com>

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

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

From-SVN: r261920

7 years agobackport: re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting...
Jakub Jelinek [Fri, 22 Jun 2018 20:36:31 +0000 (22:36 +0200)] 
backport: re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)

Backported from mainline
2018-03-13  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261919

7 years agobackport: re PR target/84772 (powerpc-spe: Spurious "is used uninitialized" warning...
Jakub Jelinek [Fri, 22 Jun 2018 20:35:29 +0000 (22:35 +0200)] 
backport: re PR target/84772 (powerpc-spe: Spurious "is used uninitialized" warning, or possibly incorrect codegen for va_arg(long double))

Backported from mainline
2018-03-09  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261918

7 years agobackport: re PR c++/84076 (Warning about objects through POD mistakenly claims the...
Jakub Jelinek [Fri, 22 Jun 2018 20:34:33 +0000 (22:34 +0200)] 
backport: re PR c++/84076 (Warning about objects through POD mistakenly claims the object is a pointer)

Backported from mainline
2018-03-09  Jason Merrill  <jason@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261917

7 years agobackport: re PR c++/84767 (ICE with pointer to VLA)
Jakub Jelinek [Fri, 22 Jun 2018 20:33:38 +0000 (22:33 +0200)] 
backport: re PR c++/84767 (ICE with pointer to VLA)

Backported from mainline
2018-03-09  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261916

7 years agobackport: re PR c++/80598 (-Wunused triggers for functions used in uninstantiated...
Jakub Jelinek [Fri, 22 Jun 2018 20:32:15 +0000 (22:32 +0200)] 
backport: re PR c++/80598 (-Wunused triggers for functions used in uninstantiated templates)

Backported from mainline
2018-03-08  Jason Merrill  <jason@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261915

7 years agobackport: re PR tree-optimization/84739 (ICE in get_value_for_expr, at tree-ssa-ccp...
Jakub Jelinek [Fri, 22 Jun 2018 20:31:10 +0000 (22:31 +0200)] 
backport: re PR tree-optimization/84739 (ICE in get_value_for_expr, at tree-ssa-ccp.c:649)

Backported from mainline
2018-03-08  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261914

7 years agobackport: re PR target/84700 (ICE on 32-bit BE powerpc targets w/ -misel -O1)
Jakub Jelinek [Fri, 22 Jun 2018 20:29:34 +0000 (22:29 +0200)] 
backport: re PR target/84700 (ICE on 32-bit BE powerpc targets w/ -misel -O1)

Backported from mainline
2018-03-05  Jakub Jelinek  <jakub@redhat.com>

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.

From-SVN: r261913

7 years agobackport: re PR c++/84662 (internal compiler error: tree check: expected class 'type...
Jakub Jelinek [Fri, 22 Jun 2018 20:28:04 +0000 (22:28 +0200)] 
backport: re PR c++/84662 (internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in is_bitfield_expr_with_lowered_type, at cp/typeck.c:1944)

Backported from mainline
2018-03-02  Jakub Jelinek  <jakub@redhat.com>

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

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

From-SVN: r261912

7 years agoPR libstdc++/86138 prevent implicit instantiation of COW empty rep
Jonathan Wakely [Fri, 22 Jun 2018 15:58:38 +0000 (16:58 +0100)] 
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  <jwakely@redhat.com>

PR libstdc++/86138
* include/bits/basic_string.tcc:
[__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
(basic_string<char>::_Rep::_S_empty_rep_storage)
(basic_string<wchar_t>::_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.

From-SVN: r261907

7 years agobackport: arm_cmse.h (cmse_nsfptr_create): Change typeof to __typeof__.
Andre Vieira [Fri, 22 Jun 2018 14:38:34 +0000 (14:38 +0000)] 
backport: arm_cmse.h (cmse_nsfptr_create): Change typeof to __typeof__.

gcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* config/arm/arm_cmse.h (cmse_nsfptr_create): Change typeof to
__typeof__.
(cmse_check_pointed_object): Likewise.

gcc/testsuite/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-06-05  Andre Vieira  <andre.simoesdiasvieira@arm.com>

* gcc.target/arm/cmse/cmse-1c99.c: New test.

From-SVN: r261900

7 years agobackport: arm_cmse.h (cmse_nsfptr_create, [...]): Remove #include <stdint.h>.
Andre Vieira [Fri, 22 Jun 2018 14:35:24 +0000 (14:35 +0000)] 
backport: arm_cmse.h (cmse_nsfptr_create, [...]): Remove #include <stdint.h>.

gcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-05-17  Jerome Lambourg  <lambourg@adacore.com>

* config/arm/arm_cmse.h (cmse_nsfptr_create, cmse_is_nsfptr): Remove
#include <stdint.h>.  Replace intptr_t with __INTPTR_TYPE__.

libgcc/
2018-06-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

Backport from mainline
2018-05-17  Jerome Lambourg  <lambourg@adacore.com>

* config/arm/cmse.c (cmse_check_address_range): Replace
UINTPTR_MAX with __UINTPTR_MAX__ and uintptr_t with __UINTPTR_TYPE__.

From-SVN: r261898

7 years agosyscall: remove Ustat
Ian Lance Taylor [Fri, 22 Jun 2018 14:25:18 +0000 (14:25 +0000)] 
syscall: remove Ustat

    glibc 2.28 removes ustat.h and the ustat function entirely, which
    breaks syscall.Ustat.

    Updates golang/go#25990

    Reviewed-on: https://go-review.googlesource.com/120535

From-SVN: r261894

7 years agoDaily bump.
GCC Administrator [Fri, 22 Jun 2018 00:16:34 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261875

7 years ago* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.
Jonathan Wakely [Thu, 21 Jun 2018 20:51:51 +0000 (21:51 +0100)] 
* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r261864

7 years agoRISC-V: Add custom RTEMS multilibs
Sebastian Huber [Thu, 21 Jun 2018 09:36:40 +0000 (09:36 +0000)] 
RISC-V: Add custom RTEMS multilibs

Add multilib variants for -march=rv64imafd, e.g. to support the BOOMv2 core.

Add -mcmodel=medany as a variant of the 64-bit multilibs for RTEMS.  The
rationale for this change is that several existing RISC-V chips map the
RAM at 0x80000000.  In RTEMS, we do not use virtual memory, so
applications will run at this location which is outside the +-2GiB range
in a 64-bit configuration.

gcc/
* config.gcc (riscv*-*-elf* | riscv*-*-rtems*): Use custom
multilibs for *-*-rtems*.
* config/riscv/t-rtems: New file.

From-SVN: r261838

7 years agoDaily bump.
GCC Administrator [Thu, 21 Jun 2018 00:16:37 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261828

7 years agoDaily bump.
GCC Administrator [Wed, 20 Jun 2018 00:16:49 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261777

7 years agoxtensa: fix PR target/65416
Max Filippov [Tue, 19 Jun 2018 21:01:22 +0000 (21:01 +0000)] 
xtensa: fix PR target/65416

The issue is caused by reordering of stack pointer update after stack
space allocation with instructions that write to the allocated stack
space. In windowed ABI register spill area for the previous call frame
is located just below the stack pointer and may be reloaded back into
the register file on movsp.
Implement allocate_stack pattern for windowed ABI configuration and
insert an instruction that prevents reordering of frame memory access
and stack pointer update.

gcc/
2018-06-19  Max Filippov  <jcmvbkbc@gmail.com>

Backport from mainline
2018-06-19  Max Filippov  <jcmvbkbc@gmail.com>

* config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec
constant.
(allocate_stack, frame_blockage, *frame_blockage): New patterns.

From-SVN: r261764

7 years agoRemove unused <exception> header from <utility>
Jonathan Wakely [Tue, 19 Jun 2018 17:32:50 +0000 (18:32 +0100)] 
Remove unused <exception> header from <utility>

This header was needed for the declaration of std::terminate but the
calls to it were removed in r242401.

* include/std/utility: Remove unused <exception> header.

From-SVN: r261752

7 years agogimplify.c (gimplify_init_constructor): Really never clear for an incomplete construc...
Eric Botcazou [Tue, 19 Jun 2018 09:46:40 +0000 (09:46 +0000)] 
gimplify.c (gimplify_init_constructor): Really never clear for an incomplete constructor if CONSTRUCTOR_NO_CLEARING is set.

* gimplify.c (gimplify_init_constructor): Really never clear for an
incomplete constructor if CONSTRUCTOR_NO_CLEARING is set.

From-SVN: r261737

7 years agoDaily bump.
GCC Administrator [Tue, 19 Jun 2018 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261722

7 years agoPR middle-end/82063 - issues with arguments enabled by -Wall
Martin Sebor [Tue, 19 Jun 2018 00:02:30 +0000 (00:02 +0000)] 
PR middle-end/82063 - issues with arguments enabled by -Wall

gcc/ChangeLog:
        PR middle-end/82063
        * calls.c (alloc_max_size): Correct a logic error/typo.
        Treat excessive arguments as infinite.  Warn for invalid arguments.
        * doc/invoke.texi (-Walloc-size-larger-than): Update.

gcc/testsuite/ChangeLog:
        PR middle-end/82063
        * gcc.dg/Walloc-size-larger-than-1.c: New test.
        * gcc.dg/Walloc-size-larger-than-10.c: New test.
        * gcc.dg/Walloc-size-larger-than-11.c: New test.
        * gcc.dg/Walloc-size-larger-than-12.c: New test.
        * gcc.dg/Walloc-size-larger-than-13.c: New test.
        * gcc.dg/Walloc-size-larger-than-14.c: New test.
        * gcc.dg/Walloc-size-larger-than-15.c: New test.
        * gcc.dg/Walloc-size-larger-than-16.c: New test.
        * gcc.dg/Walloc-size-larger-than-2.c: New test.
        * gcc.dg/Walloc-size-larger-than-3.c: New test.
        * gcc.dg/Walloc-size-larger-than-4.c: New test.
        * gcc.dg/Walloc-size-larger-than-5.c: New test.
        * gcc.dg/Walloc-size-larger-than-6.c: New test.
        * gcc.dg/Walloc-size-larger-than-7.c: New test.
        * gcc.dg/Walloc-size-larger-than-8.c: New test.
        * gcc.dg/Walloc-size-larger-than-9.c: New test.
        * gcc.dg/Walloc-size-larger-than.c: New test.

From-SVN: r261720

7 years agoDaily bump.
GCC Administrator [Mon, 18 Jun 2018 00:16:21 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261693

7 years agoDaily bump.
GCC Administrator [Sun, 17 Jun 2018 00:16:15 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261684

7 years agoDaily bump.
GCC Administrator [Sat, 16 Jun 2018 00:16:29 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261672

7 years agoPR libstdc++/86169 unshare COW string when non-const data() called
Jonathan Wakely [Fri, 15 Jun 2018 19:19:04 +0000 (20:19 +0100)] 
PR libstdc++/86169 unshare COW string when non-const data() called

PR libstdc++/86169
* include/bits/basic_string.h [!_GLIBCXX_USE_CXX11_ABI]
(basic_string::data()): Unshare string.
* testsuite/21_strings/basic_string/operations/data/char/86169.cc:
New.

From-SVN: r261646

7 years agoOnly define __cpp_lib_constexpr_char_traits for C++17
Jonathan Wakely [Fri, 15 Jun 2018 16:42:57 +0000 (17:42 +0100)] 
Only define __cpp_lib_constexpr_char_traits for C++17

* include/bits/char_traits.h (__cpp_lib_constexpr_char_traits): Only
define for C++17 and above.

From-SVN: r261637

7 years agoDaily bump.
GCC Administrator [Fri, 15 Jun 2018 00:16:31 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261615

7 years agoRTEMS: Prefer int for int32_t
Sebastian Huber [Thu, 14 Jun 2018 05:19:35 +0000 (05:19 +0000)] 
RTEMS: Prefer int for int32_t

Common systems like glibc and FreeBSD define int32_t to int.  This means
a lot of third party code works well in these cases:

  #include <stdint.h>

  void f(int32_t);

  void f(int);

  void g(int32_t *);

  void h(void)
  {
    int i;
    g(&i);
  }

On RTEMS you got however in C

  test.c:5:6: error: conflicting types for 'f'
    void f(int);
        ^
  test.c:3:6: note: previous declaration of 'f' was here
    void f(int32_t);
        ^
  test.c: In function 'h':
  test.c:12:4: warning: passing argument 1 of 'g' from incompatible
  pointer type [-Wincompatible-pointer-types]
    g(&i);
      ^
  test.c:7:6: note: expected 'int32_t * {aka long int *}' but argument
  is of type 'int *' void g(int32_t *);

and C++

  test.c: In function 'void h()':
  test.c:12:4: error: invalid conversion from 'int*' to 'int32_t* {aka
  long int*}' [-fpermissive]
    g(&i);
      ^~
  test.c:7:6: note:   initializing argument 1 of 'void g(int32_t*)'
    void g(int32_t *);
      ^

This was due to a Newlib speciality which uses long for int32_t if long
is a 32-bit type.  To ease the use of third party software in RTEMS we
override this Newlib option now and use int for int32_t if int is a
32-bit type.

gcc/
* config/rtems.h (STDINT_LONG32): Define.

From-SVN: r261584

7 years agoDaily bump.
GCC Administrator [Thu, 14 Jun 2018 00:16:10 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261578

7 years agore PR fortran/86110 (ICE in gfc_resolve_character_array_constructor, at fortran/array...
Steven G. Kargl [Wed, 13 Jun 2018 22:40:46 +0000 (22:40 +0000)] 
re PR fortran/86110 (ICE in gfc_resolve_character_array_constructor, at fortran/array.c:2044)

2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86110
* array.c (gfc_resolve_character_array_constructor): Avoid NULL
pointer dereference.

2018-06-13  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/86110
* gfortran.dg/pr86110.f90: New test.

From-SVN: r261575

7 years agoDaily bump.
GCC Administrator [Wed, 13 Jun 2018 00:16:38 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r261533

7 years agoPR c++/85815 - reference to member of enclosing template.
Jason Merrill [Tue, 12 Jun 2018 19:53:10 +0000 (15:53 -0400)] 
PR c++/85815 - reference to member of enclosing template.

* parser.c (cp_parser_postfix_dot_deref_expression): Check
currently_open_class.

From-SVN: r261524