]> git.ipfire.org Git - thirdparty/gcc.git/log
thirdparty/gcc.git
5 years agoDaily bump.
GCC Administrator [Sun, 1 Sep 2019 00:16:28 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275261

5 years agors6000: Fix darn-3.c for GCC 8 and GCC 7
Segher Boessenkool [Sat, 31 Aug 2019 19:01:52 +0000 (21:01 +0200)] 
rs6000: Fix darn-3.c for GCC 8 and GCC 7

Apparently I didn't properly test the testcase backport to GCC 8 and
GCC 7.  This makes it not fail there.

PR target/91481
* gcc.target/powerpc/darn-3.c: Fix testcase.

From-SVN: r275245

5 years agoDaily bump.
GCC Administrator [Sat, 31 Aug 2019 00:16:32 +0000 (00:16 +0000)] 
Daily bump.

From-SVN: r275232

5 years agoBackport PRs 89677, 90071, 90194, 90213, 90474, 90637, 90930
Richard Biener [Fri, 30 Aug 2019 16:44:17 +0000 (16:44 +0000)] 
Backport PRs 89677, 90071, 90194, 90213, 90474, 90637, 90930

2019-08-30  Richard Biener  <rguenther@suse.de>

Backport from mainline
2019-05-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/90637
* tree-ssa-sink.c (statement_sink_location): Honor the
computed sink location for single-uses.

* gcc.dg/gomp/pr90637.c: New testcase.

2019-06-21  Richard Biener  <rguenther@suse.de>

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

2019-05-15  Richard Biener  <rguenther@suse.de>

PR c/90474
* c-common.c (c_common_mark_addressable_vec): Also mark
a COMPOUND_LITERAL_EXPR_DECL addressable similar to
c_mark_addressable.

2019-04-25  Richard Biener  <rguenther@suse.de>

PR middle-end/90194
* match.pd: Add pattern to simplify view-conversion of an
empty constructor.

* g++.dg/torture/pr90194.C: New testcase.

2019-04-24  Richard Biener  <rguenther@suse.de>

PR middle-end/90213
* gimple-fold.c (fold_const_aggregate_ref_1): Do multiplication
by size and BITS_PER_UNIT on poly-wide-ints.

2019-04-15  Richard Biener  <rguenther@suse.de>

PR tree-optimization/90071
* tree-ssa-reassoc.c (init_range_entry): Do not pick up
abnormal operands from def stmts.

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

2019-03-13  Richard Biener  <rguenther@suse.de>

PR middle-end/89677
* tree-scalar-evolution.c (simplify_peeled_chrec): Do not
throw FP expressions at tree-affine.

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

From-SVN: r275208

5 years agobackport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output...
Segher Boessenkool [Fri, 30 Aug 2019 14:25:36 +0000 (16:25 +0200)] 
backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output (CVE-2019-15847))

Backport from trunk
2019-08-23  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
PR target/91481
* gcc.target/powerpc/darn-3.c: New testcase.

From-SVN: r275186

5 years agobackport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output...
Segher Boessenkool [Fri, 30 Aug 2019 14:23:55 +0000 (16:23 +0200)] 
backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated output (CVE-2019-15847))

Backport from trunk
2019-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/91481
* config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
and UNSPEC_DARN_RAW.
(unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and
UNSPECV_DARN_RAW.
(darn_32): Use an unspec_volatile, and UNSPECV_DARN_32.
(darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW.
(darn): Use an unspec_volatile, and UNSPECV_DARN.

From-SVN: r275185

5 years agobackport: altivec.md (unspec): Delete UNSPEC_DARN...
Segher Boessenkool [Fri, 30 Aug 2019 14:22:48 +0000 (16:22 +0200)] 
backport: altivec.md (unspec): Delete UNSPEC_DARN...

Backport from trunk
2019-08-22  Segher Boessenkool  <segher@kernel.crashing.org>

* config/rs6000/altivec.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
UNSPEC_DARN_RAW, UNSPEC_CMPRB, UNSPEC_CMPRB2, UNSPEC_CMPEQB; move to...
* config/rs6000/rs6000.md (unspec): ... here.
* config/rs6000/altivec.md (darn_32, darn_raw, darn, cmprb,
*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
cmpeqb, *cmpeqb_internal): Delete, move to...
* config/rs6000/rs6000.md (darn_32, darn_raw, darn, cmprb,
*cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
cmpeqb, *cmpeqb_internal): ... here.

From-SVN: r275184

5 years agobackport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong writemask)
Jakub Jelinek [Fri, 30 Aug 2019 12:49:27 +0000 (14:49 +0200)] 
backport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong writemask)

Backported from mainline
2019-07-30  Jakub Jelinek  <jakub@redhat.com>

PR target/91150
* config/i386/i386.c (expand_vec_perm_blend): Change mask type
from unsigned to unsigned HOST_WIDE_INT.  For E_V64QImode cast
comparison to unsigned HOST_WIDE_INT before shifting it left.

* gcc.target/i386/avx512bw-pr91150.c: New test.

From-SVN: r275164

5 years agobackport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)
Jakub Jelinek [Fri, 30 Aug 2019 12:48:57 +0000 (14:48 +0200)] 
backport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP SIMD region)

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

PR middle-end/78884
* gimplify.c (struct gimplify_omp_ctx): Add add_safelen1 member.
(gimplify_bind_expr): If seeing TREE_ADDRESSABLE VLA inside of simd
loop body, set ctx->add_safelen1 instead of making it GOVD_PRIVATE.
(gimplify_adjust_omp_clauses): Add safelen (1) clause if
ctx->add_safelen1 is set.

* gcc.dg/gomp/pr78884.c: New test.

From-SVN: r275163

5 years agobackport: re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on...
Jakub Jelinek [Fri, 30 Aug 2019 12:48:18 +0000 (14:48 +0200)] 
backport: re PR rtl-optimization/90756 (g++ ICE in convert_move, at expr.c:218 on i686 and s390x)

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

PR rtl-optimization/90756
* explow.c (promote_ssa_mode): Always use TYPE_MODE, don't bypass it
for VECTOR_TYPE_P.

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

From-SVN: r275162

