gcc.git
5 years agoDisambiguate __gnu_cxx::append_ partial specialization
Tom Honermann [Fri, 22 Feb 2019 01:15:58 +0000 (01:15 +0000)]
Disambiguate __gnu_cxx::append_ partial specialization

This patch corrects ambiguous partial specializations of
typelist::detail::append_.  Previously, neither append_<chain<Hd, Tl>,
Typelist_Chain> nor append_<Typelist_Chain, null_type> was a better
match for append_<chain<Hd, Tl>, null_type>.

2019-02-22  Tom Honermann  <tom@honermann.net>

* include/ext/typelist.h: Constrain a partial specialization of
typelist::detail::append_ to only match chain<T1,T2>.

From-SVN: r269088

5 years agore PR go/89406 (Go testing leaves many temporary directories in /tmp around)
Ian Lance Taylor [Fri, 22 Feb 2019 00:47:30 +0000 (00:47 +0000)]
re PR go/89406 (Go testing leaves many temporary directories in /tmp around)

PR go/89406
    net: remove unixgram test sockets

    Backport https://golang.org/cl/163277 from the master library.

    Updates https://gcc.gnu.org/PR89406

    Reviewed-on: https://go-review.googlesource.com/c/163200

From-SVN: r269087

5 years agocmd/go: remove work directory on usage error
Ian Lance Taylor [Fri, 22 Feb 2019 00:41:25 +0000 (00:41 +0000)]
cmd/go: remove work directory on usage error

    Backport https://golang.org/cl/163237 from the master library:

        Ensure that cmd/go consistently calls base.Exit rather than os.Exit,
        so that we don't incorrectly leave the work directory around on exit.

        Test this by modifying the testsuite to run all the tests with TMPDIR
        set to a temporary directory, and then check that no files are left
        behind in that temporary directory. Adjust a couple of tests to make
        this approach work.

    Updates https://gcc.gnu.org/PR89406

    Reviewed-on: https://go-review.googlesource.com/c/163198

From-SVN: r269086

