aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2019-09-05[ObjC] Recognise 'instancetype' as equivalent to 'id'.Iain Sandoe2-0/+37
This is primarily about fixing a number of testsuite fails, it implements the parsing of 'instancetype' but doesn't alter the code gen (relative to using id in the same position). It is part of the work-arounds for PR90709. gcc/objc/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-05-18 Iain Sandoe <iain@sandoe.co.uk> * objc/objc-act.h (OCTI_INSTANCE_TYPE, OCTI_INSTANCETYPE_NAME): New. (objc_global_trees): Add instance type and name. (INSTANCE_TYPEDEF_NAME): New. * objc/objc-act.c (synth_module_prologue): Build decls for objc_instancetype_type and objc_instancetype_name. gcc/testsuite/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-05-18 Iain Sandoe <iain@sandoe.co.uk> * objc.dg/instancetype-0.m: New. From-SVN: r275428
2019-09-05backport: [multiple changes]Richard Biener3-0/+64
2019-09-05 Richard Biener <rguenther@suse.de> * lto-streamer.h (LTO_minor_version): Bump. Backport from mainline 2019-05-06 Richard Biener <rguenther@suse.de> PR tree-optimization/90328 * tree-data-ref.h (dr_may_alias_p): Pass in the actual loop nest. * tree-data-ref.c (dr_may_alias_p): Check whether the clique is valid in the loop nest before using it. (initialize_data_dependence_relation): Adjust. * graphite-scop-detection.c (build_alias_set): Pass the SCOP enclosing loop as loop-nest to dr_may_alias_p. * gcc.dg/torture/pr90328.c: New testcase. 2019-03-08 Richard Biener <rguenther@suse.de> PR middle-end/89578 * cfgloop.h (struct loop): Add owned_clique field. * cfgloopmanip.c (copy_loop_info): Copy it. * tree-cfg.c (gimple_duplicate_bb): Do not remap owned_clique cliques. * tree-inline.c (copy_loops): Remap owned_clique. * lto-streamer-in.c (input_cfg): Stream owned_clique. * lto-streamer-out.c (output_cfg): Likewise. 2019-02-22 Richard Biener <rguenther@suse.de> PR tree-optimization/87609 * tree-cfg.c (gimple_duplicate_bb): Only remap inlined cliques. 2019-02-22 Richard Biener <rguenther@suse.de> PR middle-end/87609 * cfghooks.h (dependence_hash): New typedef. (struct copy_bb_data): New type. (cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument. (duplicate_block): Likewise. * cfghooks.c (duplicate_block): Pass down copy_bb_data. (copy_bbs): Create and pass down copy_bb_data. * cfgrtl.c (cfg_layout_duplicate_bb): Adjust. (rtl_duplicate_bb): Likewise. * tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL remap dependence info. * gcc.dg/torture/restrict-7.c: New testcase. 2019-02-22 Richard Biener <rguenther@suse.de> PR tree-optimization/87609 * tree-core.h (tree_base): Document special clique values. * tree-inline.c (remap_dependence_clique): Do not use the special clique value of one. (maybe_set_dependence_info): Use clique one. (clear_dependence_clique): New callback. (compute_dependence_clique): Clear clique one from all refs before assigning it (again). From-SVN: r275405
2019-09-04[Darwin, Driver] Fix driver crashes with valid command line input.Iain Sandoe2-0/+33
Backport Improve processing of macosx-version-min= For PR target/63810 some improvements were made in the parsing of the version string at the point it's used to define the built-in __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__. This is fine, but the specs processing also uses the version, and specs version-compare doesn't like leading zeros on components. This means that while we succeed in processing -mmacosx-version-min=010.00002.000099 on compile lines, it fails for any other line that uses the value as part of a spec (in particular, link lines fail). To fix this, we need to apply a bit of clean-up to the version that's presented to the driver, and push that back into the command line opts. The value can come from four places: 1. User-entered on the command line 2. User-entered as MACOSX_DEPLOYMENT_TARGET= environment var. 3. Absent those two 3a For self-hosting systems, look-up from the kernel 3b For cross-compilers, as a default supplied at configure time. We apply the clean-up to all 4 (although it shouldn't really be needed for the cases under 3). We also supply a test-case that adapts to the target-version of the system, so that the link requirements are met by the SDK in use (if you try to link i686-darwin9 on an x86-64-darwin18 SDK, it will fail). gcc/ 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-06-19 Iain Sandoe <iain@sandoe.co.uk> * config/darwin-driver.c (darwin_driver_init): Fix off-by-one errors in computing the number of options to be moved. Backport from mainline 2019-06-13 Iain Sandoe <iain@sandoe.co.uk> * config/darwin-driver.c (validate_macosx_version_min): New. (darwin_default_min_version): Cleanup and validate supplied version. (darwin_driver_init): Likewise and push cleaned version into opts. gcc/testsuite/ 2019-09-04 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-06-13 Iain Sandoe <iain@sandoe.co.uk> * gcc.dg/darwin-minversion-link.c: New test. From-SVN: r275382
2019-09-04backport: re PR tree-optimization/81740 (wrong code at -O3 in both 32-bit ↵Richard Biener3-0/+55
and 64-bit modes on x86_64-linux-gnu) 2019-09-04 Richard Biener <rguenther@suse.de> Backport from mainline 2019-03-26 Bin Cheng <bin.cheng@linux.alibaba.com> PR tree-optimization/81740 * tree-vect-data-refs.c (vect_analyze_data_ref_dependence): In case of outer loop vectorization, check for backward dependence at the inner loop if outer loop dependence is reversed. * gcc.dg/vect/pr81740-1.c: New testcase. * gcc.dg/vect/pr81740-2.c: Likewise. From-SVN: r275372
2019-09-04backport: re PR tree-optimization/88149 (ICE in vect_transform_stmt since ↵Richard Biener2-0/+71
r265959) 2019-09-04 Richard Biener <rguenther@suse.de> Backport from mainline 2018-11-23 Richard Biener <rguenther@suse.de> PR tree-optimization/88149 * tree-vect-slp.c (vect_slp_analyze_node_operations): Detect the case where there are two different def types for the same operand at different operand position in the same stmt. * g++.dg/torture/pr88149.C: New testcase. From-SVN: r275370
2019-09-04Backport PRs 87929, 88030, 88415, 88448, 88903, 89698, 90006Richard Biener9-1/+191
2019-09-04 Richard Biener <rguenther@suse.de> Backport from mainline 2019-04-09 Richard Sandiford <richard.sandiford@arm.com> * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Always use gimple_expr_type for load and store calls. Skip over the condition argument in a conditional internal function. Protect use of TREE_INT_CST_LOW. 2019-04-08 Richard Biener <rguenther@suse.de> PR tree-optimization/90006 * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Handle calls like lrint. * gcc.dg/vect/bb-slp-pr90006.c: New testcase. 2019-03-14 Richard Biener <rguenther@suse.de> PR middle-end/89698 * fold-const.c (operand_equal_p): For INDIRECT_REF check that the access types are similar. * g++.dg/torture/pr89698.C: New testcase. 2019-01-18 Richard Biener <rguenther@suse.de> PR tree-optimization/88903 * tree-vect-stmts.c (vectorizable_shift): Verify we see all scalar stmts a SLP shift amount is composed of when detecting shifts by scalars. * gcc.dg/vect/pr88903-1.c: New testcase. * gcc.dg/vect/pr88903-2.c: Likewise. 2018-12-11 Richard Biener <rguenther@suse.de> PR middle-end/88448 PR middle-end/88415 * tree-complex.c (update_complex_assignment): Properly transfer or clean EH info around gimple_assign_set_rhs_with_ops. * gcc.dg/gomp/pr88415.c: New testcase. 2018-11-15 Richard Biener <rguenther@suse.de> PR tree-optimization/88030 * tree-complex.c (need_eh_cleanup): New global. (update_complex_assignment): Mark blocks that need EH update. (expand_complex_comparison): Likewise. (tree_lower_complex): Allocate and deallocate need_eh_cleanup, perform EH cleanup and schedule CFG cleanup if that did anything. * gcc.dg/tsan/pr88030.c: New testcase. 2018-11-08 Richard Biener <rguenther@suse.de> PR tree-optimization/87929 * tree-complex.c (expand_complex_comparison): Clean EH. * gcc.dg/pr87929.c: New testcase. 2017-07-25 Eric Botcazou <ebotcazou@adacore.com> * gimple.c (gimple_assign_set_rhs_with_ops): Do not ask gsi_replace to update EH info here. From-SVN: r275366
2019-09-02Backport PRs 89135, 89296, 89392, 89572, 89710Richard Biener5-0/+129
2019-09-02 Richard Biener <rguenther@suse.de> Backport from mainline 2019-03-14 Richard Biener <rguenther@suse.de> PR tree-optimization/89710 * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use safe_dyn_cast. * gcc.dg/torture/pr89710.c: New testcase. 2019-03-14 Richard Biener <rguenther@suse.de> PR middle-end/89572 * tree-scalar-evolution.c (get_loop_exit_condition): Use safe_dyn_cast. * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Use gimple_location_safe. * gcc.dg/torture/pr89572.c: New testcase. 2019-02-18 Richard Biener <rguenther@suse.de> PR tree-optimization/89296 * tree-ssa-loop-ch.c (ch_base::copy_headers): Restrict setting of no-warning flag to cases that might emit the bogus warning. * gcc.dg/uninit-pr89296.c: New testcase. 2019-02-21 Richard Biener <rguenther@suse.de> PR middle-end/89392 cp/ * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not make symtab process new functions here. 2019-01-31 Richard Biener <rguenther@suse.de> PR tree-optimization/89135 * tree-ssa-phiprop.c (pass_phiprop::execute): Skip blocks with abnormal preds. * gcc.dg/torture/pr89135.c: New testcase. From-SVN: r275319
2019-09-02Backport PRs 90020, 90278, 91126, 91131, 91162, 91200Richard Biener7-0/+184
2019-09-02 Richard Biener <rguenther@suse.de> Backport from mainline 2019-07-19 Richard Biener <rguenther@suse.de> PR tree-optimization/91200 * tree-ssa-phiopt.c (cond_store_replacement): Check we have no PHI nodes in middle-bb. * gcc.dg/torture/pr91200.c: New testcase. 2019-07-15 Richard Biener <rguenther@suse.de> PR middle-end/91162 * tree-cfg.c (move_block_to_fn): When releasing a virtual PHI node make sure to replace all uses with something valid. * gcc.dg/autopar/pr91162.c: New testcase. 2019-07-11 Richard Biener <rguenther@suse.de> PR middle-end/91131 * gimplify.c (gimplify_compound_literal_expr): Force a temporary when the object is volatile and we have not cleared it even though there are no nonzero elements. * gcc.target/i386/pr91131.c: New testcase. 2019-07-10 Richard Biener <rguenther@suse.de> PR tree-optimization/91126 * tree-ssa-sccvn.c (n_walk_cb_data::push_partial_def): Adjust native encoding offset for BYTES_BIG_ENDIAN. (vn_reference_lookup_3): Likewise. * gcc.dg/torture/pr91126.c: New testcase. 2019-07-10 Richard Biener <rguenther@suse.de> PR tree-optimization/91126 * tree-ssa-sccvn.c (vn_reference_lookup_3): Adjust native encoding offset for BYTES_BIG_ENDIAN. * gcc.dg/torture/pr91126.c: New testcase. 2019-04-29 Richard Biener <rguenther@suse.de> PR tree-optimization/90278 * tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean EH on comparison simplification. * gcc.dg/torture/pr90278.c: New testcase. 2019-04-11 Richard Biener <rguenther@suse.de> PR tree-optimization/90020 * tree-ssa-sccvn.c (vn_reference_may_trap): New function. * tree-ssa-sccvn.h (vn_reference_may_trap): Declare. * tree-ssa-pre.c (compute_avail): Use it to not put possibly trapping references after a call that might not return into EXP_GEN. * gcse.c (compute_hash_table_work): Do not elide marking a block containing a call if the call might not return. * gcc.dg/torture/pr90020.c: New testcase. From-SVN: r275317
2019-09-02backport: re PR tree-optimization/91137 (Wrong code with -O3)Bin Cheng2-0/+42
Backport from mainline 2019-07-18 Bin Cheng <bin.linux@linux.alibaba.com> PR tree-optimization/91137 * tree-ssa-loop-ivopts.c (struct ivopts_data): New field. (tree_ssa_iv_optimize_init, alloc_iv, tree_ssa_iv_optimize_finalize): Init, use and fini the above new field. (determine_base_object_1): New function. (determine_base_object): Reimplement using walk_tree. 2019-07-18 Bin Cheng <bin.linux@linux.alibaba.com> PR tree-optimization/91137 * gcc.c-torture/execute/pr91137.c: New test. From-SVN: r275304
2019-08-31rs6000: Fix darn-3.c for GCC 8 and GCC 7Segher Boessenkool2-1/+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
2019-08-30Backport PRs 89677, 90071, 90194, 90213, 90474, 90637, 90930Richard Biener4-0/+75
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
2019-08-30backport: re PR target/91481 (POWER9 "DARN" RNG intrinsic produces repeated ↵Segher Boessenkool2-0/+24
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
2019-08-30backport: re PR target/91150 (wrong code with -O -mavx512vbmi due to wrong ↵Jakub Jelinek2-0/+42
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
2019-08-30backport: re PR middle-end/78884 ([7/8] ICE when gimplifying VLA in OpenMP ↵Jakub Jelinek2-0/+19
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
2019-08-30backport: re PR rtl-optimization/90756 (g++ ICE in convert_move, at ↵Jakub Jelinek2-0/+31
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
2019-08-30backport: re PR sanitizer/90954 (ICE: combining undefined behavior sanitizer ↵Jakub Jelinek2-0/+32
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
2019-08-30backport: re PR c++/90950 (OpenMP clause handling rejecting references to ↵Jakub Jelinek2-0/+21
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
2019-08-30backport: re PR c/90760 (ICE on attributes section and alias in set_section, ↵Jakub Jelinek2-0/+13
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
2019-08-30backport: re PR pch/90326 (Using any precompiled header breaks definition of ↵Jakub Jelinek3-0/+16
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
2019-08-30backport: re PR middle-end/90139 (ICE in emit_block_move_hints, at expr.c:1601)Jakub Jelinek2-0/+25
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
2019-08-30backport: re PR target/90187 (ICE in extract_insn, at recog.c:2304 x86_64)Jakub Jelinek2-0/+18
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
2019-08-30backport: re PR tree-optimization/90208 (error: EH landing pad label)Jakub Jelinek2-0/+25
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
2019-08-30backport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))Jakub Jelinek2-0/+11
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
2019-08-30backport: re PR rtl-optimization/90082 (ICE in delete_unmarked_insns, at ↵Jakub Jelinek2-0/+16
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
2019-08-30backport: re PR tree-optimization/90090 (ICE in mark_reachable_handlers, at ↵Jakub Jelinek2-0/+24
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
2019-08-30backport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)Jakub Jelinek2-0/+10
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
2019-08-30backport: re PR middle-end/89998 (ICE: verify_gimple failed in ↵Jakub Jelinek3-0/+52
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
2019-08-30backport: re PR sanitizer/89869 (-fsanitize=undefined miscompilation)Jakub Jelinek2-0/+21
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
2019-08-30backport: re PR c/89872 (GCC does not generate read access to volatile ↵Jakub Jelinek2-0/+32
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
2019-08-30backport: re PR middle-end/89621 (ICE with allocatable character and openmp)Jakub Jelinek2-0/+23
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
2019-08-30backport: re PR c++/89796 (Incorrect warning generated with OpenMP atomic ↵Jakub Jelinek3-0/+82
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
2019-08-30backport: re PR c++/60702 (thread_local initialization)Jakub Jelinek3-12/+27
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
2019-08-30backport: re PR c++/60702 (thread_local initialization)Jakub Jelinek15-0/+236
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
2019-08-30backport: re PR c++/89767 (ICE with tuple and optimization)Jakub Jelinek4-0/+66
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
2019-08-30backport: re PR target/89752 (ICE in emit_move_insn, at expr.c:3723)Jakub Jelinek4-2/+20
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
2019-08-30backport: re PR target/89726 (Incorrect inlined version of 'ceil' for 32bit)Jakub Jelinek2-0/+13
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
2019-08-30backport: re PR c/89734 (const qualifier on return type not erased inside ↵Jakub Jelinek2-0/+17
__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
2019-08-30backport: re PR debug/89704 (ICE in add_const_value_attribute, at ↵Jakub Jelinek2-0/+19
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
2019-08-30backport: re PR rtl-optimization/89679 (wrong code with -Og ↵Jakub Jelinek2-0/+29
-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
2019-08-30backport: re PR tree-optimization/89703 (ICE in compare_values_warnv, at ↵Jakub Jelinek3-0/+30
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
2019-08-30backport: re PR c++/89512 (ICE in get_expr_operands, at tree-ssa-operands.c:882)Jakub Jelinek2-0/+25
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
2019-08-30backport: re PR middle-end/88588 (ICE in make_decl_rtl, at varasm.c:1329)Jakub Jelinek2-0/+23
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
2019-08-30backport: re PR middle-end/89663 (ICE in expand_builtin_int_roundingfn_2, at ↵Jakub Jelinek3-0/+169
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
2019-08-30backport: re PR fortran/89651 (OpenMP private array uninitialized warning ↵Jakub Jelinek2-0/+26
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
2019-08-30backport: re PR c/88568 ('dllimport' no longer implies 'extern' in C)Jakub Jelinek2-0/+18
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
2019-08-30backport: re PR c++/82075 (structured binding fails with empty base class)Jakub Jelinek2-0/+19
Backported from mainline 2019-03-08 Jakub Jelinek <jakub@redhat.com> PR c++/82075 * g++.dg/cpp1z/decomp49.C: New test. From-SVN: r275125
2019-08-30backport: re PR c++/87148 (backward compatibility issue to take char [] as ↵Jakub Jelinek2-0/+15
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
2019-08-30backport: re PR middle-end/89590 (ICE in maybe_emit_free_warning)Jakub Jelinek2-0/+16
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
2019-08-30backport: re PR c/89521 (ICE in expand_builtin_int_roundingfn, at ↵Jakub Jelinek3-0/+59
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
2019-08-30backport: re PR c/89520 (ICE tree check: accessed operand 4 of call_expr ↵Jakub Jelinek3-0/+61
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