5 years agobackport: re PR sanitizer/90954 (ICE: combining undefined behavior sanitizer with...
Jakub Jelinek [Fri, 30 Aug 2019 12:47:28 +0000 (14:47 +0200)] 
backport: re PR sanitizer/90954 (ICE: combining undefined behavior sanitizer with openmp)

Backported from mainline
2019-06-25  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/90954
* c-omp.c (c_finish_omp_atomic): Allow tree_invariant_p in addition
to SAVE_EXPR in first operand of a COMPOUND_EXPR.

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

From-SVN: r275161

5 years agobackport: re PR c++/90950 (OpenMP clause handling rejecting references to incomplete...
Jakub Jelinek [Fri, 30 Aug 2019 12:46:52 +0000 (14:46 +0200)] 
backport: re PR c++/90950 (OpenMP clause handling rejecting references to incomplete types in templates)

Backported from mainline
2019-06-21  Jakub Jelinek  <jakub@redhat.com>

PR c++/90950
* semantics.c (finish_omp_clauses): Don't reject references to
incomplete types if processing_template_decl.

* g++.dg/gomp/lastprivate-1.C: New test.

From-SVN: r275160

5 years agobackport: re PR c/90760 (ICE on attributes section and alias in set_section, at symta...
Jakub Jelinek [Fri, 30 Aug 2019 12:46:13 +0000 (14:46 +0200)] 
backport: re PR c/90760 (ICE on attributes section and alias in set_section, at symtab.c:1573)

Backported from mainline
2019-06-12  Jakub Jelinek  <jakub@redhat.com>

PR c/90760
* symtab.c (symtab_node::set_section): Allow being called on aliases
as long as they aren't analyzed yet.

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

From-SVN: r275159

5 years agobackport: re PR libgomp/90585 (libgomp hsa plugin ftbfs in the x32 multilib variant)
Jakub Jelinek [Fri, 30 Aug 2019 12:45:31 +0000 (14:45 +0200)] 
backport: re PR libgomp/90585 (libgomp hsa plugin ftbfs in the x32 multilib variant)

Backported from mainline
2019-05-24  Jakub Jelinek  <jakub@redhat.com>

PR libgomp/90585
* plugin/plugin-hsa.c (print_kernel_dispatch, run_kernel): Use PRIu64
macro instead of "lu".
(release_kernel_dispatch): Likewise.  Cast shadow->debug to uintptr_t
before casting to void *.

From-SVN: r275158

5 years agobackport: re PR pch/90326 (Using any precompiled header breaks definition of FLT_MAX)
Jakub Jelinek [Fri, 30 Aug 2019 12:45:01 +0000 (14:45 +0200)] 
backport: re PR pch/90326 (Using any precompiled header breaks definition of FLT_MAX)

Backported from mainline
2019-05-10  Jakub Jelinek  <jakub@redhat.com>

PR pch/90326
cp/
* config-lang.in (gtfiles): Remove c-family/c-lex.c, add
c-family/c-cppbuiltin.c.
objcp/
* config-lang.in (gtfiles): Remove c-family/c-lex.c, add
c-family/c-cppbuiltin.c.
testsuite/
* g++.dg/pch/pr90326.C: New test.
* g++.dg/pch/pr90326.Hs: New file.

From-SVN: r275157

5 years agobackport: re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601)
Jakub Jelinek [Fri, 30 Aug 2019 12:44:03 +0000 (14:44 +0200)] 
backport: re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601)

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

PR middle-end/90139
* tree-outof-ssa.c (get_temp_reg): If reg_mode is BLKmode, return
assign_temp instead of gen_reg_rtx.

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

From-SVN: r275156

5 years agobackport: re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)
Jakub Jelinek [Fri, 30 Aug 2019 12:43:04 +0000 (14:43 +0200)] 
backport: re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)

Backported from mainline
2019-06-11  Jakub Jelinek  <jakub@redhat.com>

PR target/90811
* config/nvptx/nvptx.c (nvptx_output_softstack_switch): Use and.b%d
instead of and.u%d.

* testsuite/libgomp.c/pr90811.c: New test.

From-SVN: r275155

5 years agobackport: lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.
Jakub Jelinek [Fri, 30 Aug 2019 12:42:14 +0000 (14:42 +0200)] 
backport: lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.

Backported from mainline
2019-05-30  Jakub Jelinek  <jakub@redhat.com>

* lang.opt (ftail-call-workaround=): Fix a typo - lenghts to lengths.

From-SVN: r275154

5 years agobackport: re PR fortran/90329 (Incompatibility between gfortran and C lapack calls)
Jakub Jelinek [Fri, 30 Aug 2019 12:41:43 +0000 (14:41 +0200)] 
backport: re PR fortran/90329 (Incompatibility between gfortran and C lapack calls)

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

PR fortran/90329
* lto-streamer.h (LTO_minor_version): Bump to 1.

Backported from mainline
2019-05-16  Jakub Jelinek  <jakub@redhat.com>

PR fortran/90329
* tree-core.h (struct tree_decl_common): Document
decl_nonshareable_flag for PARM_DECLs.
* tree.h (DECL_HIDDEN_STRING_LENGTH): Define.
* calls.c (expand_call): Don't try tail call if caller
has any DECL_HIDDEN_STRING_LENGTH PARM_DECLs that are or might be
passed on the stack and callee needs to pass any arguments on the
stack.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
else if instead of series of mutually exclusive ifs.  Handle
DECL_HIDDEN_STRING_LENGTH for PARM_DECLs.
* tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.

* lang.opt (fbroken-callers): Remove.
(ftail-call-workaround, ftail-call-workaround=): New options.
* gfortran.h (struct gfc_namespace): Add implicit_interface_calls.
* interface.c (gfc_procedure_use): Set implicit_interface_calls
for calls to implicit interface procedures.
* trans-decl.c (create_function_arglist): Use flag_tail_call_workaround
instead of flag_broken_callers.  If it is not 2, also require
sym->ns->implicit_interface_calls.
* invoke.texi (fbroken-callers): Remove documentation.
(ftail-call-workaround, ftail-call-workaround=): Document.

2019-05-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/90329
* invoke.texi: Document -fbroken-callers.
* lang.opt: Add -fbroken-callers.
* trans-decl.c (create_function_arglist): Only set
DECL_HIDDEN_STRING_LENGTH if flag_broken_callers is set.

2019-05-16  Jakub Jelinek  <jakub@redhat.com>

PR fortran/90329
* trans-decl.c (create_function_arglist): Set
DECL_HIDDEN_STRING_LENGTH on hidden string length PARM_DECLs if
len is constant.

From-SVN: r275153

5 years agobackport: re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)
Jakub Jelinek [Fri, 30 Aug 2019 12:39:50 +0000 (14:39 +0200)] 
backport: re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)

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

PR target/90187
* config/i386/i386.c (ix86_expand_sse_fp_minmax): Force if_true into
a register if both if_true and if_false are MEMs.

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

From-SVN: r275152

5 years agobackport: re PR tree-optimization/90208 (error: EH landing pad label)
Jakub Jelinek [Fri, 30 Aug 2019 12:39:09 +0000 (14:39 +0200)] 
backport: re PR tree-optimization/90208 (error: EH landing pad label)

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

PR tree-optimization/90208
* tree-cfg.c (remove_bb): Move forced labels from removed bbs
after labels of new_bb, not before them.

* gcc.dg/tsan/pr90208-2.c: New test.

From-SVN: r275151

5 years agobackport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))
Jakub Jelinek [Fri, 30 Aug 2019 12:38:31 +0000 (14:38 +0200)] 
backport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))

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

PR c++/90108
* c-decl.c (merge_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.

* decl.c (duplicate_decls): If remove is main variant and
DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE
variant that has newdecl as TYPE_NAME if any.

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

From-SVN: r275150

5 years agobackport: re PR rtl-optimization/90082 (ICE in delete_unmarked_insns, at dce.c:653)
Jakub Jelinek [Fri, 30 Aug 2019 12:37:28 +0000 (14:37 +0200)] 
backport: re PR rtl-optimization/90082 (ICE in delete_unmarked_insns, at dce.c:653)

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

PR rtl-optimization/90082
* dce.c (can_delete_call): New function.
(deletable_insn_p, mark_insn): Use it.

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

From-SVN: r275149

5 years agobackport: re PR tree-optimization/90090 (ICE in mark_reachable_handlers, at tree...
Jakub Jelinek [Fri, 30 Aug 2019 12:36:49 +0000 (14:36 +0200)] 
backport: re PR tree-optimization/90090 (ICE in mark_reachable_handlers, at tree-eh.c:3938 since r219202)

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

PR tree-optimization/90090
* tree-ssa-math-opts.c (is_division_by): Ignore divisions that can
throw internally.

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

From-SVN: r275148

5 years agobackport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)
Jakub Jelinek [Fri, 30 Aug 2019 12:36:05 +0000 (14:36 +0200)] 
backport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)

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

PR c/89933
* c-decl.c (merge_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.

* decl.c (duplicate_decls): When newdecl's type is its main variant,
don't try to remove it from the variant list, but instead assert
it has no variants.

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

From-SVN: r275147

5 years agobackport: re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)
Jakub Jelinek [Fri, 30 Aug 2019 12:35:05 +0000 (14:35 +0200)] 
backport: re PR middle-end/89998 (ICE: verify_gimple failed in printf-return-value)

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