5 years agoDaily bump.
GCC Administrator [Fri, 22 Feb 2019 00:16:20 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269085

5 years agoextend.texi (__clear_cache): Correct signature.
Martin Sebor [Thu, 21 Feb 2019 23:23:12 +0000 (23:23 +0000)]
extend.texi (__clear_cache): Correct signature.

gcc/ChangeLog:

* doc/extend.texi (__clear_cache): Correct signature.

libgcc/ChangeLog:

* libgcc2.h (__clear_cache): Correct signature.
* libgcc2.c (__clear_cache): Same.

gcc/testsuite/ChangeLog:

* gcc.dg/Wbuiltin-declaration-mismatch-12.c: New test.

From-SVN: r269082

5 years agoPR c++/89422 - ICE with -g and lambda in default arg in template.
Jason Merrill [Thu, 21 Feb 2019 23:07:47 +0000 (18:07 -0500)]
PR c++/89422 - ICE with -g and lambda in default arg in template.

Here, we were trying to instantiate the default argument before setting
DECL_FRIEND_CONTEXT, so that the instantiated lambda ended up being treated
as part of the S template, which confused dwarf2out.

* pt.c (tsubst_function_decl): SET_DECL_FRIEND_CONTEXT sooner.

From-SVN: r269081

5 years agoPR c++/88419 - C++17 ICE with class template arg deduction.
Jason Merrill [Thu, 21 Feb 2019 23:07:12 +0000 (18:07 -0500)]
PR c++/88419 - C++17 ICE with class template arg deduction.

Just like in make_constrained_auto, we need to defer setting TYPE_CANONICAL
until we've set fields that will affect structural_comptypes.

* pt.c (make_template_placeholder): Set TYPE_CANONICAL after
CLASS_PLACEHOLDER_TEMPLATE.

From-SVN: r269080

5 years agore PR go/89170 (FAIL: net/http)
Ian Lance Taylor [Thu, 21 Feb 2019 22:50:24 +0000 (22:50 +0000)]
re PR go/89170 (FAIL: net/http)

PR go/89170
* varasm.c (decode_addr_const): Call lookup_constant_def rather
than output_constant_def.
(add_constant_to_table): New static function.
(output_constant_def): Call add_constant_to_table.
(tree_output_constant_def): Likewise.

From-SVN: r269079

5 years agore PR c++/89285 (ICE after casting the this pointer in the constructor in C++17 mode)
Jakub Jelinek [Thu, 21 Feb 2019 21:21:25 +0000 (22:21 +0100)]
re PR c++/89285 (ICE after casting the this pointer in the constructor in C++17 mode)

PR c++/89285
* builtins.c (fold_builtin_arith_overflow): If first two args are
INTEGER_CSTs, set intres and ovfres to constants rather than calls
to ifn.

* constexpr.c (struct constexpr_fundef): Add parms and result members.
(retrieve_constexpr_fundef): Adjust for the above change.
(register_constexpr_fundef): Save constexpr body with copy_fn,
temporarily set DECL_CONTEXT on DECL_RESULT before that.
(get_fundef_copy): Change FUN argument to FUNDEF with
constexpr_fundef * type, grab body and parms/result out of
constexpr_fundef struct and temporarily change it for copy_fn calls
too.
(cxx_eval_builtin_function_call): For __builtin_FUNCTION temporarily
adjust current_function_decl from ctx->call context.  Test
!potential_constant_expression instead of !is_constant_expression.
(cxx_bind_parameters_in_call): Grab parameters from new_call.  Undo
convert_for_arg_passing changes for TREE_ADDRESSABLE type passing.
(cxx_eval_call_expression): Adjust get_fundef_copy caller.
(cxx_eval_conditional_expression): For IF_STMT, allow then or else
operands to be NULL.
(label_matches): Handle BREAK_STMT and CONTINUE_STMT.
(cxx_eval_loop_expr): Add support for FOR_STMT, WHILE_STMT and DO_STMT.
(cxx_eval_switch_expr): Add support for SWITCH_STMT.
(cxx_eval_constant_expression): Handle IF_STMT, FOR_STMT, WHILE_STMT,
DO_STMT, CONTINUE_STMT, SWITCH_STMT, BREAK_STMT and CONTINUE_STMT.
For SIZEOF_EXPR, recurse on the result of fold_sizeof_expr.  Ignore
DECL_EXPR with USING_DECL operand.
* lambda.c (maybe_add_lambda_conv_op): Build thisarg using
build_int_cst to make it a valid constant expression.

* g++.dg/ubsan/vptr-4.C: Expect reinterpret_cast errors.
* g++.dg/cpp1y/constexpr-84192.C (f2): Adjust expected diagnostics.
* g++.dg/cpp1y/constexpr-70265-2.C (foo): Adjust expected line of
diagnostics.
* g++.dg/cpp1y/constexpr-89285.C: New test.
* g++.dg/cpp0x/constexpr-arith-overflow.C (add, sub, mul): Ifdef out
for C++11.
(TEST_ADD, TEST_SUB, TEST_MUL): Define to Assert (true) for C++11.
* g++.dg/cpp0x/constexpr-arith-overflow2.C: New test.

From-SVN: r269078

5 years agoPR libstdc++/89416 fix __is_move_insertable trait
Jonathan Wakely [Thu, 21 Feb 2019 20:47:43 +0000 (20:47 +0000)]
PR libstdc++/89416 fix __is_move_insertable trait

The common base class for __is_move_insertable and __is_copy_insertable
instantiates both the copy and move tests, when only one is needed. The
unneeded one might cause errors outside the immediate context.

The solution used in this patch is to replace them with alias templates,
which will only be instantiated as needed.

PR libstdc++/89416
* include/bits/alloc_traits.h (__is_alloc_insertable_impl): Replace
class template with class. Replace move and copy member types with
member alias templates, so they are only instantiated when needed.
(__is_copy_insertable, __is_move_insertable): Adjust base class.
* testsuite/23_containers/vector/modifiers/push_back/89130.cc: Enable
test for C++11/14/17 as well.
* testsuite/23_containers/vector/modifiers/push_back/89416.cc: New
test.

From-SVN: r269075

5 years agoi386: Replace -fcf-protection with -fcf-protection=branch
H.J. Lu [Thu, 21 Feb 2019 18:59:00 +0000 (18:59 +0000)]
i386: Replace -fcf-protection with -fcf-protection=branch

Since -mindirect-branch is incompatible with -fcf-protection=return and
-fcf-protection, replace -fcf-protection with -fcf-protection=branch.

PR target/87412
* gcc.target/i386/indirect-thunk-attr-14.c: Replace
-fcf-protection with -fcf-protection=branch.
* gcc.target/i386/indirect-thunk-attr-15.c: Likewise.
* gcc.target/i386/indirect-thunk-attr-16.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-8.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-9.c: Likewise.
* gcc.target/i386/indirect-thunk-extern-10.c: Likewise.

From-SVN: r269074

5 years agoPR c++/88690 - C++17 ICE with empty base in aggregate.
Jason Merrill [Thu, 21 Feb 2019 18:16:15 +0000 (13:16 -0500)]
PR c++/88690 - C++17 ICE with empty base in aggregate.

Base fields for empty bases appear in initialization order, which may not be
the same as layout order.  If they also show up in a CONSTRUCTOR in that
order, output_constructor_regular_field aborts because it understandably
doesn't want to go backwards.  I also considered making o_c_r_f more
tolerant of the case where the out-of-order field has fieldsize 0, and so no
actual data needs to be emitted, but we might as well avoid adding an
element to the CONSTRUCTOR in the first place.

* typeck2.c (process_init_constructor_record): Skip trivial
initialization of an empty base.

From-SVN: r269073

5 years agoFix pr88850-2 test
Wilco Dijkstra [Thu, 21 Feb 2019 18:08:56 +0000 (18:08 +0000)]
Fix pr88850-2 test

Like the pr88850.c test, also fix the pr88850-2.c testcase which
was failing in hardfp environments.

Committed as obvious.

    gcc/testsuite/
* gcc.target/arm/pr88850-2.c: Block -mfloat-abi override.
* gcc.target/arm/pr88850.c: Use -mfloat-abi=softfp.

From-SVN: r269072

5 years agodump-parse-tree.c (debug): Implement for gfc_expr *, gfc_typespec *, gfc_typespec...
Thomas Koenig [Thu, 21 Feb 2019 18:03:30 +0000 (18:03 +0000)]
dump-parse-tree.c (debug): Implement for gfc_expr *, gfc_typespec *, gfc_typespec and gfc_symbol *.

2019-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

    * dump-parse-tree.c (debug): Implement for gfc_expr *,
    gfc_typespec *, gfc_typespec and gfc_symbol *.

From-SVN: r269071

5 years agore PR fortran/86119 (Intrinsic len has wrong type if used within select type for...
Thomas Koenig [Thu, 21 Feb 2019 18:01:41 +0000 (18:01 +0000)]
re PR fortran/86119 (Intrinsic len has wrong type if used within select type for a class(*) string)

2019-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/86119
    * class.c (gfc_get_len_component): Add argument k for kind.
    If the kind of the resulting expression is not equal to k,
    convert it.
    * gfortran.h (gfc_len_component): Adjust prototype.
    * simplify.c (gfc_simplify_len): Pass kind to
    gfc_get_len_component.

2019-02-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/86119
    * gfortran.dg/warn_conversion_11.f90: New test.

From-SVN: r269070

5 years agoi386: Check -mindirect-branch/-mfunction-return with -fcf-protection
H.J. Lu [Thu, 21 Feb 2019 13:41:53 +0000 (13:41 +0000)]
i386: Check -mindirect-branch/-mfunction-return with -fcf-protection

Issue an error when -mindirect-branch or -mfunction-return are used
with incompatible -fcf-protection.

gcc/

PR target/87412
* config/i386/i386.c (ix86_set_indirect_branch_type): Issue an
error for -mindirect-branch/-mfunction-return with incompatible
-fcf-protection.

gcc/testsuite/

PR target/87412
* gcc.target/i386/pr87412-1.c: New file.
* gcc.target/i386/pr87412-2.c: Likewise.
* gcc.target/i386/pr87412-3.c: Likewise.
* gcc.target/i386/pr87412-4.c: Likewise.

From-SVN: r269068

5 years agore PR bootstrap/88714 (bootstrap comparison failure on armv7l since r265398)
Jakub Jelinek [Thu, 21 Feb 2019 12:04:26 +0000 (13:04 +0100)]
re PR bootstrap/88714 (bootstrap comparison failure on armv7l since r265398)

PR bootstrap/88714
* constraints.md (q): Remove.
* config/arm/ldrdstrd.md (*arm_ldrd, *arm_strd): Use rk constraint
instead of q.

From-SVN: r269067

5 years ago[omp] Move NE_EXPR handling to omp_adjust_for_condition
Martin Jambor [Thu, 21 Feb 2019 11:00:47 +0000 (12:00 +0100)]
[omp] Move NE_EXPR handling to omp_adjust_for_condition

2019-02-21  Martin Jambor  <mjambor@suse.cz>

PR hsa/89302
* omp-general.c (omp_extract_for_data): Removed a duplicate call
to omp_adjust_for_condition, moved NE_EXPR code_cond processing...
(omp_adjust_for_condition): ...here.  Added necessary parameters.
* omp-general.h (omp_adjust_for_condition): Updated declaration.
* omp-grid.c (grid_attempt_target_gridification): Adjust to pass
proper values to new parameters of omp_adjust_for_condition.

From-SVN: r269066

5 years agore PR c++/89392 (ICE in bitmap_bit_p, at bitmap.c:978)
Richard Biener [Thu, 21 Feb 2019 08:03:40 +0000 (08:03 +0000)]
re PR c++/89392 (ICE in bitmap_bit_p, at bitmap.c:978)

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.

From-SVN: r269065

5 years agoPR c++/87921 - wrong error with inline static data member.
Jason Merrill [Thu, 21 Feb 2019 02:24:40 +0000 (21:24 -0500)]
PR c++/87921 - wrong error with inline static data member.

c_parse_final_cleanups checks DECL_IN_AGGR_P to avoid trying to emit a
static data member that has not been defined.  The inline variable patch
changed that to exempt inline variables.  But in this case we haven't
instantiated the variable yet, so we really don't have a definition.  This
patch changes inline variable handling such that DECL_IN_AGGR_P is not set
for a defined inline variable, so we can remove all the checks of
DECL_INLINE_VAR_P after DECL_IN_AGGR_P.

With that change we were failing on a static data member that had been
instantiated due to a use before we got around to processing it in
instantiate_class_template; we should detect that and avoid all the
finish_static_data_member_decl processing, which assumes that it is the
first time we're seeing the variable.

* decl2.c (finish_static_data_member_decl): Don't set DECL_IN_AGGR_P
for a non-template inline variable.  Do nothing for an
already-instantiated variable.
(c_parse_final_cleanups): Check DECL_IN_AGGR_P without
DECL_INLINE_VAR_P.
* decl.c (check_initializer): Likewise.
(make_rtl_for_nonlocal_decl): Likewise.
* pt.c (instantiate_decl): Likewise.
* typeck2.c (store_init_value): Likewise.

From-SVN: r269064

5 years agore PR go/89407 (go bootstrap failure on s390x starting with r268941)
Ian Lance Taylor [Thu, 21 Feb 2019 01:06:01 +0000 (01:06 +0000)]
re PR go/89407 (go bootstrap failure on s390x starting with r268941)

PR go/89407
    internal/cpu: use #ifdef __s390x__ in C code

    Patch by Jakub Jelinek.

    Fixes https://gcc.gnu.org/PR89407

    Reviewed-on: https://go-review.googlesource.com/c/163297

From-SVN: r269063

5 years agoDaily bump.
GCC Administrator [Thu, 21 Feb 2019 00:16:45 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269062

5 years agore PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)
Jakub Jelinek [Thu, 21 Feb 2019 00:09:47 +0000 (01:09 +0100)]
re PR c++/89403 (ICE in maybe_clone_body, at cp/optimize.c:693)

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

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

From-SVN: r269059

5 years agore PR c++/89405 (ICE in import_export_decl, at cp/decl2.c:2959)
Jakub Jelinek [Thu, 21 Feb 2019 00:08:59 +0000 (01:08 +0100)]
re PR c++/89405 (ICE in import_export_decl, at cp/decl2.c:2959)

PR c++/89405
* decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
DECL_COMMON, set DECL_INTERFACE_KNOWN.

* g++.dg/cpp1z/inline-var5.C: New test.

From-SVN: r269058

5 years agore PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686...
Jakub Jelinek [Wed, 20 Feb 2019 23:02:29 +0000 (00:02 +0100)]
re PR middle-end/89412 (gcc ICE in simplify_subreg, at simplify-rtx.c:6273 on i686-linux-gnu)

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

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

From-SVN: r269057

5 years agore PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))
Jakub Jelinek [Wed, 20 Feb 2019 23:01:41 +0000 (00:01 +0100)]
re PR middle-end/89091 (ICE: Segmentation fault (in tree_class_check))

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

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

Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
From-SVN: r269056

5 years agore PR tree-optimization/88074 (g++ hangs on math expression)
Jakub Jelinek [Wed, 20 Feb 2019 22:41:26 +0000 (23:41 +0100)]
re PR tree-optimization/88074 (g++ hangs on math expression)

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

