platform/upstream/gcc.git
5 years agoFix errors in new test
Jonathan Wakely [Fri, 30 Aug 2019 16:25:20 +0000 (17:25 +0100)]
Fix errors in new test

* testsuite/23_containers/vector/cons/89164_c++17.cc: Fix errors.

From-SVN: r275204

5 years agodecl.c (maybe_saturate_size): New function.
Eric Botcazou [Fri, 30 Aug 2019 15:32:51 +0000 (15:32 +0000)]
decl.c (maybe_saturate_size): New function.

* gcc-interface/decl.c (maybe_saturate_size): New function.
(gnat_to_gnu_entity): Invoke it on the Esize of types before sending
it for back-annotations.
* gcc-interface/trans.c: Fix typo.

From-SVN: r275200

5 years agobaseline_symbols.txt: Update.
Uros Bizjak [Fri, 30 Aug 2019 15:27:10 +0000 (17:27 +0200)]
baseline_symbols.txt: Update.

* config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275199

5 years agoada-tree.h (DECL_FORCED_BY_REF_P): New macro.
Eric Botcazou [Fri, 30 Aug 2019 15:22:34 +0000 (15:22 +0000)]
ada-tree.h (DECL_FORCED_BY_REF_P): New macro.

* gcc-interface/ada-tree.h (DECL_FORCED_BY_REF_P): New macro.
* gcc-interface/decl.c (gnat_to_gnu_param): Set it on parameters
whose mechanism was forced to by-reference.
* gcc-interface/trans.c (Call_to_gnu): Do not issue a warning about a
misaligned actual parameter if it is based on a CONSTRUCTOR.  Remove
  obsolete warning for users of Starlet.  Issue a warning if a temporary
is make around the call for a parameter with DECL_FORCED_BY_REF_P set.
(addressable_p): Return true for REAL_CST and ADDR_EXPR.

From-SVN: r275198

5 years agotrans.c (gnat_to_gnu): Do not set the location on an expression used for a tag.
Eric Botcazou [Fri, 30 Aug 2019 15:15:40 +0000 (15:15 +0000)]
trans.c (gnat_to_gnu): Do not set the location on an expression used for a tag.

* gcc-interface/trans.c (gnat_to_gnu): Do not set the location on an
expression used for a tag.

From-SVN: r275197

5 years agogigi.h (aggregate_type_contains_array_p): Declare.
Eric Botcazou [Fri, 30 Aug 2019 15:12:20 +0000 (15:12 +0000)]
gigi.h (aggregate_type_contains_array_p): Declare.

* gcc-interface/gigi.h (aggregate_type_contains_array_p): Declare.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Record_Type>: For an
extension, test Has_Record_Rep_Clause instead of Has_Specified_Layout.
(adjust_packed): Return 0 if the type of the field is an aggregate
type that contains (or is) a self-referential array.
(type_has_variable_size): Delete.
* gcc-interface/utils.c (inish_record_type): Constify a variable.
(aggregate_type_contains_array_p): Add parameter SELF_REFERENTIAL.
<RECORD_TYPE>: Pass it in the recursive call.
<ARRAY_TYPE>: If it is true, return true only if the array type is
self-referential.
(create_field_decl): Streamline the setting of the alignment on the
field.  Pass false to aggregate_type_contains_array_p.

From-SVN: r275196

5 years ago* gcc.target/mips/r10k-cache-barrier-9.c: Suppress warnings.
Jeff Law [Fri, 30 Aug 2019 15:10:14 +0000 (09:10 -0600)]
* gcc.target/mips/r10k-cache-barrier-9.c: Suppress warnings.

From-SVN: r275195

5 years agotrans.c (lvalue_required_p): Adjust GNU_TYPE in the recursive call.
Eric Botcazou [Fri, 30 Aug 2019 14:48:16 +0000 (14:48 +0000)]
trans.c (lvalue_required_p): Adjust GNU_TYPE in the recursive call.

* gcc-interface/trans.c (lvalue_required_p) <N_Slice>: Adjust GNU_TYPE
in the recursive call.
<N_Selected_Component>: Likewise.

From-SVN: r275191

5 years agoutils.c (build_template): Deal with parameters passed by pointer to component of...
Eric Botcazou [Fri, 30 Aug 2019 14:44:50 +0000 (14:44 +0000)]
utils.c (build_template): Deal with parameters passed by pointer to component of multi-dimensional arrays.

* gcc-interface/utils.c (build_template): Deal with parameters
passed by pointer to component of multi-dimensional arrays.

From-SVN: r275190

5 years agodecl.c (annotate_value): Inline the call also if List_Representation_Info is greater...
Eric Botcazou [Fri, 30 Aug 2019 14:39:09 +0000 (14:39 +0000)]
decl.c (annotate_value): Inline the call also if List_Representation_Info is greater than 3.

* gcc-interface/decl.c (annotate_value) <CALL_EXPR>: Inline the call
also if List_Representation_Info is greater than 3.

From-SVN: r275188

5 years ago* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Add assertion.
Eric Botcazou [Fri, 30 Aug 2019 14:26:20 +0000 (14:26 +0000)]
* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Size>: Add assertion.

From-SVN: r275187

5 years ago* doc/invoke.texi (-Wvolatile): Use @code for volatile.
Marek Polacek [Fri, 30 Aug 2019 13:55:59 +0000 (13:55 +0000)]
* doc/invoke.texi (-Wvolatile): Use @code for volatile.

From-SVN: r275178

5 years agoPR libstdc++/89164 enforce constraints for uninitialized algos
Jonathan Wakely [Fri, 30 Aug 2019 13:54:49 +0000 (14:54 +0100)]
PR libstdc++/89164 enforce constraints for uninitialized algos

The memmove optimizations for std::uninitialized_copy/fill/_n will
compile even if the type is not copy constructible, because std::copy
doesn't require copy construction to work. But the uninitialized
algorithms do require it.

This adds explicit static assertions to ensure we don't allow ill-formed
initializations.

PR libstdc++/89164
* include/bits/stl_algobase.h (__copy_move): Give descriptive names
to template parameters.
* include/bits/stl_uninitialized.h (uninitialized_copy)
(uninitialized_fill, uninitialized_fill_n): Add static assertions to
diagnose invalid uses.
* testsuite/20_util/specialized_algorithms/uninitialized_copy/1.cc:
Adjust expected error.
* testsuite/20_util/specialized_algorithms/uninitialized_copy/89164.cc:
New test.
* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
89164.cc: New test.
* testsuite/20_util/specialized_algorithms/uninitialized_fill/89164.cc:
New test.
* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
89164.cc: New test.
* testsuite/23_containers/vector/cons/89164.cc: New test.
* testsuite/23_containers/vector/cons/89164_c++17.cc: New test.

From-SVN: r275177

5 years agogigi.h (gigi_checking_assert): New macro.
Eric Botcazou [Fri, 30 Aug 2019 13:50:34 +0000 (13:50 +0000)]
gigi.h (gigi_checking_assert): New macro.

* gcc-interface/gigi.h (gigi_checking_assert): New macro.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Modular_Integer_Type>:
Remove redundant test and adjust comments.  Minor tweaks.
* gcc-interface/trans.c (Call_to_gnu): Do not generate range checks,
instead assert that the Do_Range_Check flag is not set.  Adjust call
to convert_with_check.
(gnat_to_gnu): Likewise.
(assoc_to_constructor): Likewise.
(pos_to_constructor): Likewise.  Remove GNAT_COMPONENT_TYPE parameter.
(emit_range_check): Delete.
(convert_with_check): Remove RANGE_P parameter and adjust.  Do a single
overflow check for modular types.

From-SVN: r275174

5 years agoarm.md (unaligned_loaddi, [...]): New unspec insn patterns.
Bernd Edlinger [Fri, 30 Aug 2019 10:38:37 +0000 (10:38 +0000)]
arm.md (unaligned_loaddi, [...]): New unspec insn patterns.

2019-08-30  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * config/arm/arm.md (unaligned_loaddi,
        unaligned_storedi): New unspec insn patterns.
        * config/arm/neon.md (unaligned_storev8qi): Likewise.
        * config/arm/arm.c (gen_cpymem_ldrd_strd): Use unaligned_loaddi
        and unaligned_storedi for 4-byte aligned memory.
        (arm_block_set_aligned_vect): Use unaligned_storev8qi for
        4-byte aligned memory.

From-SVN: r275063

5 years ago[PR 91579] Avoid creating redundant PHI nodes in tail-call pass
Martin Jambor [Fri, 30 Aug 2019 08:08:42 +0000 (10:08 +0200)]
[PR 91579] Avoid creating redundant PHI nodes in tail-call pass

2019-08-30  Martin Jambor  <mjambor@suse.cz>

tree-optimization/91579
* tree-tailcall.c (tailr_arg_needs_copy): New variable.
(find_tail_calls): Allocate tailr_arg_needs_copy and set its bits as
appropriate.
(arg_needs_copy_p): Removed.
(eliminate_tail_call): Test tailr_arg_needs_copy instead of calling
arg_needs_copy_p.
(tree_optimize_tail_calls_1): Likewise.  Free tailr_arg_needs_copy.

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