PR tree-optimization/89998
* gimple-ssa-sprintf.c (try_substitute_return_value): Use lhs type
instead of integer_type_node if possible, don't add ranges if return
type is not compatible with int.
* gimple-fold.c (gimple_fold_builtin_sprintf,
gimple_fold_builtin_snprintf): Use lhs type instead of hardcoded
integer_type_node.

* gcc.c-torture/compile/pr89998-1.c: New test.
* gcc.c-torture/compile/pr89998-2.c: New test.

From-SVN: r275146

5 years agobackport: re PR sanitizer/89869 (-fsanitize=undefined miscompilation)
Jakub Jelinek [Fri, 30 Aug 2019 12:34:19 +0000 (14:34 +0200)] 
backport: re PR sanitizer/89869 (-fsanitize=undefined miscompilation)

Backported from mainline
2019-03-29  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/89869
* typeck.c: Include gimplify.h.
(cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
for second time.  Formatting fixes.

* g++.dg/ubsan/vptr-14.C: New test.

From-SVN: r275145

5 years agobackport: re PR c/89872 (GCC does not generate read access to volatile compound literal)
Jakub Jelinek [Fri, 30 Aug 2019 12:33:40 +0000 (14:33 +0200)] 
backport: re PR c/89872 (GCC does not generate read access to volatile compound literal)

Backported from mainline
2019-03-29  Jakub Jelinek  <jakub@redhat.com>

PR c/89872
* gimplify.c (gimplify_compound_literal_expr): Don't optimize a
non-addressable complit into its initializer if it is volatile.

* gcc.dg/tree-ssa/pr89872.c: New test.

From-SVN: r275144

5 years agobackport: re PR middle-end/89621 (ICE with allocatable character and openmp)
Jakub Jelinek [Fri, 30 Aug 2019 12:33:00 +0000 (14:33 +0200)] 
backport: re PR middle-end/89621 (ICE with allocatable character and openmp)

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

PR middle-end/89621
* tree-inline.h (struct copy_body_data): Add
dont_remap_vla_if_no_change flag.
* tree-inline.c (remap_type_3, remap_type_2): New functions.
(remap_type): Don't remap vla types if id->dont_remap_vla_if_no_change
and remap_type_2 returns false.
* omp-low.c (new_omp_context): Set ctx->cb.dont_remap_vla_if_no_change.

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

From-SVN: r275143

5 years agobackport: re PR c++/89796 (Incorrect warning generated with OpenMP atomic capture)
Jakub Jelinek [Fri, 30 Aug 2019 12:32:15 +0000 (14:32 +0200)] 
backport: re PR c++/89796 (Incorrect warning generated with OpenMP atomic capture)

Backported from mainline
2019-03-26  Jakub Jelinek  <jakub@redhat.com>

PR c++/89796
* semantics.c (finish_omp_atomic): Add warning_sentinel for
-Wunused-value around finish_expr_stmt call.

* g++.dg/gomp/pr89796.C: New test.
* gcc.dg/gomp/pr89796.c: New test.

From-SVN: r275142

5 years agobackport: re PR c++/60702 (thread_local initialization)
Jakub Jelinek [Fri, 30 Aug 2019 12:31:21 +0000 (14:31 +0200)] 
backport: re PR c++/60702 (thread_local initialization)

Backported from mainline
2019-03-25  Jakub Jelinek  <jakub@redhat.com>

PR c++/60702
* g++.dg/tls/thread_local11.C: Remove scan-tree-dump-times directives
for _ZTH* calls.
* g++.dg/tls/thread_local11a.C: New test.

From-SVN: r275141

5 years agobackport: re PR c++/60702 (thread_local initialization)
Jakub Jelinek [Fri, 30 Aug 2019 12:30:48 +0000 (14:30 +0200)] 
backport: re PR c++/60702 (thread_local initialization)

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

PR c++/60702
* cp-tree.h (get_tls_wrapper_fn): Remove declaration.
(maybe_get_tls_wrapper_call): Declare.
* decl2.c (get_tls_wrapper_fn): Make static.
(maybe_get_tls_wrapper_call): New function.
* typeck.c (build_class_member_access_expr): Handle accesses to TLS
variables.
* semantics.c (finish_qualified_id_expr): Likewise.
(finish_id_expression_1): Use maybe_get_tls_wrapper_call.
* pt.c (tsubst_copy_and_build): Likewise.

* g++.dg/tls/thread_local11.C: New test.
* g++.dg/tls/thread_local11.h: New test.
* g++.dg/tls/thread_local12a.C: New test.
* g++.dg/tls/thread_local12b.C: New test.
* g++.dg/tls/thread_local12c.C: New test.
* g++.dg/tls/thread_local12d.C: New test.
* g++.dg/tls/thread_local12e.C: New test.
* g++.dg/tls/thread_local12f.C: New test.
* g++.dg/tls/thread_local12g.C: New test.
* g++.dg/tls/thread_local12h.C: New test.
* g++.dg/tls/thread_local12i.C: New test.
* g++.dg/tls/thread_local12j.C: New test.
* g++.dg/tls/thread_local12k.C: New test.
* g++.dg/tls/thread_local12l.C: New test.

From-SVN: r275140

5 years agobackport: re PR c++/89767 (ICE with tuple and optimization)
Jakub Jelinek [Fri, 30 Aug 2019 12:29:13 +0000 (14:29 +0200)] 
backport: re PR c++/89767 (ICE with tuple and optimization)

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

PR c++/89767
* parser.c (cp_parser_lambda_introducer): Add ids and first_capture_id
variables, check for duplicates in this function.
* lambda.c (add_capture): Don't check for duplicates nor use
IDENTIFIER_MARKED.
(register_capture_members): Don't clear IDENTIFIER_MARKED here.

* g++.dg/cpp1y/lambda-init18.C: New test.
* g++.dg/cpp1y/lambda-init19.C: New test.
* g++.dg/cpp1y/pr89767.C: New test.

From-SVN: r275139

5 years agobackport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Jakub Jelinek [Fri, 30 Aug 2019 12:28:22 +0000 (14:28 +0200)] 
backport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)

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

PR target/89752
* lra-constraints.c (process_alt_operands) <reg>: For BLKmode, don't
update this_alternative nor this_alternative_set.

From-SVN: r275138

5 years agobackport: re PR rtl-optimization/89768 (ICE in compare_and_jump_seq at loop-unroll...
Jakub Jelinek [Fri, 30 Aug 2019 12:27:50 +0000 (14:27 +0200)] 
backport: re PR rtl-optimization/89768 (ICE in compare_and_jump_seq at loop-unroll.c:838)

Backported from mainline
2019-03-19  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/89768
* loop-unroll.c (unroll_loop_constant_iterations): Use gen_int_mode
instead of GEN_INT.
(unroll_loop_runtime_iterations): Likewise.

From-SVN: r275137

5 years agobackport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)
Jakub Jelinek [Fri, 30 Aug 2019 12:27:21 +0000 (14:27 +0200)] 
backport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)

Backported from mainline
2019-03-19  Jakub Jelinek  <jakub@redhat.com>

PR target/89752
* gimplify.c (gimplify_asm_expr): For output argument with
TREE_ADDRESSABLE type, clear allows_reg if it allows memory, otherwise
diagnose error.

* g++.dg/ext/asm15.C: Check for particular diagnostic wording.
* g++.dg/ext/asm16.C: Likewise.
* g++.dg/ext/asm17.C: New test.

From-SVN: r275136

5 years agobackport: re PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)
Jakub Jelinek [Fri, 30 Aug 2019 12:26:30 +0000 (14:26 +0200)] 
backport: re PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)

Backported from mainline
2019-03-19  Jakub Jelinek  <jakub@redhat.com>

PR target/89726
* config/i386/i386.c (ix86_expand_floorceildf_32): In ceil
compensation use x2 += 1 instead of x2 -= -1 and when honoring
signed zeros, do another copysign after the compensation.