* gcc.dg/pr88074-2.c: New test.

From-SVN: r269055

5 years agore PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563 since r229082)
Uros Bizjak [Wed, 20 Feb 2019 21:58:45 +0000 (22:58 +0100)]
re PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563 since r229082)

PR target/89397
* config/i386/i386.c (ix86_atomic_assign_expand_fenv): Check
TARGET_SSE in addition to TARGET_SSE_MATH.

(ix86_excess_precision): Ditto.
(ix86_float_exceptions_rounding_supported_p): Ditto.
(use_rsqrt_p): Ditto.
* config/i386/sse.md (rsqrt<mode>2): Ditto.

From-SVN: r269054

5 years agolinux-unwind.h (alpha_fallback_frame_state): Cast 'mcontext_t *' &rt_->uc.uc_mcontext...
Uros Bizjak [Wed, 20 Feb 2019 21:37:21 +0000 (22:37 +0100)]
linux-unwind.h (alpha_fallback_frame_state): Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.

* config/alpha/linux-unwind.h (alpha_fallback_frame_state):
Cast 'mcontext_t *' &rt_->uc.uc_mcontext to 'struct sigcontext *'.

From-SVN: r269053

5 years agore PR c++/89336 (internal compiler error when compiling a constexpr function)
Jakub Jelinek [Wed, 20 Feb 2019 21:16:27 +0000 (22:16 +0100)]
re PR c++/89336 (internal compiler error when compiling a constexpr function)

PR c++/89336
* constexpr.c (cxx_eval_store_expression): Diagnose changing of active
union member for -std=c++17 and earlier.

* g++.dg/cpp1y/constexpr-89336-3.C: New test.

From-SVN: r269052

5 years agoFix ICE with #line directive (PR c/89410)
David Malcolm [Wed, 20 Feb 2019 20:07:20 +0000 (20:07 +0000)]
Fix ICE with #line directive (PR c/89410)

PR c/89410 reports various issues with #line directives with very
large numbers; one of them is an ICE inside diagnostic-show-locus.c
when emitting a diagnostic at line 0xffffffff.

The issue is that the arithmetic in layout::calculate_line_spans to
determine if two line spans are sufficiently close to consolidate
was using the unsigned 32-bit linenum_type, which was overflowing
when comparing the line for the expanded location with those of
the location range (all on line 0xffffffff), leading to it
erroneously adding two spans for the same line, leading to an
assertion failure.

This patch fixes the ICE by generalizing the use of long long in
line-map.h's comparison function for linenum_type into a new
linenum_arith_t typedef, and using it here.

Doing so uncovered a second problem: the loop to print the lines
within the line_span for this case is infinite: looping from
0xfffffff upwards, overflowing to 0, and then never becoming
greater than 0xfffffff.  The patch fixes this by using linenum_arith_t
there also.

gcc/ChangeLog:
PR c/89410
* diagnostic-show-locus.c (layout::calculate_line_spans): Use
linenum_arith_t when determining if two adjacent line spans are
close enough to merge.
(diagnostic_show_locus): Use linenum_arith_t when iterating over
lines within each line_span.

gcc/testsuite/ChangeLog:
PR c/89410
* gcc.dg/pr89410-1.c: New test.
* gcc.dg/pr89410-2.c: New test.

libcpp/ChangeLog:
PR c/89410
* include/line-map.h (linenum_arith_t): New typedef.
(compare): Use it.

From-SVN: r269050

5 years agocompiler: fix a typo in comments
Ian Lance Taylor [Wed, 20 Feb 2019 19:14:12 +0000 (19:14 +0000)]
compiler: fix a typo in comments

    Reviewed-on: https://go-review.googlesource.com/c/163097

From-SVN: r269049

5 years agoPR c++/87513 - 'sorry' mangling PMF template-id.
Jason Merrill [Wed, 20 Feb 2019 18:59:18 +0000 (13:59 -0500)]
PR c++/87513 - 'sorry' mangling PMF template-id.

Here build_offset_ref calls build_qualified_name to make a SCOPE_REF because
the dependent template arguments make type_dependent_expression_p (member)
true.  We could probably work hard to prevent this, but it doesn't seem
necessary, and it's easy to fix write_expression to handle the result.

* mangle.c (write_expression): Handle SCOPE_REF to BASELINK.

From-SVN: r269048

5 years ago* g++.old-deja/g++.robertl/eb92.C: Handle warning as well.
Jason Merrill [Wed, 20 Feb 2019 18:58:46 +0000 (13:58 -0500)]
* g++.old-deja/g++.robertl/eb92.C: Handle warning as well.

From-SVN: r269047

5 years agoPR c++/88380 - wrong-code with flexible array and NSDMI.
Jason Merrill [Wed, 20 Feb 2019 18:54:45 +0000 (13:54 -0500)]
PR c++/88380 - wrong-code with flexible array and NSDMI.

Here 'skipped' was set to -1 to force an explicit initializer for 'uninit'
before the initializer for 'initialized', and so we also tried to emit an
explicit initializer for the flexible array, for which build_zero_init
returns error_mark_node.  We should ignore flexarrays even when
skipped < 0.

* typeck2.c (process_init_constructor_record): Skip flexarrays.

From-SVN: r269046

5 years agoPR c++/88572 - wrong handling of braces on scalar init.
Will Wray [Wed, 20 Feb 2019 18:50:32 +0000 (13:50 -0500)]
PR c++/88572 - wrong handling of braces on scalar init.

* decl.c (reshape_init_r): Allow braces around scalar initializer
within aggregate init.  Reject double braced-init of scalar
variable.

From-SVN: r269045

5 years agotarget-supports.exp (check_effective_target_vect_usad_char): Add PowerPC support.
Pat Haugen [Wed, 20 Feb 2019 17:50:28 +0000 (17:50 +0000)]
target-supports.exp (check_effective_target_vect_usad_char): Add PowerPC support.

* lib/target-supports.exp (check_effective_target_vect_usad_char):
Add PowerPC support.
* gcc.dg/vect/slp-reduc-sad.c: Update scan string.
* gcc.dg/vect/vect-reduc-sad.c: Likewise.

From-SVN: r269043

5 years agolibsanitizer: Restore internal_readlink for x32
H.J. Lu [Wed, 20 Feb 2019 16:20:50 +0000 (16:20 +0000)]
libsanitizer: Restore internal_readlink for x32

Cherry-pick compiler-rt revision 354451:

r316591 has

@@ -389,13 +383,11 @@ uptr internal_dup2(int oldfd, int newfd) {
 }

 uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
-#if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
-#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
+#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(readlinkat), AT_FDCWD,
                           (uptr)path, (uptr)buf, bufsize);
 #else
-  return internal_syscall(SYSCALL(readlink), (uptr)path, (uptr)buf, bufsize);
+  return internal_syscall_ptr(SYSCALL(readlink), path, buf, bufsize);
 #endif
 }

which dropped the (uptr) cast and broke x32.  This patch puts back the
(uptr) cast to restore x32 and fixes:

https://bugs.llvm.org/show_bug.cgi?id=40783

Differential Revision: https://reviews.llvm.org/D58413

PR sanitizer/89409
* sanitizer_common/sanitizer_linux.cc (internal_readlink):
Cherry-pick compiler-rt r354451.

From-SVN: r269042

5 years agoFix testsuite
Caroline Tice [Wed, 20 Feb 2019 16:07:19 +0000 (08:07 -0800)]
Fix testsuite

2019-02-19  Caroline Tice <cmtice@google.com>

Fix testsuite
* testsuite/libvtv.cc/const_vtable.cc (main): Fix function signature.

From-SVN: r269041

5 years agorevert: re PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563...
Uros Bizjak [Wed, 20 Feb 2019 15:23:47 +0000 (16:23 +0100)]
revert: re PR target/89397 (ICE in build_call_expr_loc_array at gcc/tree.c:11563 since r229082)

Revert:
        PR target/89397
        * config/i386/i386.c (ix86_option_override_internal): Set
        opts->x_ix86_fpmath to FPMATH_387 when SSE is disabled.

        gcc/testsuite/

        PR target/89397
        * gcc.target/i386/pr89397.c: New test.

From-SVN: r269040

5 years ago[GCC] PR target/86487: fix the way 'uses_hard_regs_p' handles paradoxical
Andre Vieira [Wed, 20 Feb 2019 14:11:43 +0000 (14:11 +0000)]
[GCC] PR target/86487: fix the way 'uses_hard_regs_p' handles paradoxical
subregs

gcc/ChangeLog:
2019-02-20 Andre Vieira  <andre.simoesdiasvieira@arm.com>

PR target/86487
* lra-constraints.c(uses_hard_regs_p): Fix handling of
paradoxical SUBREGS.