From-SVN: r275062

5 years agoDaily bump.
GCC Administrator [Fri, 30 Aug 2019 00:16:23 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r275059

5 years ago* config/i386/i386-features.c
Uros Bizjak [Thu, 29 Aug 2019 19:47:19 +0000 (21:47 +0200)]
* config/i386/i386-features.c
(general_scalar_chain::compute_convert_gain):
Correct cost for double-word shifts.
(general_scalar_to_vector_candidate_p): Reject count operands
greater or equal to mode bitsize.

From-SVN: r275055

5 years agoi386.c (inline_secondary_memory_needed): Return true for moves between SSE and non...
Uros Bizjak [Thu, 29 Aug 2019 18:15:13 +0000 (20:15 +0200)]
i386.c (inline_secondary_memory_needed): Return true for moves between SSE and non-general registers and between mask...

* config/i386/i386.c (inline_secondary_memory_needed): Return true
for moves between SSE and non-general registers and between
mask and non-general registers.
(ix86_register_move_cost): Remove stalled comment.

From-SVN: r275050

5 years ago* ChangeLog: Fix wrong ChangeLog of my last entry.
Uros Bizjak [Thu, 29 Aug 2019 18:09:50 +0000 (20:09 +0200)]
* ChangeLog: Fix wrong ChangeLog of my last entry.

From-SVN: r275049

5 years ago[preprocessor] Include stacking
Nathan Sidwell [Thu, 29 Aug 2019 14:06:32 +0000 (14:06 +0000)]
[preprocessor] Include stacking

https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01971.html
* internal.h (enum include_type): Add IT_MAIN, IT_DIRECTIVE_HWM,
IT_HEADER_HWM.
(_cpp_stack_file): Take include_type, not a bool.
* files.c (_cpp_find_file): Refactor to not hide an if inside a
for conditional.
(should_stack_file): Break apart to ...
(is_known_idempotent_file, has_unique_contents): ... these.
(_cpp_stack_file): Replace IMPORT boolean with include_type enum.
Refactor to use new predicates.  Do linemap compensation here ...
(_cpp_stack_include): ... not here.
* init.c (cpp_read_main_file): Pass IT_MAIN to _cpp_stack_file.

From-SVN: r275034

5 years agoPR libstdc++/91067 add more missing exports for directory iterators
Jonathan Wakely [Thu, 29 Aug 2019 12:16:27 +0000 (13:16 +0100)]
PR libstdc++/91067 add more missing exports for directory iterators

PR libstdc++/91067
* acinclude.m4 (libtool_VERSION): Bump to 6:28:0.
* configure: Regenerate.
* config/abi/pre/gnu.ver (GLIBCXX_3.4.28): Add new version. Export
missing symbols.
* testsuite/27_io/filesystem/iterators/91067.cc: Test move
constructors.
* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r275032

5 years agoi386-features.c (general_scalar_chain::convert_insn): Guard debug work with MAY_HAVE_...
Richard Biener [Thu, 29 Aug 2019 11:59:41 +0000 (11:59 +0000)]
i386-features.c (general_scalar_chain::convert_insn): Guard debug work with MAY_HAVE_DEBUG_BIND_INSNS.

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

* config/i386/i386-features.c (general_scalar_chain::convert_insn):
Guard debug work with MAY_HAVE_DEBUG_BIND_INSNS.

From-SVN: r275031

5 years agore PR bootstrap/91580 (i686-{darwin, linux} bootstrap fails after r274926)
Richard Biener [Thu, 29 Aug 2019 10:30:48 +0000 (10:30 +0000)]
re PR bootstrap/91580 (i686-{darwin, linux} bootstrap fails after r274926)

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

PR bootstrap/91580
* config/i386/i386-features.c (general_scalar_chain::convert_insn):
Do not emit scalar copies for debug-insns, instead replace
their uses with the reg copy used in the chain or reset them
if there is a reaching definition outside of the chain as well.

From-SVN: r275030

5 years agobaseline_symbols.txt: Update.
Jakub Jelinek [Thu, 29 Aug 2019 10:25:13 +0000 (12:25 +0200)]
baseline_symbols.txt: Update.

* config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275028

5 years agore PR target/91560 (Try harder for AVX non-AVX2 cross-lane permutations)
Jakub Jelinek [Thu, 29 Aug 2019 09:22:57 +0000 (11:22 +0200)]
re PR target/91560 (Try harder for AVX non-AVX2 cross-lane permutations)

PR target/91560
* config/i386/i386-expand.c (expand_vec_perm_movs,
expand_vec_perm_blend, expand_vec_perm_vpermil,
expand_vec_perm_pshufb, expand_vec_perm_1,
expand_vec_perm_pshuflw_pshufhw, expand_vec_perm_palignr,
expand_vec_perm_interleave2, expand_vec_perm_vpermq_perm_1,
expand_vec_perm_vperm2f128, expand_vec_perm_interleave3,
expand_vec_perm_vperm2f128_vblend, expand_vec_perm_2vperm2f128_vshuf,
expand_vec_perm_even_odd, expand_vec_perm_broadcast): Adjust function
comments - replace ix86_expand_vec_perm_builtin_1 with
ix86_expand_vec_perm_const_1.
(expand_vec_perm2_vperm2f128_vblend): New function.
(ix86_expand_vec_perm_const_1): New forward declaration.  Call
expand_vec_perm2_vperm2f128_vblend as last resort.
(canonicalize_perm): Formatting fix.

* gcc.dg/torture/vshuf-8.inc: Add two further permutations.

From-SVN: r275027

5 years agore PR tree-optimization/91351 (-fstrict-enums generates incorrect code)
Jakub Jelinek [Thu, 29 Aug 2019 09:20:54 +0000 (11:20 +0200)]
re PR tree-optimization/91351 (-fstrict-enums generates incorrect code)

PR tree-optimization/91351
* tree-cfg.c (generate_range_test): Use range_check_type instead of
unsigned_type_for.
* tree-cfgcleanup.c (convert_single_case_switch): Punt if
range_check_type returns NULL.
* tree-switch-conversion.c (switch_conversion::build_one_array):
Use range_check_type instead of unsigned_type_for, don't perform
linear opt if it returns NULL.
(bit_test_cluster::find_bit_tests): Formatting fix.
(bit_test_cluster::emit): Use range_check_type instead of
unsigned_type_for.
(switch_decision_tree::try_switch_expansion): Punt if range_check_type
returns NULL.

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

From-SVN: r275026

5 years agodecl.c (check_var_type): Add location_t parameter and use it.
Paolo Carlini [Thu, 29 Aug 2019 09:01:26 +0000 (09:01 +0000)]
decl.c (check_var_type): Add location_t parameter and use it.

/cp
2019-08-29  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (check_var_type): Add location_t parameter and use it.
(grokdeclarator): Adjust call.
* pt.c (tsubst_decl): Likewise.
* cp-tree.h: Adjust declaration.

/testsuite
2019-08-29  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/spellcheck-typenames.C: Adjust expected locations.
* g++.dg/cpp0x/pr84676.C: Check locations.
* g++.dg/other/pr88187.C: Likewise.
* g++.dg/parse/crash13.C: Likewise.
* g++.dg/parse/crash46.C: Likewise.
* g++.dg/parse/template28.C: Likewise.
* g++.dg/parse/typename4.C: Likewise.

From-SVN: r275025

5 years agore PR tree-optimization/91568 (internal compiler error: in vect_schedule_slp_instance...
Richard Biener [Thu, 29 Aug 2019 08:07:35 +0000 (08:07 +0000)]
re PR tree-optimization/91568 (internal compiler error: in vect_schedule_slp_instance, at tree-vect-slp.c:3922)

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

PR tree-optimization/91568
* tree-vectorizer.h (_slp_tree::max_nunits): Add.
(vect_update_max_nunits): Add overload for poly_uint64.
* tree-vect-slp.c (vect_create_new_slp_node): Initialize it.
(vect_build_slp_tree): Record max_nunits into the subtree
and merge it upwards.
(vect_print_slp_tree): Print max_nunits.

* gfortran.dg/pr91568.f: New testcase.

From-SVN: r275023

5 years agoImplement P1152R4: Deprecating some uses of volatile.
Marek Polacek [Thu, 29 Aug 2019 03:11:50 +0000 (03:11 +0000)]
Implement P1152R4: Deprecating some uses of volatile.

PR c++/91361
* c-opts.c (c_common_post_options): Enable -Wvolatile by
default for C++2a, unless -Wno-deprecated.
* c.opt (Wvolatile): New warning.

* cp-gimplify.c (cp_fold): Set TREE_THIS_VOLATILE.
* decl.c (grokdeclarator): Warn about a volatile-qualified structured
binding and return type.
(grokparms): Warn about a volatile-qualified function parameter.
* expr.c (mark_use) <case MODIFY_EXPR>: Emit a -Wvolatile warning.
* typeck.c (cp_build_unary_op): Emit a -Wvolatile warning for pre and
post ++/-- on a volatile operand.
(genericize_compound_lvalue): Use a better location.  Don't lose
TREE_THIS_VOLATILE.
(cp_build_modify_expr): Emit a -Wvolatile warning for a compound
assignment whose LHS is volatile-qualified.  Build the assignment with
a more precise location.

* doc/invoke.texi: Document -Wvolatile.

* c-c++-common/Wbool-operation-1.c: Use -Wno-volatile in C++.
* c-c++-common/gomp/atomic-1.c: Likewise.
* c-c++-common/gomp/atomic-9.c: Likewise.
* c-c++-common/gomp/depend-iterator-1.c: Likewise.
* c-c++-common/gomp/loop-1.c: Adjust warning location for C++.
* c-c++-common/gomp/order-3.c: Likewise.
* c-c++-common/pr69733.c: Use -Wno-volatile in C++.
* c-c++-common/spec-barrier-2.c: Likewise.
* c-c++-common/tm/pr54893.c: Likewise.
* g++.dg/cpp0x/pr65327.C: Add dg-warning.
* g++.dg/cpp0x/rv-conv2.C: Likewise.
* g++.dg/cpp0x/rv1n.C: Likewise.
* g++.dg/cpp0x/rv1p.C: Likewise.
* g++.dg/cpp0x/rv2n.C: Likewise.
* g++.dg/cpp0x/rv2p.C: Likewise.
* g++.dg/cpp0x/rv3n.C: Likewise.
* g++.dg/cpp0x/rv3p.C: Likewise.
* g++.dg/cpp0x/rv4n.C: Likewise.
* g++.dg/cpp0x/rv4p.C: Likewise.
* g++.dg/cpp0x/rv5n.C: Likewise.
* g++.dg/cpp0x/rv5p.C: Likewise.
* g++.dg/cpp0x/rv6n.C: Likewise.
* g++.dg/cpp0x/rv6p.C: Likewise.
* g++.dg/cpp0x/rv7n.C: Likewise.
* g++.dg/cpp0x/rv7p.C: Likewise.
* g++.dg/cpp0x/rv8p.C: Likewise.
* g++.dg/cpp0x/trailing14.C: Use -Wno-volatile.
* g++.dg/cpp1y/new1.C: Add dg-warning.
* g++.dg/cpp2a/volatile1.C: New test.
* g++.dg/cpp2a/volatile2.C: New test.
* g++.dg/cpp2a/volatile3.C: New test.
* g++.dg/cpp2a/volatile4.C: New test.
* g++.dg/expr/bool3.C: Add dg-warning.
* g++.dg/expr/bool4.C: Likewise.
* g++.dg/expr/cond9.C: Likewise.
* g++.dg/ext/vector25.C: Likewise.
* g++.dg/gomp/depend-iterator-1.C: Use -Wno-volatile.
* g++.dg/inherit/covariant21.C: Add dg-warning.
* g++.dg/init/ref18.C: Likewise.
* g++.dg/ipa/pr63838.C: Likewise.
* g++.dg/overload/rvalue2.C: Likewise.
* g++.dg/parse/semicolon4.C: Likewise.
* g++.dg/warn/Wreturn-type-4.C: Likewise.
* g++.dg/warn/pr36069.C: Likewise.
* g++.old-deja/g++.mike/p9506.C: Likewise.
* g++.old-deja/g++.other/volatile1.C: Likewise.

From-SVN: r275022

5 years agoDaily bump.
GCC Administrator [Thu, 29 Aug 2019 00:16:24 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r275021

5 years ago* es.po: Update.
Joseph Myers [Wed, 28 Aug 2019 21:40:43 +0000 (22:40 +0100)]
* es.po: Update.

From-SVN: r275012

5 years agoUpdate ABI baselines for x86 and powerpc GNU targets
Jonathan Wakely [Wed, 28 Aug 2019 21:14:58 +0000 (22:14 +0100)]
Update ABI baselines for x86 and powerpc GNU targets

* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt: Update.
* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Update.

From-SVN: r275011

5 years agoruntime: move osinit to Go
Ian Lance Taylor [Wed, 28 Aug 2019 20:39:32 +0000 (20:39 +0000)]
runtime: move osinit to Go

    This is a step toward updating libgo to 1.13.  This adds the 1.13
    version of the osinit function to Go code, and removes the
    corresponding code from the C runtime.  This should simplify future updates.
    Some additional 1.13 code was brought in to simplify this change.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191717

From-SVN: r275010

5 years agore PR fortran/91551 (ICE in sort_actual, at fortran/intrinsic.c:4193)
Steven G. Kargl [Wed, 28 Aug 2019 20:36:00 +0000 (20:36 +0000)]
re PR fortran/91551 (ICE in sort_actual, at fortran/intrinsic.c:4193)

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91551
* intrinsic.c (sort_actual): ALLOCATED has one argument. Check for
no argument case.

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91551
* gfortran.dg/allocated_3.f90

From-SVN: r275009

5 years agoPR c++/91360 - Implement C++20 P1143R2: constinit.
Marek Polacek [Wed, 28 Aug 2019 20:31:31 +0000 (20:31 +0000)]
PR c++/91360 - Implement C++20 P1143R2: constinit.

* c-common.c (c_common_reswords): Add constinit and __constinit.
(keyword_is_decl_specifier): Handle RID_CONSTINIT.
* c-common.h (enum rid): Add RID_CONSTINIT, RID_FIRST_CXX20, and
RID_LAST_CXX20.
(D_CXX20): Define.
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_constinit.
* c-format.c (cxx_keywords): Add "constinit".
* c.opt (Wc++2a-compat, Wc++20-compat): New options.

* cp-tree.h (TINFO_VAR_DECLARED_CONSTINIT): Define.
(LOOKUP_CONSTINIT): Define.
(enum cp_decl_spec): Add ds_constinit.
* decl.c (check_tag_decl): Give an error for constinit in type
declarations.
(check_initializer): Also check LOOKUP_CONSTINIT.
(cp_finish_decl): Add checking for a constinit declaration.  Set
TINFO_VAR_DECLARED_CONSTINIT.
(grokdeclarator): Add checking for a declaration with the constinit
specifier.
* lex.c (init_reswords): Handle D_CXX20.
* parser.c (cp_lexer_get_preprocessor_token): Pass a better location
to warning_at.  Warn about C++20 keywords.
(cp_keyword_starts_decl_specifier_p): Handle RID_CONSTINIT.
(cp_parser_diagnose_invalid_type_name): Add an inform about constinit.
(cp_parser_decomposition_declaration): Maybe pass LOOKUP_CONSTINIT to
cp_finish_decl.
(cp_parser_decl_specifier_seq): Handle RID_CONSTINIT.
(cp_parser_init_declarator): Maybe pass LOOKUP_CONSTINIT to
cp_finish_decl.
(set_and_check_decl_spec_loc): Add "constinit".
* pt.c (tsubst_decl): Set TINFO_VAR_DECLARED_CONSTINIT.
(instantiate_decl): Maybe pass LOOKUP_CONSTINIT to cp_finish_decl.
* typeck2.c (store_init_value): If a constinit variable wasn't
initialized using a constant initializer, give an error.

* doc/invoke.texi: Document -Wc++20-compat.

* g++.dg/cpp2a/constinit1.C: New test.
* g++.dg/cpp2a/constinit2.C: New test.
* g++.dg/cpp2a/constinit3.C: New test.
* g++.dg/cpp2a/constinit4.C: New test.
* g++.dg/cpp2a/constinit5.C: New test.
* g++.dg/cpp2a/constinit6.C: New test.
* g++.dg/cpp2a/constinit7.C: New test.
* g++.dg/cpp2a/constinit8.C: New test.
* g++.dg/cpp2a/constinit9.C: New test.
* g++.dg/cpp2a/constinit10.C: New test.
* g++.dg/cpp2a/constinit11.C: New test.
* g++.dg/cpp2a/constinit12.C: New test.

From-SVN: r275008

5 years agore PR fortran/91565 (ICE in gfc_simplify_reshape, at fortran/simplify.c:6707 etc.)
Steven G. Kargl [Wed, 28 Aug 2019 20:16:57 +0000 (20:16 +0000)]
re PR fortran/91565 (ICE in gfc_simplify_reshape, at fortran/simplify.c:6707 etc.)

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91565
* simplify.c (gfc_simplify_reshape): Add additional checks of the
ORDER dummy argument.

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91565
* gfortran.dg/pr91565.f90: New test.

From-SVN: r275007

5 years agore PR fortran/91564 (ICE in gimplify_expr, at gimplify.c:14147)
Steven G. Kargl [Wed, 28 Aug 2019 19:54:23 +0000 (19:54 +0000)]
re PR fortran/91564 (ICE in gimplify_expr, at gimplify.c:14147)

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91564
* check.c (gfc_check_kill_sub): Additional checks on status dummy
argument.

2019-08-28  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/91564
* gfortran.dg/pr91564.f90: New test.

From-SVN: r275005

5 years agoAdd .clangd and compile_commands.json to .gitignore.
Martin Liska [Wed, 28 Aug 2019 19:33:28 +0000 (21:33 +0200)]
Add .clangd and compile_commands.json to .gitignore.

2019-08-28  Martin Liska  <mliska@suse.cz>

* .gitignore: Add .clangd and compile_commands.json
to .gitignore.

From-SVN: r275004

5 years agocompiler: handle unsafe conversion expression in escape analysis
Ian Lance Taylor [Wed, 28 Aug 2019 18:45:45 +0000 (18:45 +0000)]
compiler: handle unsafe conversion expression in escape analysis

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/192037

From-SVN: r275000

5 years ago[Preprocessor] small cleanups
Nathan Sidwell [Wed, 28 Aug 2019 18:43:37 +0000 (18:43 +0000)]
[Preprocessor] small cleanups

https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01904.html
* directives-only.c (_cpp_preprocess_dir_only): Use false, not
zero for _cpp_handle_directive call.
* directives.c (_cpp_handle_directive): Indented is bool.
* files.c (struct _cpp_file): Make bools 1 bit bitfields.
* internal.h (enum include_type): Reformat and comment.
(struct cpp_buffer): Make flags 1 bit bitfields.
(_cpp_handle_directive): Indented is bool.

From-SVN: r274999

5 years agocompiler, runtime: provide index information on bounds check failure
Ian Lance Taylor [Wed, 28 Aug 2019 18:27:30 +0000 (18:27 +0000)]
compiler, runtime: provide index information on bounds check failure

    This implements https://golang.org/cl/161477 in the gofrontend.

    Updates golang/go#30116

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191881

From-SVN: r274998

5 years agoPR tree-optimization/91457 - inconsistent warning for writing past the end of an...
Martin Sebor [Wed, 28 Aug 2019 16:43:56 +0000 (16:43 +0000)]
PR tree-optimization/91457 - inconsistent warning for writing past the end of an array member

gcc/ChangeLog:

PR tree-optimization/91457
* builtins.c (component_size): New function.
(compute_objsize): Add argument. Handle ARRAY_REF and COMPONENT_REF.
* builtins.h (compute_objsize): Add argument.
* tree-ssa-strlen.c (handle_store): Handle no-warning bit.
* tree-vrp.c (vrp_prop::check_array_ref): Return warning result.
(vrp_prop::check_mem_ref): Same.
(vrp_prop::search_for_addr_array): Set no-warning bit.
(check_array_bounds): Same.

gcc/testsuite/ChangeLog:

PR tree-optimization/91457
* c-c++-common/Wstringop-overflow-2.c: New test.
* g++.dg/warn/Warray-bounds-8.C: New test.
* g++.dg/warn/Wstringop-overflow-3.C: New test.
* gcc.dg/Wstringop-overflow-15.c: New test.

From-SVN: r274997

5 years agoPR driver/80545 - option -Wstringop-overflow not recognized by Fortran
Martin Sebor [Wed, 28 Aug 2019 16:24:38 +0000 (16:24 +0000)]
PR driver/80545 - option -Wstringop-overflow not recognized by Fortran

gcc/ChangeLog:

PR driver/80545
* opts-common.c (option_enabled): Correct checking for language
options.

From-SVN: r274996

5 years ago* config/i386/i386-features.c
Uros Bizjak [Wed, 28 Aug 2019 15:09:51 +0000 (17:09 +0200)]
* config/i386/i386-features.c
(general_scalar_chain::compute_convert_gain):
Correct cost for double-word shifts.
(general_scalar_to_vector_candidate_p): Reject count operands
greater or equal to mode bitsize.

From-SVN: r274994

5 years ago[PR 91468] Small fixes in ipa-cp.c and ipa-prop.c
Martin Jambor [Wed, 28 Aug 2019 14:26:45 +0000 (16:26 +0200)]
[PR 91468] Small fixes in ipa-cp.c and ipa-prop.c

2019-08-28  Martin Jambor  <mjambor@suse.cz>

PR ipa/91468
* ipa-cp.c (merge_agg_lats_step): Removed redundant test, made a
checking assert a normal assert to test it really is redundant.
* ipa-prop.c (compute_complex_assign_jump_func): Removed
redundant test.
(update_jump_functions_after_inlining): Removed combining unary
arithmetic operations with an ancestor jump function.
(ipcp_modif_dom_walker::before_dom_children): Fix wrong use of rhs
instead of t.

From-SVN: r274992

5 years ago[PR c++/90613] Fix using-decl debug bloat
Nathan Sidwell [Wed, 28 Aug 2019 13:36:54 +0000 (13:36 +0000)]
[PR c++/90613] Fix using-decl debug bloat

https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01888.html
cp/
PR c++/90613
* name-lookup.c (cp_emit_debug_info): Check for builtins during
overload iteration.

testsuite/
PR c++/90613
* g++.dg/lookup/using61.C: New.

From-SVN: r274991

5 years agoi386-features.c (convert_scalars_to_vector): Do not add the MD problem.
Richard Biener [Wed, 28 Aug 2019 13:26:41 +0000 (13:26 +0000)]
i386-features.c (convert_scalars_to_vector): Do not add the MD problem.

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

* config/i386/i386-features.c (convert_scalars_to_vector): Do not
add the MD problem.

From-SVN: r274990

5 years agoStated standards in documentation
Mark Eggleston [Wed, 28 Aug 2019 10:21:31 +0000 (10:21 +0000)]
Stated standards in documentation

Correct the stated standards in documentation and for intrinsics and
specific intrinsics.  In C_SIZEOF the printed value is T not .TRUE..
In IPARITY example wrap BOZ constants in calls to INT.

From-SVN: r274988

5 years agore PR middle-end/89544 (Argument marshalling incorrectly assumes stack slots are...
Bernd Edlinger [Wed, 28 Aug 2019 10:20:44 +0000 (10:20 +0000)]
re PR middle-end/89544 (Argument marshalling incorrectly assumes stack slots are naturally aligned.)

2019-08-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR middle-end/89544
        * gcc.target/arm/unaligned-argument-3.c: New test.

From-SVN: r274987

5 years agoexpr.c (expand_assignment): Handle misaligned DECLs.
Bernd Edlinger [Wed, 28 Aug 2019 10:18:23 +0000 (10:18 +0000)]
expr.c (expand_assignment): Handle misaligned DECLs.

2019-09-28  Bernd Edlinger  <bernd.edlinger@hotmail.de>
    Richard Biener  <rguenther@suse.de>

* expr.c (expand_assignment): Handle misaligned DECLs.
(expand_expr_real_1): Handle FUNCTION_DECL as unaligned.
* function.c (assign_parm_adjust_stack_rtl): Check movmisalign optab
too.
(assign_parm_setup_stack): Allocate properly aligned stack slots.
* varasm.c (build_constant_desc): Align constants of misaligned types.
* config/arm/predicates.md (aligned_operand): New predicate.
* config/arm/arm.md (movdi, movsi, movhi, movhf, movsf, movdf): Use
aligned_operand to check restrictions on memory addresses.
* config/arm/neon.md (movti, mov<VSTRUCT>, mov<VH>): Likewise.
* config/arm/vec-common.md (mov<VALL>): Likewise.

Co-Authored-By: Richard Biener <rguenther@suse.de>
From-SVN: r274986

5 years agore PR libgomp/91530 (Several libgomp.*/scan-* tests FAIL without avx_runtime)
Jakub Jelinek [Wed, 28 Aug 2019 10:13:21 +0000 (12:13 +0200)]
re PR libgomp/91530 (Several libgomp.*/scan-* tests FAIL without avx_runtime)

PR libgomp/91530
* config/i386/sse.md (vec_shl_<mode>, vec_shr_<mode>): Use
V_128 iterator instead of VI_128.

* testsuite/libgomp.c/scan-21.c: New test.
* testsuite/libgomp.c/scan-22.c: New test.

From-SVN: r274985

5 years agore PR libgomp/91530 (Several libgomp.*/scan-* tests FAIL without avx_runtime)
Jakub Jelinek [Wed, 28 Aug 2019 10:12:11 +0000 (12:12 +0200)]
re PR libgomp/91530 (Several libgomp.*/scan-* tests FAIL without avx_runtime)

PR libgomp/91530
* config/i386/sse.md (vec_shl_<mode>, vec_shr_<mode>): Use
V_128 iterator instead of VI_128.

* testsuite/libgomp.c/scan-21.c: New test.
* testsuite/libgomp.c/scan-22.c: New test.

From-SVN: r274984

5 years agoRemove code leftover that has never been used.
Martin Liska [Wed, 28 Aug 2019 06:39:47 +0000 (08:39 +0200)]
Remove code leftover that has never been used.

2019-08-28  Martin Liska  <mliska@suse.cz>

PR tree-optimization/90970
* builtins.c (check_access): Remove assignment to maxread
as it hasn't been used since when it was introduced in r255755.

From-SVN: r274983

5 years agoPR c++/81676 - bogus -Wunused warnings in constexpr if.
Marek Polacek [Wed, 28 Aug 2019 02:22:29 +0000 (02:22 +0000)]
PR c++/81676 - bogus -Wunused warnings in constexpr if.

* semantics.c (maybe_mark_exp_read_r): New function.
(finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.

* g++.dg/cpp1z/constexpr-if31.C: New test.
* g++.dg/cpp1z/constexpr-if32.C: New test.

From-SVN: r274982

5 years agoPR c++/91428 - warn about std::is_constant_evaluated in if constexpr.
Marek Polacek [Wed, 28 Aug 2019 02:03:48 +0000 (02:03 +0000)]
PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.

* cp-tree.h (decl_in_std_namespace_p): Declare.
* semantics.c (is_std_constant_evaluated_p): New.
(finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()" in
an if-constexpr.
* typeck.c (decl_in_std_namespace_p): No longer static.

* g++.dg/cpp2a/is-constant-evaluated9.C: New test.

From-SVN: r274981

5 years agoDaily bump.
GCC Administrator [Wed, 28 Aug 2019 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r274980

5 years agoPR tree-optimization/91567 - Spurious -Wformat-overflow warnings building glibc ...
Martin Sebor [Tue, 27 Aug 2019 23:31:44 +0000 (23:31 +0000)]
PR tree-optimization/91567 - Spurious -Wformat-overflow warnings building glibc (32-bit only)

gcc/ChangeLog:

PR tree-optimization/91567
* gimple-ssa-sprintf.c (get_string_length): Handle more forms of lengths
of unknown strings.
* vr-values.c (vr_values::extract_range_basic): Set strlen upper bound
to PTRDIFF_MAX - 2.

gcc/testsuite/ChangeLog:

PR tree-optimization/91567
* gcc.dg/tree-ssa/builtin-snprintf-6.c: Xfail a subset of assertions
on targets other than x86_64 to work around PR 83543.
* gcc.dg/tree-ssa/builtin-sprintf-warn-22.c: New test.

From-SVN: r274976

5 years agotree-ssa-strlen.c (printf_strlen_execute): Initialize the loop optimizer and SCEV...
Jeff Law [Tue, 27 Aug 2019 23:03:45 +0000 (17:03 -0600)]
tree-ssa-strlen.c (printf_strlen_execute): Initialize the loop optimizer and SCEV before sizing ssa_ver_to_stridx.

* tree-ssa-strlen.c (printf_strlen_execute): Initialize
the loop optimizer and SCEV before sizing ssa_ver_to_stridx.

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

From-SVN: r274975

5 years agore PR fortran/91496 (!GCC$ directives error if mistyped or unknown)
Harald Anlauf [Tue, 27 Aug 2019 19:16:33 +0000 (19:16 +0000)]
re PR fortran/91496 (!GCC$ directives error if mistyped or unknown)

2019-08-27  Harald Anlauf  <anlauf@gmx.de>

PR fortran/91496
* gfortran.h: Extend struct gfc_iterator for loop annotations.
* array.c (gfc_copy_iterator): Copy loop annotations by IVDEP,
VECTOR, and NOVECTOR pragmas.
* decl.c (gfc_match_gcc_ivdep, gfc_match_gcc_vector)
(gfc_match_gcc_novector): New matcher functions handling IVDEP,
VECTOR, and NOVECTOR pragmas.
* match.h: Declare prototypes of matcher functions handling IVDEP,
VECTOR, and NOVECTOR pragmas.
* parse.c (decode_gcc_attribute, parse_do_block)
(parse_executable): Decode IVDEP, VECTOR, and NOVECTOR pragmas;
emit warning for unrecognized pragmas instead of error.
* trans-stmt.c (gfc_trans_simple_do, gfc_trans_do): Add code to
emit annotations for IVDEP, VECTOR, and NOVECTOR pragmas.
* gfortran.texi: Document IVDEP, VECTOR, and NOVECTOR pragmas.

PR fortran/91496
* gfortran.dg/pr91496.f90: New testcase.

From-SVN: r274966

5 years agosse4_1-round-roundeven-1.c (dg-options): Add -mfpmath=sse.
Uros Bizjak [Tue, 27 Aug 2019 17:37:03 +0000 (19:37 +0200)]
sse4_1-round-roundeven-1.c (dg-options): Add -mfpmath=sse.

* gcc.target/i386/sse4_1-round-roundeven-1.c (dg-options):
Add -mfpmath=sse.
* gcc.target/i386/sse4_1-round-roundeven-2.c (dg-options): Ditto.

From-SVN: r274964

5 years agore PR target/91528 (ICE in ix86_expand_prologue at i386.c:7844 since r274481)
Uros Bizjak [Tue, 27 Aug 2019 17:23:59 +0000 (19:23 +0200)]
re PR target/91528 (ICE in ix86_expand_prologue at i386.c:7844 since r274481)

PR target/91528
* config/i386/i386-features.c (convert_scalars_to_vector):
Update crtl->stack_realign_needed, crtl->stack_realign_tried and
crtl->stack_realign_processed.  Update crtl->drap_reg by calling
targetm.calls.get_drap_rtx.  If drap_rtx is non-null then
Update crtl->args.internal_arg_pointer and call fixup_tail_calls.

testsuite/ChangeLog:

PR target/91528
* gcc.target/i386/pr91528.c: New test.

From-SVN: r274962

5 years agore PR c++/83431 (-Wformat-truncation may incorrectly report truncation)
Martin Sebor [Tue, 27 Aug 2019 16:18:27 +0000 (16:18 +0000)]
re PR c++/83431 (-Wformat-truncation may incorrectly report truncation)

gcc/testsuite/ChangeLog:

PR c++/83431
PR testsuite/91562
* gcc.dg/strlenopt-8.c: Adjust pass/dump name.

From-SVN: r274961

5 years agoOptions documentation fixes.
Mark Eggleston [Tue, 27 Aug 2019 14:46:23 +0000 (14:46 +0000)]
Options documentation fixes.

Ensure that options lists fit cleanly inside the margins of a PDF page.
Reword description of option -ffrontend-loop-interchange so that it fits
cleanly inside the margins of a PDF page. Add options to those enabled
by -fdec.

From-SVN: r274958

5 years agolibgo: rebuild runtime.inc if mkruntimeinc.sh changes
Ian Lance Taylor [Tue, 27 Aug 2019 14:25:04 +0000 (14:25 +0000)]
libgo: rebuild runtime.inc if mkruntimeinc.sh changes

    The Makefile was missing a dependency.

    Also remove runtime.inc.raw in mostlyclean.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191958

From-SVN: r274956

5 years agoShare a prevailing name for remove debug info symbols w/ LTO.
Martin Liska [Tue, 27 Aug 2019 13:36:15 +0000 (15:36 +0200)]
Share a prevailing name for remove debug info symbols w/ LTO.

2019-08-27  Martin Liska  <mliska@suse.cz>

PR lto/91478
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
First find a WEAK HIDDEN symbol in symbol table that will be
preserved.  Later, use the symbol name for all removed symbols.

From-SVN: r274955

5 years ago2019-08-27 Richard Biener <rguenther@suse.de>
Richard Biener [Tue, 27 Aug 2019 12:46:07 +0000 (12:46 +0000)]
2019-08-27  Richard Biener  <rguenther@suse.de>

* config/i386/i386-features.h
(general_scalar_chain::~general_scalar_chain): Add.
(general_scalar_chain::insns_conv): New bitmap.
(general_scalar_chain::n_sse_to_integer): New.
(general_scalar_chain::n_integer_to_sse): Likewise.
(general_scalar_chain::make_vector_copies): Adjust signature.
* config/i386/i386-features.c
(general_scalar_chain::general_scalar_chain): Outline,
initialize new members.
(general_scalar_chain::~general_scalar_chain): New.
(general_scalar_chain::mark_dual_mode_def): Record insns
we need to insert conversions at and count them.
(general_scalar_chain::compute_convert_gain): Account
for conversion instructions at chain boundary.
(general_scalar_chain::make_vector_copies): Generate a single
copy for a def by a specific insn.
(general_scalar_chain::convert_registers): First populate
defs_map, then make copies at out-of chain insns.

From-SVN: r274953

5 years agore PR c++/91415 (Invalid warning for C++17 sequencing of shift operator E1<<E2.)
Jakub Jelinek [Tue, 27 Aug 2019 12:37:30 +0000 (14:37 +0200)]
re PR c++/91415 (Invalid warning for C++17 sequencing of shift operator E1<<E2.)

PR c++/91415
* c-common.c (verify_tree): For LSHIFT_EXPR, RSHIFT_EXPR,
COMPONENT_REF and ARRAY_REF in cxx_dialect >= cxx17 mode handle it
like COMPOUND_EXPR rather than normal expression.

* g++.dg/warn/sequence-pt-4.C: New test.

From-SVN: r274952

5 years agore PR testsuite/91549 (gcc.dg/wrapped-binop-simplify.c fails starting with r274925)
Robin Dapp [Tue, 27 Aug 2019 12:08:58 +0000 (12:08 +0000)]
re PR testsuite/91549 (gcc.dg/wrapped-binop-simplify.c fails starting with r274925)

PR testsuite/91549

gcc/testsuite/ChangeLog:
* gcc.dg/wrapped-binop-simplify.c: Test only on x86, s390 with lp64.

From-SVN: r274951

5 years agore PR libgomp/91530 (Several libgomp.*/scan-* tests FAIL without avx_runtime)
Jakub Jelinek [Tue, 27 Aug 2019 10:45:55 +0000 (12:45 +0200)]
re PR libgomp/91530 (Several libgomp.*/scan-* tests FAIL without avx_runtime)

PR libgomp/91530
* testsuite/libgomp.c/scan-11.c: Add -msse2 option for sse2_runtime
targets.
* testsuite/libgomp.c/scan-12.c: Likewise.
* testsuite/libgomp.c/scan-13.c: Likewise.
* testsuite/libgomp.c/scan-14.c: Likewise.
* testsuite/libgomp.c/scan-15.c: Likewise.
* testsuite/libgomp.c/scan-16.c: Likewise.
* testsuite/libgomp.c/scan-17.c: Likewise.
* testsuite/libgomp.c/scan-18.c: Likewise.
* testsuite/libgomp.c/scan-19.c: Likewise.
* testsuite/libgomp.c/scan-20.c: Likewise.
* testsuite/libgomp.c++/scan-9.C: Likewise.
* testsuite/libgomp.c++/scan-10.C: Likewise.
* testsuite/libgomp.c++/scan-11.C: Likewise.
* testsuite/libgomp.c++/scan-12.C: Likewise.
* testsuite/libgomp.c++/scan-14.C: Likewise.
* testsuite/libgomp.c++/scan-15.C: Likewise.
* testsuite/libgomp.c++/scan-13.C: Likewise.  Use sse2_runtime
instead of i?86-*-* x86_64-*-* as target for scan-tree-dump-times.
* testsuite/libgomp.c++/scan-16.C: Likewise.

From-SVN: r274947

5 years ago[arm/aarch64] Add comments warning that stack-protector initializer insns shouldn...
Richard Earnshaw [Tue, 27 Aug 2019 10:05:51 +0000 (10:05 +0000)]
[arm/aarch64] Add comments warning that stack-protector initializer insns shouldn't be split

Following the publication of https://kb.cert.org/vuls/id/129209/ I've
been having a look at GCC's implementation for Arm and AArch64.  I
haven't identified any issues yet, but it's a bit early to be
completely sure.

One observation, however, is that the instruction sequence that
initializes the stack canary might be vulnerable to producing a
reusable value if it were ever split early.  I don't think we ever
would, because the memory locations involved with the stack protector
are all marked volatile to ensure that the values are only loaded at
the point in time when the test is intended to happen, and that also
has the effect of making it unlikely that the value would be reused
without reloading.  Nevertheless, defence in depth is probably
warranted here.

So this patch just adds some comments warning that the patterns should
not be split.

* config/arm/arm.md (stack_protect_set_insn): Add security-related
comment.
* config/aarch64/aarch64.md (stack_protect_set_<mode>): Likewise.

From-SVN: r274946

5 years agoFix new clang warnings.
Martin Liska [Tue, 27 Aug 2019 07:39:34 +0000 (09:39 +0200)]
Fix new clang warnings.

2019-08-27  Martin Liska  <mliska@suse.cz>

* cgraph.c (cgraph_node::remove): Remove dead assignment before
loop.
* config/i386/i386-features.c (scalar_chain::emit_conversion_insns):
Enclose in anonymous namespace.
* config/i386/x86-tune-costs.h (struct processor_costs): Wrap
hard_register initialization in braces.
* tree-vrp.h (value_range_base::supports_type_p): Return false
for function with boolean return type.

From-SVN: r274945

5 years agoDaily bump.
GCC Administrator [Tue, 27 Aug 2019 00:16:37 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r274944

5 years agore PR fortran/91390 (treatment of extra parameter in a subroutine call)
Thomas Koenig [Mon, 26 Aug 2019 20:05:32 +0000 (20:05 +0000)]
re PR fortran/91390 (treatment of extra parameter in a subroutine call)

2019-08-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/91390
PR fortran/91473
* frontend-passes.c (gfc_check_externals): Make
gfc_errors_to_warnings conditional on -fallow-argument-mismatch.
* invoke.texi: Document -fallow-argument-mismatch.
* lang.opt: Add -fallow-argument-mismatch.

2019-08-26  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/91390
PR fortran/91473
* gfortran.dg/used_before_typed_4.f90: Change warning to error.
* gfortran.dg/argument_checking_20.f90: New test.

From-SVN: r274937

5 years agocompiler: generalize cleanup of unresolved placeholder pointer types
Ian Lance Taylor [Mon, 26 Aug 2019 19:55:41 +0000 (19:55 +0000)]
compiler: generalize cleanup of unresolved placeholder pointer types

    This change extends the work in https://golang.org/cl/51131 to include
    placeholder pointer types created for Go function types, which can
    also be left dangling/unresolved in some instances. This fixes an
    assert in Llvm_backend::materializeComposite.

    Test case can be found in https://golang.org/cl/191743.

    Updates golang/go#33020.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191744

From-SVN: r274935

5 years agoi386.c (emit_i387_cw_initialization): Fix masking operand value.
Uros Bizjak [Mon, 26 Aug 2019 19:18:30 +0000 (21:18 +0200)]
i386.c (emit_i387_cw_initialization): Fix masking operand value.

* config/i386/i386.c (emit_i387_cw_initialization)
<case I387_CW_ROUNDEVEN>: Fix masking operand value.

From-SVN: r274934

5 years agoPR tree-optimization/83431 - -Wformat-truncation may incorrectly report truncation
Martin Sebor [Mon, 26 Aug 2019 18:29:45 +0000 (18:29 +0000)]
PR tree-optimization/83431 - -Wformat-truncation may incorrectly report truncation

gcc/ChangeLog:

PR c++/83431
* gimple-ssa-sprintf.c (pass_data_sprintf_length): Remove object.
(sprintf_dom_walker): Remove class.
(get_int_range): Make argument const.
(directive::fmtfunc, directive::set_precision): Same.
(format_none): Same.
(build_intmax_type_nodes): Same.
(adjust_range_for_overflow): Same.
(format_floating): Same.
(format_character): Same.
(format_string): Same.
(format_plain): Same.
(get_int_range): Cast away constness.
(format_integer): Same.
(get_string_length): Call get_range_strlen_dynamic.  Handle
null lendata.maxbound.
(should_warn_p): Adjust argument scope qualifier.
(maybe_warn): Same.
(format_directive): Same.
(parse_directive): Same.
(is_call_safe): Same.
(try_substitute_return_value): Same.
(sprintf_dom_walker::handle_printf_call): Rename...
(handle_printf_call): ...to this.  Initialize target to host charmap
here instead of in pass_sprintf_length::execute.
(struct call_info): Make global.
(sprintf_dom_walker::compute_format_length): Make global.
(sprintf_dom_walker::handle_gimple_call): Same.
* passes.def (pass_sprintf_length): Replace with pass_strlen.
* print-rtl.c (print_pattern): Reduce the number of spaces to
avoid -Wformat-truncation.
* tree-pass.h (make_pass_warn_printf): New function.
* tree-ssa-strlen.c (strlen_optimize): New variable.
(get_string_length): Add comments.
(get_range_strlen_dynamic): New function.
(check_and_optimize_call): New function.
(handle_integral_assign): New function.
(strlen_check_and_optimize_stmt): Factor code out into
strlen_check_and_optimize_call and handle_integral_assign.
(strlen_dom_walker::evrp): New member.
(strlen_dom_walker::before_dom_children): Use evrp member.
(strlen_dom_walker::after_dom_children): Use evrp member.
(printf_strlen_execute): New function.
(pass_strlen::gate): Update to handle printf calls.
(dump_strlen_info): New function.
(pass_data_warn_printf): New variable.
(pass_warn_printf): New class.
* tree-ssa-strlen.h (get_range_strlen_dynamic): Declare.
(handle_printf_call): Same.
* tree-vrp.c (value_range_base::type): Adjust assertion.
* vr-values.c (vr_values::update_value_range): Use type of the first
argument rather than the second.

gcc/testsuite/ChangeLog:

PR c++/83431
* gcc.dg/strlenopt-63.c: New test.
* gcc.dg/pr79538.c: Adjust text of expected warning.
* gcc.dg/pr81292-1.c: Adjust pass name.
* gcc.dg/pr81292-2.c: Same.
* gcc.dg/pr81703.c: Same.
* gcc.dg/strcmpopt_2.c: Same.
* gcc.dg/strcmpopt_3.c: Same.
* gcc.dg/strcmpopt_4.c: Same.
* gcc.dg/strlenopt-1.c: Same.
* gcc.dg/strlenopt-10.c: Same.
* gcc.dg/strlenopt-11.c: Same.
* gcc.dg/strlenopt-13.c: Same.
* gcc.dg/strlenopt-14g.c: Same.
* gcc.dg/strlenopt-14gf.c: Same.
* gcc.dg/strlenopt-15.c: Same.
* gcc.dg/strlenopt-16g.c: Same.
* gcc.dg/strlenopt-17g.c: Same.
* gcc.dg/strlenopt-18g.c: Same.
* gcc.dg/strlenopt-19.c: Same.
* gcc.dg/strlenopt-1f.c: Same.
* gcc.dg/strlenopt-2.c: Same.
* gcc.dg/strlenopt-20.c: Same.
* gcc.dg/strlenopt-21.c: Same.
* gcc.dg/strlenopt-22.c: Same.
* gcc.dg/strlenopt-22g.c: Same.
* gcc.dg/strlenopt-24.c: Same.
* gcc.dg/strlenopt-25.c: Same.
* gcc.dg/strlenopt-26.c: Same.
* gcc.dg/strlenopt-27.c: Same.
* gcc.dg/strlenopt-28.c: Same.
* gcc.dg/strlenopt-29.c: Same.
* gcc.dg/strlenopt-2f.c: Same.
* gcc.dg/strlenopt-3.c: Same.
* gcc.dg/strlenopt-30.c: Same.
* gcc.dg/strlenopt-31g.c: Same.
* gcc.dg/strlenopt-32.c: Same.
* gcc.dg/strlenopt-33.c: Same.
* gcc.dg/strlenopt-33g.c: Same.
* gcc.dg/strlenopt-34.c: Same.
* gcc.dg/strlenopt-35.c: Same.
* gcc.dg/strlenopt-4.c: Same.
* gcc.dg/strlenopt-48.c: Same.
* gcc.dg/strlenopt-49.c: Same.
* gcc.dg/strlenopt-4g.c: Same.
* gcc.dg/strlenopt-4gf.c: Same.
* gcc.dg/strlenopt-5.c: Same.
* gcc.dg/strlenopt-50.c: Same.
* gcc.dg/strlenopt-51.c: Same.
* gcc.dg/strlenopt-52.c: Same.
* gcc.dg/strlenopt-53.c: Same.
* gcc.dg/strlenopt-54.c: Same.
* gcc.dg/strlenopt-55.c: Same.
* gcc.dg/strlenopt-56.c: Same.
* gcc.dg/strlenopt-6.c: Same.
* gcc.dg/strlenopt-61.c: Same.
* gcc.dg/strlenopt-7.c: Same.
* gcc.dg/strlenopt-8.c: Same.
* gcc.dg/strlenopt-9.c: Same.
* gcc.dg/strlenopt.h (snprintf, snprintf): Declare.
* gcc.dg/tree-ssa/builtin-snprintf-6.c: New test.
* gcc.dg/tree-ssa/builtin-snprintf-7.c: New test.
* gcc.dg/tree-ssa/builtin-snprintf-8.c: New test.
* gcc.dg/tree-ssa/builtin-snprintf-9.c: New test.
* gcc.dg/tree-ssa/builtin-sprintf-warn-21.c: New test.
* gcc.dg/tree-ssa/dump-4.c: New test.
* gcc.dg/tree-ssa/pr83501.c: Adjust pass name.

From-SVN: r274933

5 years ago* decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.
Jason Merrill [Mon, 26 Aug 2019 18:03:26 +0000 (14:03 -0400)]
* decl.c (duplicate_decls): Always merge DECL_DECLARED_CONSTEXPR_P.

From-SVN: r274932

5 years ago* ChangeLog: Fix roundeven entry.
Uros Bizjak [Mon, 26 Aug 2019 15:29:28 +0000 (17:29 +0200)]
* ChangeLog: Fix roundeven entry.

From-SVN: r274931

5 years agoPR c++/91545 - ICE in constexpr store evaluation.
Marek Polacek [Mon, 26 Aug 2019 14:39:08 +0000 (14:39 +0000)]
PR c++/91545 - ICE in constexpr store evaluation.

* constexpr.c (cxx_eval_store_expression): Check FIELD_DECL instead
of DECL_P.

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

From-SVN: r274930

5 years agoi386-features.c (general_remove_non_convertible_regs): Remove.
Richard Biener [Mon, 26 Aug 2019 13:55:46 +0000 (13:55 +0000)]
i386-features.c (general_remove_non_convertible_regs): Remove.

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

* config/i386/i386-features.c (general_remove_non_convertible_regs):
Remove.
(convert_scalars_to_vector): Do not call it.

From-SVN: r274929

5 years agoi386: Roundeven expansion for SSE4.1+
Tejas Joshi [Mon, 26 Aug 2019 12:41:59 +0000 (12:41 +0000)]
i386: Roundeven expansion for SSE4.1+

gcc/ChangeLog:

2019-08-26  Tejas Joshi  <tejasjoshi9673@gmail.com>
            Uros Bizjak  <ubizjak@gmail.com>

* builtins.c (mathfn_built_in_2): Change CASE_MATHFN to
CASE_MATHFN_FLOATN for roundeven.
* config/i386/i386.c (ix86_i387_mode_needed): Add case
I387_ROUNDEVEN.
(ix86_mode_needed): Likewise.
(ix86_mode_after): Likewise.
(ix86_mode_entry): Likewise.
(ix86_mode_exit): Likewise.
(ix86_emit_mode_set): Likewise.
(emit_i387_cw_initialization): Add case I387_CW_ROUNDEVEN.
* config/i386/i386.h (ix86_stack_slot): Add SLOT_CW_ROUNDEVEN.
(ix86_entry): Add I387_ROUNDEVEN.
(avx_u128_state): Add I387_CW_ANY.
* config/i386/i386.md: Define UNSPEC_FRNDINT_ROUNDEVEN.
(define_int_iterator): Likewise.
(define_int_attr): Likewise for rounding_insn, rounding and ROUNDING.
(define_constant): Define ROUND_ROUNDEVEN mode.
(define_attr): Add roundeven mode for i387_cw.
(<rouding_insn><mode>2): Add condition for ROUND_ROUNDEVEN.
* internal-fn.def (ROUNDEVEN): New builtin function.
* optabs.def (roundeven_optab): New optab.

gcc/testsuite/ChangeLog:

2019-08-26  Tejas Joshi  <tejasjoshi9673@gmail.com>

* gcc.target/i386/sse4_1-round-roundeven-1.c: New test.
* gcc.target/i386/sse4_1-round-roundeven-2.c: New test.

Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>
From-SVN: r274928

5 years agoBuiltin function roundeven folding implementation
Tejas Joshi [Mon, 26 Aug 2019 12:32:29 +0000 (12:32 +0000)]
Builtin function roundeven folding implementation

2019-08-26  Tejas Joshi  <tejasjoshi9673@gmail.com>

        * builtins.c (mathfn_built_in_2): Added CASE_MATHFN_FLOATN
        for ROUNDEVEN.
        * builtins.def: Added function definitions for roundeven function
        variants.
        * fold-const-call.c (fold_const_call_ss): Added case for roundeven
        function call.  Adjust condition for floor, ceil, trunc and round.
        * fold-const.c (negate_mathfn_p): Added case for roundeven function.
        (tree_call_nonnegative_warnv_p): Added case for roundeven function.
        (integer_valued_real_call_p): Added case for roundeven function.
        * real.c (is_even): New function. Returns true if real number is even,
        otherwise returns false.
        (is_halfway_below): New function. Returns true if real number is
        halfway between two integers, else return false.
        (real_roundeven): New function. Round real number to nearest integer,
        rounding halfway cases towards even.
        * real.h (real_value): Added descriptive comments.  Added function
        declaration for roundeven function.
        * doc/extend.texi (Other Builtins): List roundeven variants among
        functions which can be handled as builtins.

gcc/testsuite/ChangeLog:

2019-08-26  Tejas Joshi  <tejasjoshi9673@gmail.com>

        * gcc.dg/torture/builtin-round-roundeven.c: New test.
        * gcc.dg/torture/builtin-round-roundevenf128.c: New test.

From-SVN: r274927

5 years agore PR target/91522 (STV is slow)
Richard Biener [Mon, 26 Aug 2019 10:35:59 +0000 (10:35 +0000)]
re PR target/91522 (STV is slow)

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

PR target/91522
PR target/91527
* config/i386/i386-features.h (general_scalar_chain::defs_map):
New member.
(general_scalar_chain::replace_with_subreg): Remove.
(general_scalar_chain::replace_with_subreg_in_insn): Likewise.
(general_scalar_chain::convert_reg): Adjust signature.
* config/i386/i386-features.c (scalar_chain::add_insn): Do not
iterate over all defs of a reg.
(general_scalar_chain::replace_with_subreg): Remove.
(general_scalar_chain::replace_with_subreg_in_insn): Likewise.
(general_scalar_chain::make_vector_copies): Populate defs_map,
place copy only after defs that are used as vectors in the chain.
(general_scalar_chain::convert_reg): Emit a copy for a specific
def in a specific instruction.
(general_scalar_chain::convert_op): All reg uses are converted here.
(general_scalar_chain::convert_insn): Emit copies for scalar
uses of defs here.  Replace uses with the copies we created.
Replace and convert the def.  Adjust REG_DEAD notes, remove
REG_EQUIV/EQUAL notes.
(general_scalar_chain::convert_registers): Only handle copies
into the chain here.

From-SVN: r274926

5 years ago[PATCH 2/2] Add simplify rule for wrapped addition.
Robin Dapp [Mon, 26 Aug 2019 10:24:44 +0000 (10:24 +0000)]
[PATCH 2/2] Add simplify rule for wrapped addition.

Add the transform (T)(A) + CST -> (T)(A + CST).  This enables vrp to
simplify sequences like

_2 = a_7 - 1;
_3 = (long unsigned int) _2;
_5 = _3 + 1

that ivopts creates.

--

gcc/ChangeLog:

2019-08-26  Robin Dapp  <rdapp@linux.ibm.com>

        * match.pd: Add (T)(A) + CST -> (T)(A + CST).

gcc/testsuite/ChangeLog:

2019-08-26  Robin Dapp  <rdapp@linux.ibm.com>

        * gcc.dg/tree-ssa/copy-headers-5.c: Do not run vrp pass.
        * gcc.dg/tree-ssa/copy-headers-7.c: Do not run vrp pass.
        * gcc.dg/tree-ssa/loop-15.c: Remove XFAIL.
        * gcc.dg/tree-ssa/pr23744.c: Change search pattern.
        * gcc.dg/wrapped-binop-simplify.c: New test.

From-SVN: r274925

5 years ago[PATCH 1/2] Allow folding all statements.
Robin Dapp [Mon, 26 Aug 2019 10:18:24 +0000 (10:18 +0000)]
[PATCH 1/2] Allow folding all statements.

This patch allows users of the substitute_and_fold_engine to
enable folding all statements.  It is now enabled for VRP which
is needed for the match.pd pattern in patch 2/2.

The loop versioning pass was missing one case when
deconstructing addresses that would only be triggered after
this patch for me:
It could handle addition and subsequent convert/nop but not
a convert/nop directly.  This would cause the hash to be
calculated differently and, in turn, cause the pass to miss
a versioning opportunity.  Fixed this by adding the missing
case.

--

gcc/ChangeLog:

2019-08-26  Robin Dapp  <rdapp@linux.ibm.com>

        * gimple-loop-versioning.cc (loop_versioning::record_address_fragment):
        Add nop_convert case.
        * tree-ssa-propagate.c (substitute_and_fold_dom_walker::before_dom_children):
        Fold all statements if requested.
        * tree-ssa-propagate.h (class substitute_and_fold_engine):
        Allow to fold all statements.
        * tree-vrp.c (class vrp_folder):
        Let substitute_and_fold_engine fold all statements.

From-SVN: r274923

5 years agore PR c/91526 (Unnecessary SSE and other instructions generated when compiling in...
Richard Biener [Mon, 26 Aug 2019 09:29:07 +0000 (09:29 +0000)]
re PR c/91526 (Unnecessary SSE and other instructions generated when compiling in C mode (vs. C++ mode))

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

PR tree-optimization/91526
* passes.def: Note that after late FRE we do TODO_update_address_taken.
* tree-ssa-sccvn.c (pass_fre::execute): In late mode schedule
TODO_update_address_taken.

From-SVN: r274922

5 years agoRISC-V: Add testcase for testing li pseudo instruction
Kito Cheng [Mon, 26 Aug 2019 02:15:47 +0000 (02:15 +0000)]
RISC-V: Add testcase for testing li pseudo instruction

gcc/testsuite/ChangeLog:

gcc.target/riscv/li.c: New test.

From-SVN: r274920

5 years agoDaily bump.
GCC Administrator [Mon, 26 Aug 2019 00:16:48 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r274919

5 years agogmm_malloc.h: Only use <errno.h> and errno if __STDC_HOSTED__.
Gerald Pfeifer [Sun, 25 Aug 2019 22:25:23 +0000 (22:25 +0000)]
gmm_malloc.h: Only use <errno.h> and errno if __STDC_HOSTED__.

* config/i386/gmm_malloc.h: Only use <errno.h> and errno if
__STDC_HOSTED__.

From-SVN: r274915

5 years agoDaily bump.
GCC Administrator [Sun, 25 Aug 2019 00:16:50 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r274907

5 years ago[C++ PATCH] vfunc overrider simplification
Nathan Sidwell [Sat, 24 Aug 2019 22:44:06 +0000 (22:44 +0000)]
[C++ PATCH] vfunc overrider simplification

https://gcc.gnu.org/ml/gcc-patches/2019-08/msg01674.html
cp/
* class.c (check_for_overrides): Conversion operators need
checking too.

testsuite/
* g++.dg/inherit/virtual14.C: New.

From-SVN: r274903

5 years agore PR fortran/91390 (treatment of extra parameter in a subroutine call)
Thomas Koenig [Sat, 24 Aug 2019 21:12:45 +0000 (21:12 +0000)]
re PR fortran/91390 (treatment of extra parameter in a subroutine call)

2019-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/91390
PR fortran/91519
* frontend-passes.c (check_externals_procedure): New
function. If a procedure is not in the translation unit, create
an "interface" for it, including its formal arguments.
(check_externals_code): Use check_externals_procedure for common
code with check_externals_expr.
(check_externals_expr): Vice versa.
* gfortran.h (gfc_get_formal_from_actual-arglist): New prototype.
(gfc_compare_actual_formal): New prototype.
* interface.c (compare_actual_formal): Rename to
(gfc_compare_actual_formal): New function, make global.
(gfc_get_formal_from_actual_arglist): Make global, and move here from
* trans-types.c (get_formal_from_actual_arglist): Remove here.
(gfc_get_function_type): Use gfc_get_formal_from_actual_arglist.

2019-08-24  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/91390
PR fortran/91519
* gfortran.dg/bessel_3.f90: Add type mismatch errors.
* gfortran.dg/coarray_7.f90: Rename subroutines to avoid
additional errors.
* gfortran.dg/g77/20010519-1.f: Add -std=legacy. Remove
warnings for ASSIGN. Add warnings for type mismatch.
* gfortran.dg/goacc/acc_on_device-1.f95: Add -std=legacy.
Add catch-all warning.
* gfortran.dg/internal_pack_9.f90: Rename subroutine to
avoid type error.
* gfortran.dg/internal_pack_9.f90: Add -std=legacy. Add
warnings for type mismatch.
* gfortran.dg/pr39937.f: Add -std=legacy and type warnings. Move
here from
* gfortran.fortran-torture/compile/pr39937.f: Move to
gfortran.dg.

From-SVN: r274902

5 years agosemantics.c (finish_switch_cond): Improve error message location.
Paolo Carlini [Sat, 24 Aug 2019 19:39:44 +0000 (19:39 +0000)]
semantics.c (finish_switch_cond): Improve error message location.

/cp
2019-08-24  Paolo Carlini  <paolo.carlini@oracle.com>

* semantics.c (finish_switch_cond): Improve error message location.

/testsuite
2019-08-24  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/conversion/simd4.C: Test all the locations.

From-SVN: r274901

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

From-SVN: r274898

5 years agoFix handling of namespace-scope undeduced auto decls.
Jason Merrill [Fri, 23 Aug 2019 23:29:16 +0000 (19:29 -0400)]
Fix handling of namespace-scope undeduced auto decls.

* decl2.c (decl_dependent_p): New.
(mark_used): Check it instead of just processing_template_decl.

From-SVN: r274894

5 years ago* parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant error.
Jason Merrill [Fri, 23 Aug 2019 23:29:10 +0000 (19:29 -0400)]
* parser.c (cp_parser_nested_name_specifier_opt): Avoid redundant error.

From-SVN: r274893

5 years agoPR c++/91521 - wrong error with operator->.
Marek Polacek [Fri, 23 Aug 2019 23:24:46 +0000 (23:24 +0000)]
PR c++/91521 - wrong error with operator->.

* decl.c (grokdeclarator): Return error_mark_node for an invalid
trailing return type.

* g++.dg/parse/operator8.C: New test.

From-SVN: r274891

5 years agocompiler: record pointer var values to remove write barriers
Ian Lance Taylor [Fri, 23 Aug 2019 22:38:58 +0000 (22:38 +0000)]
compiler: record pointer var values to remove write barriers

    Record when a local pointer variable is set to a value such that
    indirecting through the pointer does not require a write barrier.  Use
    that to eliminate write barriers when indirecting through that local
    pointer variable.  Only keep this information per-block, so it's not
    all that applicable.

    This reduces the number of write barriers generated when compiling the
    runtime package from 553 to 524.

    The point of this is to eliminate a bad write barrier in the bytes
    function in runtime/print.go.  Mark that function nowritebarrier so
    that the problem does not recur.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191581

From-SVN: r274890

5 years agors6000: New darn testcase (PR91481)
Segher Boessenkool [Fri, 23 Aug 2019 22:19:40 +0000 (00:19 +0200)]
rs6000: New darn testcase (PR91481)

We used to implement darn with unspecs, not unspec_volatiles, which
means two darn instructions could be CSEd together.

This testcase tests it by adding together four random numbers.  If all
is well that means we get four darn instructions, because such a small
loop is unrolled fine at -O2 already.  If things go bad, combine will
combine it all to one darn and a shift left by two.

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

From-SVN: r274889