* gcc.target/i386/fpprec-1.c (x): Add 6 new constants.
(expect_round, expect_rint, expect_floor, expect_ceil, expect_trunc):
Add expected results for them.

From-SVN: r275135

5 years agobackport: re PR c/89734 (const qualifier on return type not erased inside __typeof__)
Jakub Jelinek [Fri, 30 Aug 2019 12:25:43 +0000 (14:25 +0200)] 
backport: re PR c/89734 (const qualifier on return type not erased inside __typeof__)

Backported from mainline
2019-03-19  Jakub Jelinek  <jakub@redhat.com>

PR c/89734
* c-decl.c (grokdeclarator): Call c_build_qualified_type on function
return type even if quals_used is 0.  Formatting fixes.

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

From-SVN: r275134

5 years agobackport: re PR debug/89704 (ICE in add_const_value_attribute, at dwarf2out.c:19685)
Jakub Jelinek [Fri, 30 Aug 2019 12:20:12 +0000 (14:20 +0200)] 
backport: re PR debug/89704 (ICE in add_const_value_attribute, at dwarf2out.c:19685)

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

PR debug/89704
* dwarf2out.c (add_const_value_attribute): Return false for MINUS,
SIGN_EXTEND and ZERO_EXTEND.

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

From-SVN: r275133

5 years agobackport: re PR rtl-optimization/89679 (wrong code with -Og -frerun-cse-after-loop...
Jakub Jelinek [Fri, 30 Aug 2019 12:19:33 +0000 (14:19 +0200)] 
backport: re PR rtl-optimization/89679 (wrong code with -Og -frerun-cse-after-loop -fno-tree-fre)

Backported from mainline
2019-03-14  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/89679
* expmed.c (expand_mult_const): Don't add a REG_EQUAL note if it
would contain a paradoxical SUBREG.

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

From-SVN: r275132

5 years agobackport: re PR tree-optimization/89703 (ICE in compare_values_warnv, at tree-vrp...
Jakub Jelinek [Fri, 30 Aug 2019 12:18:54 +0000 (14:18 +0200)] 
backport: re PR tree-optimization/89703 (ICE in compare_values_warnv, at tree-vrp.c:997)

Backported from mainline
2019-03-14  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/89703
* tree-ssa-strlen.c (valid_builtin_call): Punt if stmt call types
aren't compatible also with builtin_decl_explicit.  Check pure
or non-pure status of BUILT_IN_STR{{,N}CMP,N{LEN,{CAT,CPY}{,_CHK}}}
and BUILT_IN_STPNCPY{,_CHK}.

* gcc.c-torture/compile/pr89703-1.c: New test.
* gcc.c-torture/compile/pr89703-2.c: New test.

From-SVN: r275131

5 years agobackport: re PR c++/89512 (ICE in get_expr_operands, at tree-ssa-operands.c:882)
Jakub Jelinek [Fri, 30 Aug 2019 12:18:01 +0000 (14:18 +0200)] 
backport: re PR c++/89512 (ICE in get_expr_operands, at tree-ssa-operands.c:882)

Backported from mainline
2019-03-14  Jakub Jelinek  <jakub@redhat.com>

PR c++/89512
* semantics.c (finish_qualified_id_expr): Reject variable templates.

* g++.dg/cpp1y/var-templ61.C: New test.

From-SVN: r275130

5 years agobackport: re PR middle-end/88588 (ICE in make_decl_rtl, at varasm.c:1329)
Jakub Jelinek [Fri, 30 Aug 2019 12:17:22 +0000 (14:17 +0200)] 
backport: re PR middle-end/88588 (ICE in make_decl_rtl, at varasm.c:1329)

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

PR middle-end/88588
* omp-simd-clone.c (ipa_simd_modify_stmt_ops): Handle PHI args.
(ipa_simd_modify_function_body): Handle PHIs.

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

From-SVN: r275129

5 years agobackport: re PR middle-end/89663 (ICE in expand_builtin_int_roundingfn_2, at builtins...
Jakub Jelinek [Fri, 30 Aug 2019 12:16:43 +0000 (14:16 +0200)] 
backport: re PR middle-end/89663 (ICE in expand_builtin_int_roundingfn_2, at builtins.c:2831)

Backported from mainline
2019-03-12  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89663
* builtins.c (expand_builtin_int_roundingfn,
expand_builtin_int_roundingfn_2): Return NULL_RTX instead of
gcc_unreachable if validate_arglist fails.

* gcc.c-torture/compile/pr89663-1.c: New test.
* gcc.c-torture/compile/pr89663-2.c: New test.

From-SVN: r275128

5 years agobackport: re PR fortran/89651 (OpenMP private array uninitialized warning with -O...
Jakub Jelinek [Fri, 30 Aug 2019 12:15:50 +0000 (14:15 +0200)] 
backport: re PR fortran/89651 (OpenMP private array uninitialized warning with -O flag)

Backported from mainline
2019-03-11  Jakub Jelinek  <jakub@redhat.com>

PR fortran/89651
* trans-openmp.c (gfc_omp_clause_default_ctor): Set TREE_NO_WARNING
on decl if adding COND_EXPR for allocatable.
(gfc_omp_clause_copy_ctor): Set TREE_NO_WARNING on dest.

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

From-SVN: r275127

5 years agobackport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)
Jakub Jelinek [Fri, 30 Aug 2019 12:14:46 +0000 (14:14 +0200)] 
backport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)

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

PR c/88568
* tree.c (handle_dll_attribute): Don't clear TREE_STATIC for
dllimport on VAR_DECLs with RECORD_TYPE or UNION_TYPE DECL_CONTEXT.

* g++.dg/other/pr88568.C: New test.

From-SVN: r275126

5 years agobackport: re PR c++/82075 (structured binding fails with empty base class)
Jakub Jelinek [Fri, 30 Aug 2019 12:14:10 +0000 (14:14 +0200)] 
backport: re PR c++/82075 (structured binding fails with empty base class)

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

PR c++/82075
* g++.dg/cpp1z/decomp49.C: New test.

From-SVN: r275125

5 years agobackport: re PR c++/87148 (backward compatibility issue to take char [] as incomplet...
Jakub Jelinek [Fri, 30 Aug 2019 12:13:40 +0000 (14:13 +0200)] 
backport: re PR c++/87148 (backward compatibility issue  to take char [] as incomplete type)

Backported from mainline
2019-03-06  Jakub Jelinek  <jakub@redhat.com>

PR c++/87148
* init.c (build_value_init_noctor): Ignore flexible array members.

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

From-SVN: r275124

5 years agobackport: re PR target/89587 (gcc's rs6000 configuration unconditionally sets MULTIAR...
Jakub Jelinek [Fri, 30 Aug 2019 12:12:56 +0000 (14:12 +0200)] 
backport: re PR target/89587 (gcc's rs6000 configuration unconditionally sets MULTIARCH_DIRNAME, even when multiarch is disabled)

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

PR target/89587
* config/rs6000/t-linux (MULTIARCH_DIRNAME): Set to non-empty only
if_multiarch.

From-SVN: r275123

5 years agobackport: re PR middle-end/89590 (ICE in maybe_emit_free_warning)
Jakub Jelinek [Fri, 30 Aug 2019 12:12:24 +0000 (14:12 +0200)] 
backport: re PR middle-end/89590 (ICE in maybe_emit_free_warning)

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

PR middle-end/89590
* builtins.c (maybe_emit_free_warning): Punt if free doesn't have
exactly one argument.

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

From-SVN: r275122

5 years agobackport: re PR c/89521 (ICE in expand_builtin_int_roundingfn, at builtins.c:2697)
Jakub Jelinek [Fri, 30 Aug 2019 12:11:38 +0000 (14:11 +0200)] 
backport: re PR c/89521 (ICE in expand_builtin_int_roundingfn, at builtins.c:2697)

Backported from mainline
2019-02-28  Jakub Jelinek  <jakub@redhat.com>

PR c/89521
* gcc.dg/pr89521-1.c: New test.
* gcc.dg/pr89521-2.c: New test.

From-SVN: r275121

5 years agobackport: re PR c/89520 (ICE tree check: accessed operand 4 of call_expr with 3 opera...
Jakub Jelinek [Fri, 30 Aug 2019 12:11:06 +0000 (14:11 +0200)] 
backport: re PR c/89520 (ICE tree check: accessed operand 4 of call_expr with 3 operands in convert_to_integer_1, at convert.c:668)

Backported from mainline
2019-02-28  Jakub Jelinek  <jakub@redhat.com>

PR c/89520
* convert.c (convert_to_real_1, convert_to_integer_1): Punt for
builtins if they don't have a single scalar floating point argument.
Formatting fixes.

* gcc.dg/pr89520-1.c: New test.
* gcc.dg/pr89520-2.c: New test.

From-SVN: r275120

5 years agobackport: re PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)
Jakub Jelinek [Fri, 30 Aug 2019 12:10:10 +0000 (14:10 +0200)] 
backport: re PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)

Backported from mainline
2019-02-20  Jakub Jelinek  <jakub@redhat.com>

PR c++/89403
* decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
for flag_syntax_only from here...
* semantics.c (expand_or_defer_fn_1): ... here.

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

From-SVN: r275119

5 years agobackport: re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273...
Jakub Jelinek [Fri, 30 Aug 2019 12:08:46 +0000 (14:08 +0200)] 
backport: re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686-linux-gnu)

Backported from mainline
2019-02-20  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89412
* expr.c (expand_assignment): If result is a MEM, use change_address
instead of simplify_gen_subreg.

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

From-SVN: r275118

5 years agobackport: re PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))
Jakub Jelinek [Fri, 30 Aug 2019 12:08:04 +0000 (14:08 +0200)] 
backport: re PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))