gcc/testsuite/ChangeLog:
2019-02-20 Andre Vieira  <andre.simoesdiasvieira@arm.com>

PR target/86487
* gcc.target/arm/pr86487.c: New.

From-SVN: r269039

5 years agoChange singular to plural in gfortran.texi.
Martin Liska [Wed, 20 Feb 2019 11:12:10 +0000 (12:12 +0100)]
Change singular to plural in gfortran.texi.

2019-02-20  Martin Liska  <mliska@suse.cz>

* gfortran.texi: Change singular to plural.

From-SVN: r269038

5 years agore PR c++/84536 (ICE with non-type template parameter)
Paolo Carlini [Wed, 20 Feb 2019 10:47:02 +0000 (10:47 +0000)]
re PR c++/84536 (ICE with non-type template parameter)

/cp
2019-02-20  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84536
* pt.c (tsubst_init): Diagnose an initializer expanding to an
empty list of expressions; tweak wrt dependent types.
(regenerate_decl_from_template): For VAR_DECLs call tsubst_init
instead of tsubst_expr.

/testsuite
2019-02-20  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84536
* g++.dg/cpp1y/var-templ60.C: New.

From-SVN: r269037

5 years agoCorrection of ChangeLog entry, Thomas provided the code for this change.
Thomas Schwinge [Wed, 20 Feb 2019 10:09:53 +0000 (10:09 +0000)]
Correction of ChangeLog entry, Thomas provided the code for this change.

2019-02-19  Thomas Schwinge  <thomas@codesourcery.com>

PR c/87924
* openmp.c (gfc_match_omp_clauses): Add representation of wait clause
without argument as 'wait (GOMP_ASYNC_NOVAL)'.

From-SVN: r269036

5 years agoDocument Fortran header directive.
Martin Liska [Wed, 20 Feb 2019 09:23:12 +0000 (10:23 +0100)]
Document Fortran header directive.

2019-02-20  Martin Liska  <mliska@suse.cz>

* gfortran.texi: Document Fortran header directive.

From-SVN: r269035