Backported from mainline
2019-02-20  Jakub Jelinek  <jakub@redhat.com>
    David Malcolm  <dmalcolm@redhat.com>

PR middle-end/89091
* fold-const.c (decode_field_reference): Return NULL_TREE if
lang_hooks.types.type_for_size returns NULL.  Check it before
overwriting *exp_.  Use return NULL_TREE instead of return 0.

* gcc.dg/torture/pr89091.c: New test.

From-SVN: r275117

5 years agobackport: re PR tree-optimization/88074 (g++ hangs on math expression)
Jakub Jelinek [Fri, 30 Aug 2019 12:07:12 +0000 (14:07 +0200)] 
backport: re PR tree-optimization/88074 (g++ hangs on math expression)

Backported from mainline
2019-02-20  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/88074
PR middle-end/89415
* toplev.c (do_compile): Double the emin/emax exponents to workaround
buggy mpc_norm.

2019-02-19  Richard Biener  <rguenther@suse.de>

        PR middle-end/88074
* toplev.c (do_compile): Initialize mpfr's exponent range
based on available float modes.

2019-02-20  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/88074
PR middle-end/89415
* gcc.dg/pr88074-2.c: New test.

2019-02-19  Richard Biener  <rguenther@suse.de>

        PR middle-end/88074
* gcc.dg/pr88074.c: New testcase.

From-SVN: r275116

5 years agobackport: re PR target/89361 (s390 broken without S390_USE_TARGET_ATTRIBUTE, likely...
Jakub Jelinek [Fri, 30 Aug 2019 12:05:07 +0000 (14:05 +0200)] 
backport: re PR target/89361 (s390 broken without S390_USE_TARGET_ATTRIBUTE, likely since r257489)

Backported from mainline
2019-02-18  Jakub Jelinek  <jakub@redhat.com>

PR target/89361
* config/s390/s390.c (s390_indirect_branch_attrvalue,
s390_indirect_branch_settings): Define unconditionally.
(s390_set_current_function): Likewise, but guard the whole body except
the s390_indirect_branch_settings call with
#if S390_USE_TARGET_ATTRIBUTE.
(TARGET_SET_CURRENT_FUNCTION): Redefine unconditionally.

From-SVN: r275115

5 years agobackport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_...
Jakub Jelinek [Fri, 30 Aug 2019 12:02:30 +0000 (14:02 +0200)] 
backport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_this)

Backported from mainline
2019-02-19  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89303
* g++.dg/torture/pr89303.C: Move everything from std namespace to my
namespace.

From-SVN: r275114

5 years agobackport: re PR tree-optimization/89278 (ICE in gimplify_modify_expr, at gimplify...
Jakub Jelinek [Fri, 30 Aug 2019 12:02:02 +0000 (14:02 +0200)] 
backport: re PR tree-optimization/89278 (ICE in gimplify_modify_expr, at gimplify.c:5821)

Backported from mainline
2019-02-15  Richard Biener  <rguenther@suse.de>
    Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/89278
* tree-loop-distribution.c: Include tree-eh.h.
(generate_memset_builtin, generate_memcpy_builtin): Call
rewrite_to_non_trapping_overflow on builtin->size before passing it
to force_gimple_operand_gsi.

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

From-SVN: r275113

5 years agobackport: re PR other/89342 (ICE in maybe_default_option, at opts.c:347)
Jakub Jelinek [Fri, 30 Aug 2019 12:01:02 +0000 (14:01 +0200)] 
backport: re PR other/89342 (ICE in maybe_default_option, at opts.c:347)

Backported from mainline
2019-02-15  Jakub Jelinek  <jakub@redhat.com>

PR other/89342
* optc-save-gen.awk: Handle optimize_fast like optimize_size or
optimize_debug.
* opth-gen.awk: Likewise.

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

From-SVN: r275112

5 years agobackport: re PR rtl-optimization/89354 (Combine pass yields wrong code with -O2 and...
Jakub Jelinek [Fri, 30 Aug 2019 11:59:10 +0000 (13:59 +0200)] 
backport: re PR rtl-optimization/89354 (Combine pass yields wrong code with -O2 and -msse2 for 32bit target)

Backported from mainline
2019-02-14  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/89354
* combine.c (make_extraction): Punt if extraction_mode is narrower
than len bits.

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

From-SVN: r275111

5 years agobackport: re PR tree-optimization/89314 (ICE in wide_int_to_tree_1, at tree.c:1561)
Jakub Jelinek [Fri, 30 Aug 2019 11:52:29 +0000 (13:52 +0200)] 
backport: re PR tree-optimization/89314 (ICE in wide_int_to_tree_1, at tree.c:1561)

Backported from mainline
2019-02-14  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/89314
* fold-const.c (fold_binary_loc): Cast strlen argument to
const char * before dereferencing it.  Formatting fixes.

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

From-SVN: r275110

5 years agobackport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_...
Jakub Jelinek [Fri, 30 Aug 2019 11:51:36 +0000 (13:51 +0200)] 
backport: re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_this)

Backported from mainline
2019-02-13  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89303
* tree-ssa-structalias.c (set_uids_in_ptset): Or in vi->is_heap_var
into pt->vars_contains_escaped_heap instead of setting
pt->vars_contains_escaped_heap to it.

2019-02-13  Jonathan Wakely  <jwakely@redhat.com>
    Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89303
* g++.dg/torture/pr89303.C: New test.

From-SVN: r275109

5 years agobackport: re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent...
Jakub Jelinek [Fri, 30 Aug 2019 11:50:35 +0000 (13:50 +0200)] 
backport: re PR middle-end/89281 (gcc/optabs.c:3901:30: runtime error: shift exponent 32 is too large for 32-bit type 'int')

Backported from mainline
2019-02-13  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89281
* optabs.c (prepare_cmp_insn): Use UINTVAL (size) instead of
INTVAL (size), compare it to GET_MODE_MASK instead of
1 << GET_MODE_BITSIZE.

From-SVN: r275108

5 years agobackport: re PR middle-end/89246 (LTO produces references to cloned symbols which...
Jakub Jelinek [Fri, 30 Aug 2019 11:50:04 +0000 (13:50 +0200)] 
backport: re PR middle-end/89246 (LTO produces references to cloned symbols which the compiler failed to clone)

Backported from mainline
2019-02-09  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89246
* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
If !node->definition and TYPE_ARG_TYPES is non-NULL, use
TYPE_ARG_TYPES instead of DECL_ARGUMENTS.

* gcc.dg/gomp/pr89246-1.c: New test.
* gcc.dg/gomp/pr89246-2.c: New test.

From-SVN: r275107

5 years agobackport: re PR target/88861 (ICE in calc_dfs_tree, at dominance.c:458)
Jakub Jelinek [Fri, 30 Aug 2019 11:49:11 +0000 (13:49 +0200)] 
backport: re PR target/88861 (ICE in calc_dfs_tree, at dominance.c:458)

Backported from mainline
2019-01-16  David Malcolm  <dmalcolm@redhat.com>

PR target/88861
* combine.c (delete_noop_moves): Convert to "bool" return,
returning true if any edges are eliminated.
(combine_instructions): Also return true if delete_noop_moves
returns true.

* g++.dg/opt/pr89188.C: Include ../torture/pr88861.C.

2019-01-16  David Malcolm  <dmalcolm@redhat.com>

PR target/88861
* g++.dg/torture/pr88861.C: New test.

From-SVN: r275106

5 years agobackport: re PR rtl-optimization/89234 (ICE in get_eh_region_and_lp_from_rtx at gcc...
Jakub Jelinek [Fri, 30 Aug 2019 11:46:29 +0000 (13:46 +0200)] 
backport: re PR rtl-optimization/89234 (ICE in get_eh_region_and_lp_from_rtx at gcc/except.c:1824)

Backported from mainline
2019-02-08  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/89234
* except.c (copy_reg_eh_region_note_forward): Return if note_or_insn
is a NOTE, CODE_LABEL etc. - rtx_insn * other than INSN_P.
(copy_reg_eh_region_note_backward): Likewise.

* g++.dg/ubsan/pr89234.C: New test.

From-SVN: r275105

5 years agobackport: re PR c++/89187 (ICE in initialize_argument_information, at calls.c:2023)
Jakub Jelinek [Fri, 30 Aug 2019 11:43:53 +0000 (13:43 +0200)] 
backport: re PR c++/89187 (ICE in initialize_argument_information, at calls.c:2023)

Backported from mainline
2019-02-05  Jakub Jelinek  <jakub@redhat.com>

PR c++/89187
* optimize.c (maybe_thunk_body): Clear TREE_ADDRESSABLE on
PARM_DECLs of the thunk.
* lambda.c (maybe_add_lambda_conv_op): Likewise.

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

From-SVN: r275104

5 years agobackport: re PR rtl-optimization/11304 (Wrong code production with -fomit-frame-pointer)
Jakub Jelinek [Fri, 30 Aug 2019 11:43:04 +0000 (13:43 +0200)] 
backport: re PR rtl-optimization/11304 (Wrong code production with -fomit-frame-pointer)

Backported from mainline
2019-02-05  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/11304
* gcc.target/i386/call-1.c (set_eax): Add "eax" clobber.
* gcc.target/i386/call-2.c: New test.

From-SVN: r275102

5 years agobackport: re PR target/89188 (ICE in pre_and_rev_post_order_compute, at cfganal.c...
Jakub Jelinek [Fri, 30 Aug 2019 11:42:17 +0000 (13:42 +0200)] 
backport: re PR target/89188 (ICE in pre_and_rev_post_order_compute, at cfganal.c:1055)

Backported from mainline
2019-02-05  Jakub Jelinek  <jakub@redhat.com>

PR target/89188
* dce.c (delete_unmarked_insns): Don't remove no-op moves if they
can throw, non-call exceptions are enabled and we can't delete
dead exceptions or alter cfg.  Set must_clean if
delete_insn_and_edges returns true, don't set it blindly for calls.

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

From-SVN: r275101

5 years agobackport: re PR rtl-optimization/89195 (Corrupted stack offset after combine)
Jakub Jelinek [Fri, 30 Aug 2019 11:38:28 +0000 (13:38 +0200)] 
backport: re PR rtl-optimization/89195 (Corrupted stack offset after combine)

Backported from mainline
2019-02-05  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/89195
* combine.c (make_extraction): For MEMs, don't extract bytes outside
of the original MEM.

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

From-SVN: r275099

5 years agobackport: re PR target/89186 (ICE in mark_addressable at gcc/gimple-expr.c:894 since...
Jakub Jelinek [Fri, 30 Aug 2019 11:37:41 +0000 (13:37 +0200)] 
backport: re PR target/89186 (ICE in mark_addressable at gcc/gimple-expr.c:894 since r268138)

Backported from mainline
2019-02-05  Jakub Jelinek  <jakub@redhat.com>

PR target/89186
* optabs.c (prepare_cmp_insn): Pass x and y to
emit_block_comp_via_libcall rather than XEXP (x, 0) and XEXP (y, 0).

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

From-SVN: r275098

5 years agobackport: re PR middle-end/87887 (ICE in make_ssa_name_fn, at tree-ssanames.c:269)
Jakub Jelinek [Fri, 30 Aug 2019 11:36:58 +0000 (13:36 +0200)] 
backport: re PR middle-end/87887 (ICE in make_ssa_name_fn, at tree-ssanames.c:269)

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

PR middle-end/87887
* config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
Punt with warning on aggregate return or argument types.  Ignore
type/mode checking for uniform arguments.

* gcc.dg/gomp/pr87887-1.c: New test.
* gcc.dg/gomp/pr87887-2.c: New test.

From-SVN: r275097

5 years agobackport: re PR fortran/83246 (internal compiler error or loader problem might be...
Jakub Jelinek [Fri, 30 Aug 2019 11:36:10 +0000 (13:36 +0200)] 
backport: re PR fortran/83246 (internal compiler error or loader problem might be related to a PARAMETER statement being in a BLOCK)

Backported from mainline
2019-02-01  Jakub Jelinek  <jakub@redhat.com>

PR fortran/83246
PR fortran/89084
* trans-decl.c (generate_local_decl): Add referenced FL_PARAMETERs
if sym->ns->construct_entities rather than if
sym->ns->parent->code->op == EXEC_BLOCK.

* gfortran.dg/pr89084.f90: New test.
* gfortran.dg/lto/pr89084_0.f90: New test.
* gfortran.dg/pr83246.f90: New test.

From-SVN: r275096

5 years agobackport: re PR tree-optimization/88107 (ICE in find_outermost_region_in_block, at...
Jakub Jelinek [Fri, 30 Aug 2019 11:35:08 +0000 (13:35 +0200)] 
backport: re PR tree-optimization/88107 (ICE in find_outermost_region_in_block, at tree-cfg.c:7157)

Backported from mainline
2019-02-01  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/88107
* tree-cfg.c (find_outermost_region_in_block): Add ALL argument,
instead of assertion that eh_region_outermost is non-NULL, if it
is NULL, set *ALL to true and return NULL.
(move_sese_region_to_fn): Adjust caller, if all is set, call
duplicate_eh_regions with NULL region.

* gcc.dg/gomp/pr88107.c: New test.

From-SVN: r275095

5 years agobackport: re PR c++/66676 (pragma omp simd aligned(x) results in "internal compiler...
Jakub Jelinek [Fri, 30 Aug 2019 11:34:08 +0000 (13:34 +0200)] 
backport: re PR c++/66676 (pragma omp simd aligned(x) results in "internal compiler error: Segmentation fault")

Backported from mainline
2019-01-29  Jakub Jelinek  <jakub@redhat.com>

PR c++/66676
PR ipa/89104
* omp-simd-clone.c (simd_clone_clauses_extract)
<case OMP_CLAUSE_ALIGNED>: Ignore clauses with NULL
OMP_CLAUSE_ALIGNED_ALIGNMENT.

* gcc.dg/gomp/pr89104.c: New test.

From-SVN: r275094

5 years agobackport: re PR middle-end/89002 (ICE in scan_omp_1_op, at omp-low.c:3166)
Jakub Jelinek [Fri, 30 Aug 2019 11:33:12 +0000 (13:33 +0200)] 
backport: re PR middle-end/89002 (ICE in scan_omp_1_op, at omp-low.c:3166)

Backported from mainline
2019-01-28  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/89002
* gimplify.c (gimplify_omp_for): When adding OMP_CLAUSE_*_GIMPLE_SEQ
for lastprivate/linear IV, push gimplify context around gimplify_assign
and, if it needed any temporaries, pop it into a gimple bind around the
sequence.

* testsuite/libgomp.c/pr89002.c: New test.

From-SVN: r275093

5 years agobackport: re PR target/87214 (r263772 miscompiled 520.omnetpp_r in SPEC CPU 2017)
Jakub Jelinek [Fri, 30 Aug 2019 11:32:15 +0000 (13:32 +0200)] 
backport: re PR target/87214 (r263772 miscompiled 520.omnetpp_r in SPEC CPU 2017)

Backported from mainline
2019-01-27  Jakub Jelinek  <jakub@redhat.com>

PR target/87214
* config/i386/sse.md
(<mask_codefor>avx512dq_shuf_<shuffletype>64x2_1<mask_name>,
avx512f_shuf_<shuffletype>64x2_1<mask_name>): Ensure the
first constants in pairs are multiples of 2.  Formatting fixes.
(avx512vl_shuf_<shuffletype>32x4_1<mask_name>,
avx512vl_shuf_<shuffletype>32x4_1<mask_name>): Ensure the
first constants in each quadruple are multiples of 4.  Formatting fixes.

* gcc.target/i386/avx512vl-pr87214-1.c: New test.
* gcc.target/i386/avx512vl-pr87214-2.c: New test.

From-SVN: r275092

5 years agobackport: re PR c++/88976 (ICE in fold_convert_loc, at fold-const.c:2552)
Jakub Jelinek [Fri, 30 Aug 2019 11:31:02 +0000 (13:31 +0200)] 
backport: re PR c++/88976 (ICE in fold_convert_loc, at fold-const.c:2552)

Backported from mainline
2019-01-24  Jakub Jelinek  <jakub@redhat.com>

PR c++/88976
* semantics.c (finish_omp_cancel): Use maybe_convert_cond when not in
template or build_x_binary_op otherwise.

* c-c++-common/gomp/cancel-2.c: New test.
* gcc.dg/gomp/cancel-1.c: New test.
* g++.dg/gomp/cancel-1.C: New test.
* g++.dg/gomp/cancel-2.C: New test.
* g++.dg/gomp/cancel-3.C: New test.

From-SVN: r275091

5 years agoBackport PRs 49429, 49454, 86334, 88906
Jakub Jelinek [Fri, 30 Aug 2019 11:29:57 +0000 (13:29 +0200)] 
Backport PRs 49429, 49454, 86334, 88906

Backported from mainline
2019-01-22  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/49429
PR target/49454
PR rtl-optimization/86334
PR target/88906
* expr.c (emit_block_move_hints): Move marking of MEM_EXPRs
addressable from here...
(emit_block_op_via_libcall): ... to here.

* gcc.target/i386/pr86334.c: New test.
* gcc.target/i386/pr88906.c: New test.

From-SVN: r275090

5 years agobackport: re PR c++/88949 (ICE in expand_expr_real_1, at expr.c:10001 with -fopenmp)
Jakub Jelinek [Fri, 30 Aug 2019 11:29:04 +0000 (13:29 +0200)] 
backport: re PR c++/88949 (ICE in expand_expr_real_1, at expr.c:10001 with -fopenmp)

Backported from mainline
2019-01-21  Jakub Jelinek  <jakub@redhat.com>

PR c++/88949
* optimize.c (cxx_copy_decl): New function.
(clone_body): Use it instead of copy_decl_no_change.

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

From-SVN: r275089

5 years agobackport: re PR fortran/88902 (ICE: Segmentation fault (in DFS::DFS_write_tree_body))
Jakub Jelinek [Fri, 30 Aug 2019 11:28:22 +0000 (13:28 +0200)] 
backport: re PR fortran/88902 (ICE: Segmentation fault (in DFS::DFS_write_tree_body))

Backported from mainline
2019-01-19  Jakub Jelinek  <jakub@redhat.com>

PR fortran/88902
* trans-decl.c (gfc_get_symbol_decl): Don't add length to function
or parent function if it has been added there already.

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

From-SVN: r275088

5 years agobackport: re PR rtl-optimization/88870 (ICE: Segmentation fault (in df_worklist_propa...
Jakub Jelinek [Fri, 30 Aug 2019 11:27:33 +0000 (13:27 +0200)] 
backport: re PR rtl-optimization/88870 (ICE: Segmentation fault (in df_worklist_propagate_backward))

Backported from mainline
2019-01-17  Jakub Jelinek  <jakub@redhat.com>

PR rtl-optimization/88870
* dce.c (deletable_insn_p): Never delete const/pure calls that can
throw if we can't alter the cfg or delete dead exceptions.
(mark_insn): Don't call find_call_stack_args for such calls.

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

From-SVN: r275087

5 years agobackport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)
Jakub Jelinek [Fri, 30 Aug 2019 11:26:42 +0000 (13:26 +0200)] 
backport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)

Backported from mainline
2019-01-10  Jakub Jelinek  <jakub@redhat.com>

PR c/88568
* tree.c (handle_dll_attribute): Clear TREE_STATIC after setting
DECL_EXTERNAL.

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

From-SVN: r275086

5 years agobackport: re PR middle-end/82564 (ICE at -O1 and above: in assign_stack_temp_for_type...
Jakub Jelinek [Fri, 30 Aug 2019 11:26:01 +0000 (13:26 +0200)] 
backport: re PR middle-end/82564 (ICE at -O1 and above: in assign_stack_temp_for_type, at function.c:783)

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

PR middle-end/82564
PR target/88620
* expr.c (expand_assignment): For calls returning VLA structures
if to_rtx is not a MEM, force it into a stack temporary.

* gcc.dg/nested-func-12.c: New test.
* gcc.c-torture/compile/pr82564.c: New test.

From-SVN: r275085

5 years agobackport: re PR target/88594 (ICE in int_mode_for_mode, at stor-layout.c:403)
Jakub Jelinek [Fri, 30 Aug 2019 11:25:16 +0000 (13:25 +0200)] 
backport: re PR target/88594 (ICE in int_mode_for_mode, at stor-layout.c:403)

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

PR target/88594
* config/i386/i386.c (ix86_expand_divmod_libfunc): Use mode instead
of GET_MODE (opN) as modes of the libcall arguments.

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

From-SVN: r275084

5 years agobackport: re PR debug/88644 (Unexpected pub type info eliminated after r246973 (cause...
Jakub Jelinek [Fri, 30 Aug 2019 11:24:34 +0000 (13:24 +0200)] 
backport: re PR debug/88644 (Unexpected pub type info eliminated after r246973 (causes pubtypes-*.c to regress).)

Backported from mainline
2019-01-03  Jakub Jelinek  <jakub@redhat.com>

PR debug/88644
* dwarf2out.c (modified_type_die): If type is equal to sizetype,
change it to qualified_type.

* gcc.dg/debug/dwarf2/pr88644.c: New test.

2019-01-03  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.dg/pubtypes-2.c: Adjust expected pubtypes length.
* gcc.dg/pubtypes-3.c: Likewise.
* gcc.dg/pubtypes-4.c: Likewise.

From-SVN: r275083

5 years agobackport: re PR middle-end/85594 (ICE during expand when compiling with -fwrapv ...
Jakub Jelinek [Fri, 30 Aug 2019 11:23:16 +0000 (13:23 +0200)] 
backport: re PR middle-end/85594 (ICE during expand when compiling with -fwrapv -fopenmp)

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

PR middle-end/85594
PR middle-end/88553
* omp-expand.c (extract_omp_for_update_vars): Regimplify the condition
if needed.
(expand_omp_for_generic): Don't clobber t temporary for ordered loops.

* gcc.dg/gomp/pr85594.c: New test.
* gcc.dg/gomp/pr88553.c: New test.

From-SVN: r275082

5 years agobackport: re PR rtl-optimization/88563 (wrong code with -O2 -fno-code-hoisting -fno...
Jakub Jelinek [Fri, 30 Aug 2019 11:22:27 +0000 (13:22 +0200)] 
backport: re PR rtl-optimization/88563 (wrong code with -O2 -fno-code-hoisting -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-forwprop -fno-tree-fre -fno-tree-pre -fno-tree-vrp)

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

PR rtl-optimization/88563
* expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: Swap innermode
and mode arguments to convert_modes.  Likewise swap mode and word_mode
arguments.  Handle both arguments with VOIDmode before convert_modes
of one of them.  Formatting fixes.

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

From-SVN: r275081

5 years agobackport: re PR rtl-optimization/88470 (ICE in maybe_record_trace_start, at dwarf2cfi...
Jakub Jelinek [Fri, 30 Aug 2019 11:21:45 +0000 (13:21 +0200)] 
backport: re PR rtl-optimization/88470 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2354)

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

PR rtl-optimization/88470
* cfgcleanup.c (outgoing_edges_match): If the function is
shrink-wrapped and bb1 ends with a JUMP_INSN with a single fake
edge to EXIT, return false.

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

From-SVN: r275080

5 years agobackport: re PR rtl-optimization/88416 (ICE in in df_uses_record, at df-scan.c:3013)
Jakub Jelinek [Fri, 30 Aug 2019 11:20:47 +0000 (13:20 +0200)] 
backport: re PR rtl-optimization/88416 (ICE in in df_uses_record, at df-scan.c:3013)

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

PR rtl-optimization/88416
* valtrack.c (cleanup_auto_inc_dec): Handle pre/post-inc/dec/modify
even if !AUTO_INC_DEC.

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

From-SVN: r275079

5 years agobackport: re PR c++/86669 (Complete object constructor clone omits length for a c...
Jakub Jelinek [Fri, 30 Aug 2019 11:20:08 +0000 (13:20 +0200)] 
backport: re PR c++/86669 (Complete object constructor clone omits length for a c++11 braced initialiser)

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

PR c++/86669
* call.c (make_temporary_var_for_ref_to_temp): Call pushdecl even for
automatic vars.

* g++.dg/cpp0x/initlist105.C: New test.
* g++.dg/cpp0x/initlist106.C: New test.
* g++.dg/other/pr86669.C: New test.

From-SVN: r275078

5 years agobackport: re PR target/85593 (GCC on ARM allocates R3 for local variable when calling...
Jakub Jelinek [Fri, 30 Aug 2019 11:19:17 +0000 (13:19 +0200)] 
backport: re PR target/85593 (GCC on ARM allocates R3 for local variable when calling naked function with O2 optimizations enabled)

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

PR target/85593
* final.c (rest_of_handle_final): Don't call collect_fn_hard_reg_usage
for functions with naked attribute.

From-SVN: r275077

5 years agobackport: re PR fortran/88377 (ICE in gfc_omp_clause_copy_ctor, at fortran/trans...
Jakub Jelinek [Fri, 30 Aug 2019 11:18:41 +0000 (13:18 +0200)] 
backport: re PR fortran/88377 (ICE in gfc_omp_clause_copy_ctor, at fortran/trans-openmp.c:614)

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

PR fortran/88377
* trans-openmp.c (gfc_omp_clause_default_ctor,
gfc_omp_clause_copy_ctor, gfc_omp_clause_assign_op,
gfc_omp_clause_linear_ctor, gfc_omp_clause_dtor): Only consider
GFC_DECL_GET_SCALAR_ALLOCATABLE vars as scalar allocatables if they
have pointer type.

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

From-SVN: r275076

5 years agobackport: re PR c++/87506 (ICE with inherited constexpr constructor with const argument)
Jakub Jelinek [Fri, 30 Aug 2019 11:17:41 +0000 (13:17 +0200)] 
backport: re PR c++/87506 (ICE with inherited constexpr constructor with const argument)

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

PR c++/87506
* constexpr.c (adjust_temp_type): Handle EMPTY_CLASS_EXPR.

* g++.dg/cpp0x/constexpr-87506.C: New test.

From-SVN: r275075

5 years agobackport: re PR c++/88103 (Wrong value category when conditional expression result...
Jakub Jelinek [Fri, 30 Aug 2019 11:16:55 +0000 (13:16 +0200)] 
backport: re PR c++/88103 (Wrong value category when conditional expression result is used as object expression)

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

PR c++/88103
* typeck.c (build_class_member_access_expr): If unary_complex_lvalue
turned xvalue_p into non-xvalue_p, call move on it.

* g++.dg/cpp0x/rv-cond3.C: New test.

From-SVN: r275074

5 years agobackport: re PR tree-optimization/71109 (gcc ICE at -O3 on valid code on x86_64-linux...
Jakub Jelinek [Fri, 30 Aug 2019 11:16:10 +0000 (13:16 +0200)] 
backport: re PR tree-optimization/71109 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "maybe_record_trace_start")

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

PR tree-optimization/71109
* gcc.c-torture/compile/pr71109.c: New test.

From-SVN: r275073

5 years agobackport: re PR debug/85550 (-fdebug-types-section broken with DW_OP_addr in DW_AT_lo...
Jakub Jelinek [Fri, 30 Aug 2019 11:15:39 +0000 (13:15 +0200)] 
backport: re PR debug/85550 (-fdebug-types-section broken with DW_OP_addr in DW_AT_location)

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

PR debug/85550
* g++.dg/debug/dwarf2/pr85550.C: New test.

From-SVN: r275072

5 years agobackport: re PR c++/88181 (ICE: verify_type failed (error: type variant differs by...
Jakub Jelinek [Fri, 30 Aug 2019 11:14:56 +0000 (13:14 +0200)] 
backport: re PR c++/88181 (ICE: verify_type failed (error: type variant differs by TYPE_PACKED))

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

PR c++/88181
* class.c (fixup_attribute_variants): Also propagate TYPE_PACKED
to variants.

* g++.dg/debug/pr88181.C: New test.

From-SVN: r275071

5 years agobackport: re PR tree-optimization/87895 (ICE in purge_dead_edges, at cfgrtl.c:3246)
Jakub Jelinek [Fri, 30 Aug 2019 11:12:23 +0000 (13:12 +0200)] 
backport: re PR tree-optimization/87895 (ICE in purge_dead_edges, at cfgrtl.c:3246)

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

PR tree-optimization/87895
* omp-simd-clone.c (ipa_simd_modify_function_body): When removing
or replacing GIMPLE_RETURN, set EDGE_FALLTHRU on the edge to EXIT.
(simd_clone_adjust): Don't set EDGE_FALLTHRU here. In a loop that
redirects edges to EXIT to edges to incr_bb, iterate while EXIT
has any preds and always use EDGE_PRED (, 0).

* gcc.dg/gomp/pr87895-1.c: New test.
* gcc.dg/gomp/pr87895-2.c: New test.
* gcc.dg/gomp/pr87895-3.c: New test.

From-SVN: r275070