5 years agore PR libstdc++/89402 (warning: ‘void _ZNKSt4hashIeEclEe()’ specifies less restrictiv...
Jakub Jelinek [Wed, 20 Feb 2019 07:57:41 +0000 (08:57 +0100)]
re PR libstdc++/89402 (warning: â€˜void _ZNKSt4hashIeEclEe()’ specifies less restrictive attribute than its target)

PR libstdc++/89402
* src/c++98/compatibility-ldbl.cc (_ZNKSt4hashIeEclEe): Add
_GLIBCXX_PURE to the alias declaration.

From-SVN: r269034

5 years ago[rs6000] fix PR 88100, range check for vec_splat_{su}{8,16,32}
Li Jia He [Wed, 20 Feb 2019 02:35:39 +0000 (02:35 +0000)]
[rs6000] fix PR 88100, range check for vec_splat_{su}{8,16,32}

GCC revision 259524 implemented range check for the vec_splat_{su}{8,16,32}
builtins.  However, as a consequence of the implementation, the range check
is not done correctly for the expected vspltis[bhw] instructions. Â The result
is that we may not get a valid error message if the valid range of the data
is exceeded.

Although the input of the function prototype of vec_splat_{su}{8,16,32} is
const int, the actual data usage range is limited to the data range of 5 bits
signed.  We should limit the int_cst.val[0] data to the 5 bit signed data range
without any modification in the input arg0 parameter.  However, the sext_hwi
function intercepts the data of TREE_INT_CST_LOW (arg0) as size bits in the
sext_hwi (TREE_INT_CST_LOW (arg0), size) statement.  This will cause some of
the excess data to fall within the range of 5 bits signed, so that the correct
diagnostic information cannot be generated, we need to remove the sext_hwi to
ensure that the input data has not been modified.

This patch fix range check for the vec_splat_s[8,16,32] builtins.  The argument
must be a 5-bit const int as specified for the vspltis[bhw] instructions.

for gcc/ChangeLog

PR target/88100
* gcc/config/rs6000/rs6000.c (rs6000_gimple_fold_builtin)
<case ALTIVEC_BUILTIN_VSPLTISB, ALTIVEC_BUILTIN_VSPLTISH,
ALTIVEC_BUILTIN_VSPLTISW>: Don't convert the operand before
range checking it.

for gcc/testsuite/ChangeLog

PR target/88100
* gcc/testsuite/gcc.target/powerpc/pr88100.c: New testcase.

From-SVN: r269033

5 years agoPR c++/88368 - wrong 'use of deleted function'
Jason Merrill [Wed, 20 Feb 2019 02:00:29 +0000 (21:00 -0500)]
PR c++/88368 - wrong 'use of deleted function'

Since my patch for 81359 allowed us to signal failure on return from
maybe_instantiate_noexcept, we no longer need to turn an error into
noexcept(false).  We also need to handle NSDMI instantiation errors under
synthesized_method_walk.  This change caused some instantiation context
notes to be lost in the testsuite, so I added push_tinst_level to
get_defaulted_eh_spec to restore that context.

* method.c (walk_field_subobs): Remember errors from get_nsdmi.
(get_defaulted_eh_spec): Call push_tinst_level.
* pt.c (maybe_instantiate_noexcept): Keep error_mark_node.
* typeck2.c (merge_exception_specifiers): Handle error_mark_node.

From-SVN: r269032

5 years agoDaily bump.
GCC Administrator [Wed, 20 Feb 2019 00:16:45 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r269031

5 years ago* config/gcn/gcn.c (print_operand): Fix typo.
Jonathan Wakely [Tue, 19 Feb 2019 19:30:59 +0000 (19:30 +0000)]
* config/gcn/gcn.c (print_operand): Fix typo.

From-SVN: r269028

5 years agocompiler: add debugger-callable AST dump functins
Ian Lance Taylor [Tue, 19 Feb 2019 18:44:24 +0000 (18:44 +0000)]
compiler: add debugger-callable AST dump functins

    Introduce a set debug_go_* global functions that can be used to emit
    AST dumps for Go statements and expressions from within GDB (for use
    by people developing gccgo).

    Reviewed-on: https://go-review.googlesource.com/c/162903

From-SVN: r269027

5 years agoFix pr88850 test
Wilco Dijkstra [Tue, 19 Feb 2019 18:43:43 +0000 (18:43 +0000)]
Fix pr88850 test

Fix pr88850.c testcase which was failing in hardfp environments.

Committed as obvious.

    gcc/testsuite/
* gcc.target/arm/pr88850.c: Block -mfloat-abi override.

From-SVN: r269026

5 years agoMakefile.am: Avoid the -D option which is not available with the install-sh fallback.
Bernd Edlinger [Tue, 19 Feb 2019 18:21:26 +0000 (18:21 +0000)]
Makefile.am: Avoid the -D option which is not available with the install-sh fallback.

2019-02-19  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * src/Makefile.am: Avoid the -D option which is not available
        with the install-sh fallback.  Use $(MKDIR_P) instead.
        * libdruntime/Makefile.am: Likewise.
        * src/Makefile.in: Regenerated.
        * libdruntime/Makefile.in: Regenerated.

From-SVN: r269025

5 years agore PR fortran/89384 (CONTIGUOUS dummy argument in BIND(C) interface incorrect when...
Thomas Koenig [Tue, 19 Feb 2019 17:55:33 +0000 (17:55 +0000)]
re PR fortran/89384 (CONTIGUOUS dummy argument in BIND(C) interface incorrect when actual is non-contiguous)

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

PR fortran/89384
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): If the dummy
argument is contiguous and the actual argument may not be,
use gfc_conv_subref_array_arg.

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

PR fortran/89384
* gfortran.dg/ISO_Fortran_binding_4.f90

From-SVN: r269024

5 years agounwind-dw2.c (_Unwind_GetGR): Compare regno instead of index to DWARF_ZERO_REG.
Uros Bizjak [Tue, 19 Feb 2019 16:10:00 +0000 (17:10 +0100)]
unwind-dw2.c (_Unwind_GetGR): Compare regno instead of index to DWARF_ZERO_REG.

* unwind-dw2.c (_Unwind_GetGR) [DWARF_ZERO_REG]: Compare
regno instead of index to DWARF_ZERO_REG.

From-SVN: r269021

5 years ago[PR87924] OpenACC wait clauses without async-arguments: remove XFAILs
Thomas Schwinge [Tue, 19 Feb 2019 16:04:17 +0000 (17:04 +0100)]
[PR87924] OpenACC wait clauses without async-arguments: remove XFAILs

... which the recent r269016 didn't do.

gcc/testsuite/
PR c/87924
* c-c++-common/goacc/asyncwait-5.c: Remove XFAILs.
* gfortran.dg/goacc/asyncwait-5.f: Likewise.

From-SVN: r269020

5 years agore PR go/89169 (FAIL: internal/cpu)
Ian Lance Taylor [Tue, 19 Feb 2019 15:42:09 +0000 (15:42 +0000)]
re PR go/89169 (FAIL: internal/cpu)

PR go/89169
    internal/cpu: do not require POWER8

    Although the gc toolchain requires POWER8, the gccgo toolchain does not.

    Fixes https://gcc.gnu.org/PR89169

    Reviewed-on: https://go-review.googlesource.com/c/162979

From-SVN: r269019

5 years agoruntime: abort stack scan in cases that we cannot unwind the stack
Ian Lance Taylor [Tue, 19 Feb 2019 15:32:34 +0000 (15:32 +0000)]
runtime: abort stack scan in cases that we cannot unwind the stack

    In signal-triggered stack scan, if the signal is delivered at
    certain bad time (e.g. in vdso, or in the middle of setcontext?),
    the unwinder may not be able to unwind the whole stack, while it
    still reports _URC_END_OF_STACK. So we cannot rely on _URC_END_OF_STACK
    to tell if it successfully scanned the stack. Instead, we check
    the last Go frame to see it actually reached the end of the stack.
    For Go-created stack, this is runtime.kickoff. For C-created
    stack, we need to record the outermost Go frame when it enters
    the Go side.

    Also we cannot unwind the stack if the signal is delivered in the
    middle of runtime.gogo, halfway through a goroutine switch, where
    the g and the stack don't match. Give up in this case as well.

    Reviewed-on: https://go-review.googlesource.com/c/159098

From-SVN: r269018

5 years agoi386: Set ix86_fpmath to FPMATH_387 without SSE
H.J. Lu [Tue, 19 Feb 2019 14:19:33 +0000 (14:19 +0000)]
i386: Set ix86_fpmath to FPMATH_387 without SSE

ix86_fpmath should be set to combination of FPMATH_387 and FPMATH_SSE.
When SSE is disabled, it should be set to FPMATH_387 and 387 codegen is
also controlled by -msoft-float.

gcc/

PR target/89397
* config/i386/i386.c (ix86_option_override_internal): Set
opts->x_ix86_fpmath to FPMATH_387 when SSE is disabled.

gcc/testsuite/

PR target/89397
* gcc.target/i386/pr89397.c: New test.

From-SVN: r269017

5 years agore PR c/87924 (OpenACC wait clauses without async-arguments)
Chung-Lin Tang [Tue, 19 Feb 2019 14:10:15 +0000 (14:10 +0000)]
re PR c/87924 (OpenACC wait clauses without async-arguments)

2019-02-19  Chung-Lin Tang <cltang@codesourcery.com>

PR c/87924
gcc/c/
* c-parser.c (c_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.

gcc/cp/
* parser.c (cp_parser_oacc_clause_wait): Add representation of wait
clause without argument as 'wait (GOMP_ASYNC_NOVAL)', adjust comments.

gcc/fortran/
* openmp.c (gfc_match_omp_clauses): Add representation of wait clause
without argument as 'wait (GOMP_ASYNC_NOVAL)'.

libgomp/
* oacc-parallel.c (GOACC_parallel_keyed): Remove condition on call to
goacc_wait().
(goacc_wait): Handle ACC_ASYNC_NOVAL case, remove goacc_thread() call
and related adjustment.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r269016

5 years agore PR tree-optimization/88074 (g++ hangs on math expression)
Richard Biener [Tue, 19 Feb 2019 12:46:48 +0000 (12:46 +0000)]
re PR tree-optimization/88074 (g++ hangs on math expression)

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

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

* gcc.dg/pr88074.c: New testcase.

From-SVN: r269015

5 years agoFix libphobos.shared/load.d compile failure on Solaris
Iain Buclaw [Tue, 19 Feb 2019 12:38:48 +0000 (12:38 +0000)]
Fix libphobos.shared/load.d compile failure on Solaris

2019-02-19  Iain Buclaw  <ibuclaw@gdcproject.org>

* testsuite/libphobos.shared/load.d: Import core.sys.posix.dlfcn.
[DragonFlyBSD, FreeBSD, linux, NetBSD, OSX, Solaris]: Import only
RTLD_NOLOAD from core.sys.*.dlfcn.
Assert RTLD_NOLOAD is available.

From-SVN: r269014

5 years agortlanal.c (get_initial_register_offset): Fall back to the estimate as long as the...
Eric Botcazou [Tue, 19 Feb 2019 09:25:39 +0000 (09:25 +0000)]
rtlanal.c (get_initial_register_offset): Fall back to the estimate as long as the epilogue isn't completed.

* rtlanal.c (get_initial_register_offset): Fall back to the estimate
as long as the epilogue isn't completed.

From-SVN: r269013

5 years agoFix libphobos linking on Solaris 11
Rainer Orth [Tue, 19 Feb 2019 09:24:50 +0000 (09:24 +0000)]
Fix libphobos linking on Solaris 11

* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_NET): New macro.
* configure.ac: Invoke it.
* configure: Regenerate.

From-SVN: r269012

5 years agore PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_this)
Jakub Jelinek [Tue, 19 Feb 2019 08:57:24 +0000 (09:57 +0100)]
re PR middle-end/89303 (memory leak with shared_ptr and enable_shared_from_this)

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

From-SVN: r269010

5 years agore PR c++/89387 (ICE in maybe_generic_this_capture at gcc/cp/lambda.c:945 since r268851)
Jakub Jelinek [Tue, 19 Feb 2019 08:43:23 +0000 (09:43 +0100)]
re PR c++/89387 (ICE in maybe_generic_this_capture at gcc/cp/lambda.c:945 since r268851)

PR c++/89387
* lambda.c (maybe_generic_this_capture): Don't check
DECL_NONSTATIC_MEMBER_FUNCTION_P on USING_DECLs.

* g++.dg/cpp0x/lambda/lambda-89387.C: New test.

From-SVN: r269009

5 years agore PR c++/89391 (ICE in build_target_expr_with_type, at cp/tree.c:795)
Jakub Jelinek [Tue, 19 Feb 2019 08:40:07 +0000 (09:40 +0100)]
re PR c++/89391 (ICE in build_target_expr_with_type, at cp/tree.c:795)

PR c++/89391
* typeck.c (build_reinterpret_cast_1): Don't handle void to
&& conversion go through build_target_expr_with_type.

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

From-SVN: r269008

5 years agore PR c++/89390 (ICE in get_string, at spellcheck-tree.h:46)
Jakub Jelinek [Tue, 19 Feb 2019 08:38:54 +0000 (09:38 +0100)]
re PR c++/89390 (ICE in get_string, at spellcheck-tree.h:46)

PR c++/89390
* error.c (qualified_name_lookup_error): Only call
suggest_alternative_in_scoped_enum if name is IDENTIFIER_NODE.

* g++.dg/diagnostic/pr89390.C: New test.

From-SVN: r269007

5 years agoAdjust C++11/C++14 tests to work with -fchar8_t
Jonathan Wakely [Tue, 19 Feb 2019 02:55:12 +0000 (02:55 +0000)]
Adjust C++11/C++14 tests to work with -fchar8_t

* testsuite/21_strings/basic_string/literals/types.cc
[_GLIBCXX_USE_CHAR8_T]: Adjust expected string type for u8 literal.
* testsuite/21_strings/basic_string/literals/values.cc
[_GLIBCXX_USE_CHAR8_T]: Likewise.
* testsuite/22_locale/codecvt/char16_t.cc: Adjust for u8 literals
potentially having different type.
* testsuite/22_locale/codecvt/char32_t.cc: Likewise.
* testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: Cast u8 literal
to char.
* testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc: Likewise.
* testsuite/22_locale/codecvt/utf8.cc: Likewise.
* testsuite/22_locale/conversions/string/2.cc: Remove u8 prefix from
string literals only using basic character set.
* testsuite/22_locale/conversions/string/3.cc: Likewise. Cast other
u8 literals to char.
* testsuite/29_atomics/headers/atomic/macros.cc [_GLIBCXX_USE_CHAR8_T]:
Test ATOMIC_CHAR8_T_LOCK_FREE.
Add missing #error to ATOMIC_CHAR16_T_LOCK_FREE test.
* testsuite/29_atomics/headers/atomic/types_std_c++0x.cc
[_GLIBCXX_USE_CHAR8_T]: Check for std::atomic_char8_t.
* testsuite/experimental/string_view/literals/types.cc
[_GLIBCXX_USE_CHAR8_T]: Adjust expected string_view type for u8
literal.
* testsuite/experimental/string_view/literals/values.cc
[_GLIBCXX_USE_CHAR8_T]: Likewise.

From-SVN: r269006

5 years agoP0482R5 char8_t: New standard library tests
Tom Honermann [Tue, 19 Feb 2019 02:55:05 +0000 (02:55 +0000)]
P0482R5 char8_t: New standard library tests

2019-02-19  Tom Honermann  <tom@honermann.net>

* testsuite/18_support/numeric_limits/char8_t.cc: New test cloned
from char16_32_t.cc; validates numeric_limits<char8_t>.
* testsuite/21_strings/basic_string/literals/types-char8_t.cc: New
test cloned from types.cc; validates operator""s for char8_t
returns u8string.
* testsuite/21_strings/basic_string/literals/values-char8_t.cc: New
test cloned from values.cc; validates construction and comparison
of u8string values.
* testsuite/21_strings/basic_string/requirements/
/explicit_instantiation/char8_t/1.cc: New test cloned from
char16_t/1.cc; validates explicit instantiation of
basic_string<char8_t>.
* testsuite/21_strings/basic_string_view/literals/types-char8_t.cc:
New test cloned from types.cc; validates operator""sv for char8_t
returns u8string_view.
* testsuite/21_strings/basic_string_view/literals/
values-char8_t.cc: New test cloned from values.cc; validates
construction and comparison of u8string_view values.
* testsuite/21_strings/basic_string_view/requirements/
explicit_instantiation/char8_t/1.cc: New test cloned from
char16_t/1.cc; validates explicit instantiation of
basic_string_view<char8_t>.
* testsuite/21_strings/char_traits/requirements/char8_t/65049.cc:
New test cloned from char16_t/65049.cc; validates that
char_traits<char8_t> is not vulnerable to the concerns in PR65049.
* testsuite/21_strings/char_traits/requirements/char8_t/
typedefs.cc: New test cloned from char16_t/typedefs.cc; validates
that char_traits<char8_t> member typedefs are present and correct.
* testsuite/21_strings/char_traits/requirements/
explicit_instantiation/char8_t/1.cc: New test cloned from
char16_t/1.cc; validates explicit instantiation of
char_traits<char8_t>.
* testsuite/22_locale/codecvt/char16_t-char8_t.cc: New test cloned
from char16_t.cc: validates
codecvt<char16_t, char8_t, mbstate_t>.
* testsuite/22_locale/codecvt/char32_t-char8_t.cc: New test cloned
from char32_t.cc: validates
codecvt<char32_t, char8_t, mbstate_t>.
* testsuite/22_locale/codecvt/utf8-char8_t.cc: New test cloned from
utf8.cc; validates codecvt<char16_t, char8_t, std::mbstate_t> and
codecvt<char32_t, char8_t, std::mbstate_t>.
* testsuite/27_io/filesystem/path/native/string-char8_t.cc: New
test cloned from string.cc; validates filesystem::path construction
from char8_t input.
* testsuite/experimental/feat-char8_t.cc: New test; validates that
the __cpp_lib_char8_t feature test macro is defined with the
correct value.
* testsuite/experimental/filesystem/path/native/string-char8_t.cc:
New test cloned from string.cc; validates filesystem::path
construction from char8_t input.
* testsuite/experimental/string_view/literals/types-char8_t.cc: New
test cloned from types.cc; validates operator""sv for char8_t
returns u8string_view.
* testsuite/experimental/string_view/literals/values-char8_t.cc:
New test cloned from values.cc; validates construction and
comparison of u8string_view values.
* testsuite/experimental/string_view/requirements/
explicit_instantiation/char8_t/1.cc: New test cloned from
char16_t/1.cc; validates explicit instantiation of
basic_string_view<char8_t>.
* testsuite/ext/char8_t/atomic-1.cc: New test; validates that
ATOMIC_CHAR8_T_LOCK_FREE is not defined if char8_t support is not
enabled.

From-SVN: r269005

5 years agoP0482R5 char8_t: Standard library support
Tom Honermann [Tue, 19 Feb 2019 02:54:42 +0000 (02:54 +0000)]
P0482R5 char8_t: Standard library support

gcc/cp:

2019-02-19  Tom Honermann  <tom@honermann.net>

* name-lookup.c (get_std_name_hint): Added u8string as a name hint.

libstdc++:

2019-02-19  Tom Honermann  <tom@honermann.net>

P0482R5 char8_t: Standard library support
* config/abi/pre/gnu-versioned-namespace.ver (CXXABI_2.0): Add
typeinfo symbols for char8_t.
* config/abi/pre/gnu.ver: Add CXXABI_1.3.12.
(GLIBCXX_3.4.26): Add symbols for specializations of
numeric_limits and codecvt that involve char8_t.
(CXXABI_1.3.12): Add typeinfo symbols for char8_t.
* include/bits/atomic_base.h: Add atomic_char8_t.
* include/bits/basic_string.h: Add std::hash<u8string> and
operator""s(const char8_t*, size_t).
* include/bits/c++config: Define _GLIBCXX_USE_CHAR8_T and
__cpp_lib_char8_t.
* include/bits/char_traits.h: Add char_traits<char8_t>.
* include/bits/codecvt.h: Add
codecvt<char16_t, char8_t, mbstate_t>,
codecvt<char32_t, char8_t, mbstate_t>,
codecvt_byname<char16_t, char8_t, mbstate_t>, and
codecvt_byname<char32_t, char8_t, mbstate_t>.
* include/bits/cpp_type_traits.h: Add __is_integer<char8_t> to
recognize char8_t as an integral type.
* include/bits/fs_path.h: (path::__is_encoded_char): Recognize
char8_t.
(path::u8string): Return std::u8string when char8_t support is
enabled.
(path::generic_u8string): Likewise.
(path::_S_convert): Handle conversion from char8_t input.
(path::_S_str_convert): Likewise.
* include/bits/functional_hash.h: Add hash<char8_t>.
* include/bits/locale_conv.h (__str_codecvt_out): Add overloads for
char8_t.
* include/bits/locale_facets.h (_GLIBCXX_NUM_UNICODE_FACETS): Bump
for new char8_t specializations.
* include/bits/localefwd.h: Add missing declarations of
codecvt<char16_t, char, mbstate_t> and
codecvt<char32_t, char, mbstate_t>.  Add char8_t declarations
codecvt<char16_t, char8_t, mbstate_t> and
codecvt<char32_t, char8_t, mbstate_t>.
* include/bits/postypes.h: Add u8streampos
* include/bits/stringfwd.h: Add declarations of
char_traits<char8_t> and u8string.
* include/c_global/cstddef: Add __byte_operand<char8_t>.
* include/experimental/bits/fs_path.h (path::__is_encoded_char):
Recognize char8_t.
(path::u8string): Return std::u8string when char8_t support is
enabled.
(path::generic_u8string): Likewise.
(path::_S_convert): Handle conversion from char8_t input.
(path::_S_str_convert): Likewise.
* include/experimental/string: Add u8string.
* include/experimental/string_view: Add u8string_view,
hash<experimental::u8string_view>, and
operator""sv(const char8_t*, size_t).
* include/std/atomic: Add atomic<char8_t> and atomic_char8_t.
* include/std/charconv (__is_int_to_chars_type): Recognize char8_t
as a character type.
* include/std/limits: Add numeric_limits<char8_t>.
* include/std/string_view: Add u8string_view,
hash<experimental::u8string_view>, and
operator""sv(const char8_t*, size_t).
* include/std/type_traits: Add __is_integral_helper<char8_t>,
__make_unsigned<char8_t>, and __make_signed<char8_t>.
* libsupc++/atomic_lockfree_defines.h: Define
ATOMIC_CHAR8_T_LOCK_FREE.
* src/c++11/Makefile.am: Compile with -fchar8_t when compiling
codecvt.cc and limits.cc so that char8_t specializations of
numeric_limits and codecvt and emitted.
* src/c++11/Makefile.in: Likewise.
* src/c++11/codecvt.cc: Define members of
codecvt<char16_t, char8_t, mbstate_t>,
codecvt<char32_t, char8_t, mbstate_t>,
codecvt_byname<char16_t, char8_t, mbstate_t>, and
codecvt_byname<char32_t, char8_t, mbstate_t>.
* src/c++11/limits.cc: Define members of
numeric_limits<char8_t>.
* src/c++98/Makefile.am: Compile with -fchar8_t when compiling
locale_init.cc and localename.cc.
* src/c++98/Makefile.in: Likewise.
* src/c++98/locale_init.cc: Add initialization for the
codecvt<char16_t, char8_t, mbstate_t> and
codecvt<char32_t, char8_t, mbstate_t> facets.
* src/c++98/localename.cc: Likewise.
* testsuite/util/testsuite_abi.cc: Validate ABI bump.

From-SVN: r269004

5 years agoPR c++/89336 - multiple stores in constexpr stmt.
Jason Merrill [Tue, 19 Feb 2019 01:01:50 +0000 (20:01 -0500)]
PR c++/89336 - multiple stores in constexpr stmt.

If we evaluate the RHS in the context of the LHS, that evaluation might
change the LHS in ways that mess with being able to store the value later.
So for assignment or scalar values, evaluate the RHS first.

* constexpr.c (cxx_eval_store_expression): Preevaluate scalar or
assigned value.

From-SVN: r269003

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

From-SVN: r269002

5 years agolibphobos: Detect if qsort_r is available
Johannes Pfau [Mon, 18 Feb 2019 23:29:39 +0000 (23:29 +0000)]
libphobos: Detect if qsort_r is available

Merges upstream druntime bbfb58e8.

libphobos/ChangeLog:

2019-02-19  Johannes Pfau  <johannespfau@gmail.com>

PR d/88127
* m4/druntime/libraries.m4 (DRUNTIME_LIBRARIES_CLIB): Add new macro.
* configure.ac: Use DRUNTIME_LIBRARIES_CLIB.
* configure: Regenerate
* Makefile.in: Regenerate
* libdruntime/gcc/config.d.in: Add Have_Qsort_R.
* libdruntime/Makefile.in: Regenerate.
* src/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.

From-SVN: r268999

5 years ago* fr.po: Update.
Joseph Myers [Mon, 18 Feb 2019 23:16:00 +0000 (23:16 +0000)]
* fr.po: Update.

From-SVN: r268998

5 years agoImprove diagnostic for redundant template arguments in declaration.
Jason Merrill [Mon, 18 Feb 2019 21:35:48 +0000 (16:35 -0500)]
Improve diagnostic for redundant template arguments in declaration.

* pt.c (check_explicit_specialization): If the declarator is a
template-id, only check whether the arguments are dependent.

From-SVN: r268997

5 years agoREADME: Fix typos.
Sharon Dvir [Mon, 18 Feb 2019 21:10:57 +0000 (21:10 +0000)]
README: Fix typos.

2019-02-18  Sharon Dvir  <unapologtic@gmail.com>

gcc/testsuite/
* README: Fix typos.

From-SVN: r268996

5 years agoFix g++.dg/torture/pr89303.C with Solaris ld
Rainer Orth [Mon, 18 Feb 2019 20:25:55 +0000 (20:25 +0000)]
Fix g++.dg/torture/pr89303.C with Solaris ld

* g++.dg/torture/pr89303.C (bad_weak_ptr): Rename to
bad_weak_ptr_.

From-SVN: r268995

5 years agoImprove duplicate [[likely]] diagnostic.
Jason Merrill [Mon, 18 Feb 2019 19:34:02 +0000 (14:34 -0500)]
Improve duplicate [[likely]] diagnostic.

* parser.c (cp_parser_statement): Make attrs_loc a range.  Pass it
to process_stmt_hotness_attribute.
* cp-gimplify.c (process_stmt_hotness_attribute): Take attrs_loc.
(genericize_if_stmt): Use likely/unlikely instead of predictor_name.

From-SVN: r268994

5 years agocpp.texi (Conditional syntax): Add __has_attribute, __has_cpp_attribute, and __has_in...
Martin Sebor [Mon, 18 Feb 2019 18:37:55 +0000 (18:37 +0000)]
cpp.texi (Conditional syntax): Add __has_attribute, __has_cpp_attribute, and __has_include.

gcc/ChangeLog:

* doc/cpp.texi (Conditional syntax): Add __has_attribute,
__has_cpp_attribute, and __has_include.

From-SVN: r268993

5 years agore PR fortran/87689 (PowerPC64 ELFv2 function parameter passing violation)
Thomas Koenig [Mon, 18 Feb 2019 18:28:58 +0000 (18:28 +0000)]
re PR fortran/87689 (PowerPC64 ELFv2 function parameter passing violation)

2019-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/87689
    * trans-decl.c (gfc_get_extern_function_decl): Add argument
    actual_args and pass it through to gfc_get_function_type.
    * trans-expr.c (conv_function_val): Add argument actual_args
    and pass it on to gfc_get_extern_function_decl.
    (conv_procedure_call): Pass actual arguments to conv_function_val.
    * trans-types.c (get_formal_from_actual_arglist): New function.
    (gfc_get_function_type): Add argument actual_args.  Generate
    formal args from actual args if necessary.
    * trans-types.h (gfc_get_function_type): Add optional argument.
    * trans.h (gfc_get_extern_function_decl): Add optional argument.

2019-02-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

    PR fortran/87689
    * gfortran.dg/lto/20091028-1_0.f90: Add -Wno-lto-type-mismatch to
    options.
    * gfortran.dg/lto/20091028-2_0.f90: Likewise.
    * gfortran.dg/lto/pr87689_0.f: New file.
    * gfortran.dg/lto/pr87689_1.f: New file.

From-SVN: r268992

5 years agoinvoke.texi (-Wreturn-type): Correct and expand.
Martin Sebor [Mon, 18 Feb 2019 17:44:11 +0000 (17:44 +0000)]
invoke.texi (-Wreturn-type): Correct and expand.

gcc/ChangeLog:

* doc/invoke.texi (-Wreturn-type): Correct and expand.

From-SVN: r268991

5 years agoPR middle-end/89294 - ICE in valid_constant_size_p
Martin Sebor [Mon, 18 Feb 2019 16:31:17 +0000 (16:31 +0000)]
PR middle-end/89294 - ICE in valid_constant_size_p

gcc/c-family/ChangeLog:

PR middle-end/89294
* c-common.c (invalid_array_size_error): Handle cst_size_not_constant.

gcc/ChangeLog:

PR middle-end/89294
* tree.c (valid_constant_size_p): Avoid assuming size is a constant
expression.
* tree.h (cst_size_error): Add the cst_size_not_constant enumerator.

From-SVN: r268990

5 years agoFix libstdc++ filesystem tests
Wilco Dijkstra [Mon, 18 Feb 2019 14:09:17 +0000 (14:09 +0000)]
Fix libstdc++ filesystem tests

Some recently added libstdc++ filesystem tests are missing a
dg-require-filesystem-ts.

Committed as obvious.

    libstdc++/testsuite/
* 27_io/filesystem/operations/all.cc: Add dg-require-filesystem-ts.
* 27_io/filesystem/operations/resize_file.cc: Likewise.
* 27_io/filesystem/path/generation/normal2.cc: Likewise.

From-SVN: r268989

5 years agoFix test pr88680.C
Wilco Dijkstra [Mon, 18 Feb 2019 14:06:49 +0000 (14:06 +0000)]
Fix test pr88680.C

Fix pr88680.C failures due to short enums on arm-none-eabi.

Committed as obvious.

    gcc/testsuite/
* g++.dg/wrappers/pr88680.C: Add -fno-short-enums.

From-SVN: r268988

5 years agoTabify all D *.exp files
Rainer Orth [Mon, 18 Feb 2019 13:53:51 +0000 (13:53 +0000)]
Tabify all D *.exp files

libphobos:
* testsuite/lib/libphobos-dg.exp: Tabify.
* testsuite/lib/libphobos.exp: Likewise.
* testsuite/libphobos.cycles/cycles.exp: Likewise.
* testsuite/libphobos.shared/shared.exp: Likewise.
* testsuite/libphobos.unittests/unittests.exp: Likewise.

gcc/testsuite:
* gdc.dg/dg.exp: Tabify.
* gdc.dg/lto/lto.exp: Likewise.
* gdc.test/gdc-test.exp: Likewise.
* lib/gdc-dg.exp: Likewise.
* lib/gdc.exp: Likewise.

From-SVN: r268987

5 years agore PR tree-optimization/89296 (tree copy-header masking uninitialized warning)
Richard Biener [Mon, 18 Feb 2019 12:56:15 +0000 (12:56 +0000)]
re PR tree-optimization/89296 (tree copy-header masking uninitialized warning)

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.

From-SVN: r268986

5 years agore PR bootstrap/88714 (bootstrap comparison failure on armv7l since r265398)
Jakub Jelinek [Mon, 18 Feb 2019 12:52:36 +0000 (13:52 +0100)]
re PR bootstrap/88714 (bootstrap comparison failure on armv7l since r265398)

PR bootstrap/88714
* config/arm/arm.md (*arm_movdi, *movdf_soft_insn): Use "r" instead of
"q" constraint.
* config/arm/vfp.md (*movdi_vfp): Likewise.
* config/arm/ldrdstrd.md (*arm_ldrd, *arm_strd): Use "r" instead of
"q" constraint for operands[0].

From-SVN: r268985

5 years agore PR target/89369 (pseudo-RNG miscompiled on s390x-linux with -O2 -march=zEC12 ...
Jakub Jelinek [Mon, 18 Feb 2019 11:20:43 +0000 (12:20 +0100)]
re PR target/89369 (pseudo-RNG miscompiled on s390x-linux with -O2 -march=zEC12 -mtune=z13 starting with r266203)

PR target/89369
* config/s390/s390.md (*r<noxa>sbg_<mode>_srl_bitmask,
*r<noxa>sbg_<mode>_sll, *r<noxa>sbg_<mode>_srl): Don't construct
pattern in a temporary buffer.
(*r<noxa>sbg_sidi_srl): Likewise.  Always use 32 as I3 rather
than 64-operands[2].

* gcc.c-torture/execute/pr89369.c: New test.
* gcc.target/s390/md/rXsbg_mode_sXl.c (rosbg_si_srl,
rxsbg_si_srl): Expect last 3 operands 32,63,62 rather than
34,63,62.

From-SVN: r268984

5 years agore PR target/89361 (s390 broken without S390_USE_TARGET_ATTRIBUTE, likely since r257489)
Jakub Jelinek [Mon, 18 Feb 2019 11:16:33 +0000 (12:16 +0100)]
re PR target/89361 (s390 broken without S390_USE_TARGET_ATTRIBUTE, likely since r257489)

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

From-SVN: r268983

5 years ago* config/s390/s390.md (*<risbg_n>_ior_and_sr_ze,
Jakub Jelinek [Mon, 18 Feb 2019 10:08:04 +0000 (11:08 +0100)]
* config/s390/s390.md (*<risbg_n>_ior_and_sr_ze,

*<risbg_n>_<mode>_ior_and_lshiftrt, *<risbg_n>_sidi_ior_and_lshiftrt):
Use HOST_WIDE_INT_M1U instead of ~(0ULL).
(*<risbg_n>_and_subregdi_rotr, *<risbg_n>_and_subregdi_rotl): Use
HOST_WIDE_INT_1U instead of 1ULL.
(*pre_z10_extzv<mode>, *pre_z10_extv<mode>): Change mask type from int
to unsigned HOST_WIDE_INT, use HOST_WIDE_INT_1U instead of 1ul.
(*insv<mode><clobbercc_or_nocc>_appendbitsleft,
z = (x << c) | (y >> d) splitters): Use HOST_WIDE_INT_1U
instead of 1UL.
(*insv<mode>_mem_reg, *insvdi_mem_reghigh): Use HOST_WIDE_INT_1U
instead of 1ul.

From-SVN: r268982

5 years agoUse 1UL constant in order to not overflow (PR c++/89383).
Martin Liska [Mon, 18 Feb 2019 09:46:19 +0000 (10:46 +0100)]
Use 1UL constant in order to not overflow (PR c++/89383).

2019-02-18  Martin Liska  <mliska@suse.cz>

PR c++/89383
* line-map.c (linemap_line_start): Use 1UL in order
to not overflow.

From-SVN: r268981

5 years ago[PR 89209] Avoid segfault in a peculiar corner case in SRA
Martin Jambor [Mon, 18 Feb 2019 08:59:04 +0000 (09:59 +0100)]
[PR 89209] Avoid segfault in a peculiar corner case in SRA

2019-02-18  Martin Jambor  <mjambor@suse.cz>

PR tree-optimization/89209
* tree-sra.c (create_access_replacement): New optional parameter
reg_tree.  Use it as a type if non-NULL and access type is not of
a register type.
(get_repl_default_def_ssa_name): New parameter REG_TYPE, pass it
to create_access_replacement.
(sra_modify_assign): Pass LHS type to get_repl_default_def_ssa_name.
Check lacc is non-NULL before attempting to re-create it on the RHS.

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

From-SVN: r268980

5 years agoCome up with fast {function,call}_summary classes (PR ipa/89306).
Martin Liska [Mon, 18 Feb 2019 08:21:23 +0000 (09:21 +0100)]
Come up with fast {function,call}_summary classes (PR ipa/89306).

2019-02-18  Martin Liska  <mliska@suse.cz>

PR ipa/89306
* cgraph.c (symbol_table::create_edge): Set m_summary_id to -1
by default.
(symbol_table::free_edge): Recycle m_summary_id.
* cgraph.h (get_summary_id): New.
(symbol_table::release_symbol): Set m_summary_id to -1
by default.
(symbol_table::allocate_cgraph_symbol): Recycle m_summary_id.
* ipa-fnsummary.c (ipa_fn_summary_t): Switch from
function_summary to fast_function_summary.
* ipa-fnsummary.h (ipa_fn_summary_t): Likewise.
* ipa-pure-const.c (class funct_state_summary_t):
Switch from function_summary to fast_function_summary.
* ipa-reference.c (class ipa_ref_var_info_summary_t): Likewise.
(class ipa_ref_opt_summary_t): Switch from function_summary
to fast_function_summary.
* symbol-summary.h (class function_summary_base): New class
that is created from base of former function_summary.
(function_summary_base::unregister_hooks): New.
(class function_summary): Inherit from function_summary_base.
(class call_summary_base): New class
that is created from base of former call_summary.
(class call_summary): Inherit from call_summary_base.
(struct is_same): New.
(class fast_function_summary): New summary class.
(class fast_call_summary): New summary class.
* vec.h (vec_safe_grow_cleared): New function.

From-SVN: r268979

5 years agoSupport if statement in !GCC$ builtin directive.
Martin Liska [Mon, 18 Feb 2019 08:19:47 +0000 (09:19 +0100)]
Support if statement in !GCC$ builtin directive.

2019-02-18  Martin Liska  <mliska@suse.cz>

* config/i386/i386.c (ix86_get_multilib_abi_name): New function.
(TARGET_GET_MULTILIB_ABI_NAME): New macro defined.
* doc/tm.texi: Document new target hook.
* doc/tm.texi.in: Likewise.
* target.def: Add new target macro.
* gcc.c (find_fortran_preinclude_file): Do not search multilib
suffixes.
2019-02-18  Martin Liska  <mliska@suse.cz>

* decl.c (gfc_match_gcc_builtin): Add support for filtering
of builtin directive based on multilib ABI name.
2019-02-18  Martin Liska  <mliska@suse.cz>

* gfortran.dg/simd-builtins-7.f90: New test.
* gfortran.dg/simd-builtins-7.h: New test.

From-SVN: r268978

5 years agoDaily bump.
GCC Administrator [Mon, 18 Feb 2019 00:17:08 +0000 (00:17 +0000)]
Daily bump.

From-SVN: r268977

5 years agore PR fortran/88299 ([F18] COMMON in a legacy module produces bogus warnings in depen...
Harald Anlauf [Sun, 17 Feb 2019 21:19:20 +0000 (21:19 +0000)]
re PR fortran/88299 ([F18] COMMON in a legacy module produces bogus warnings in dependent code)

2019-02-17  Harald Anlauf  <anlauf@gmx.de>

PR fortran/88299
* resolve.c (resolve_common_blocks,resolve_common_vars): Move
check for obsolent COMMON feature in F2018 to better place.

PR fortran/88299
* gfortran.dg/pr88299.f90: New test.

From-SVN: r268974

5 years agore PR fortran/89077 (ICE using * as len specifier for character parameter)
Harald Anlauf [Sun, 17 Feb 2019 21:14:14 +0000 (21:14 +0000)]
re PR fortran/89077 (ICE using * as len specifier for character parameter)

2019-02-17  Harald Anlauf  <anlauf@gmx.de>

PR fortran/89077
* decl.c (gfc_set_constant_character_len): Clear original string
representation after padding has been performed to target length.

PR fortran/89077
* gfortran.dg/transfer_simplify_12.f90: New test.

From-SVN: r268973

5 years agore PR c++/89356 (sorry, unimplemented: mangling implicit_conv_expr in nodejs8 package...
Marek Polacek [Sun, 17 Feb 2019 17:53:54 +0000 (17:53 +0000)]
re PR c++/89356 (sorry, unimplemented: mangling implicit_conv_expr in nodejs8 package since r268321)

PR c++/89356
* g++.dg/abi/mangle68.C: New test.
* g++.dg/cpp0x/decltype69.C: New test.

From-SVN: r268972

5 years agore PR c++/89315 (Cannot convert to std::initializer_list - fails with gcc9 works...
Marek Polacek [Sun, 17 Feb 2019 17:25:27 +0000 (17:25 +0000)]
re PR c++/89315 (Cannot convert to std::initializer_list - fails with gcc9 works with gcc8)

PR c++/89315
* g++.dg/cpp0x/initlist114.C: New test.

From-SVN: r268971