Commit Graph

167070 Commits

Author SHA1 Message Date
Thomas Schwinge
2263c9f24f [C, C++] Use correct location information for OpenACC shape and simple clauses
gcc/c/
	* c-parser.c (c_parser_oacc_shape_clause): Add loc formal
	parameter.  Adjust all users.
	(c_parser_oacc_simple_clause): Replace parser with loc formal
	parameter.  Adjust all users.
	gcc/cp/
	* parser.c (cp_parser_oacc_simple_clause): Remove parser formal
	parameter, move loc formal parameter to the front.  Adjust all
	users.
	(cp_parser_oacc_shape_clause): Add loc formal parameter.  Adjust
	all users.

From-SVN: r269102
2019-02-22 11:49:43 +01:00
Kyrylo Tkachov
81a5f36d66 [arm] Add support for Neoverse N1
This patch adds support for the Neoverse N1 [1]. This CPU was previously supported through the Ares codename.
-mcpu=ares is retained as an alias of the new -mcpu=neoverse-n1.

Bootstrapped and tested on arm-none-linux-gnueabihf. 

	* config/arm/arm-cpus.in (ares): Rename to...
	(neoverse-n1): ... This.  Add ares as alias.
	* config/arm/arm-tables.opt: Regenerate.
	* config/arm/arm-tune.md: Likewise.
	* doc/invoke.txt (ARM Options): Document neoverse-n1.

From-SVN: r269101
2019-02-22 08:59:20 +00:00
Kyrylo Tkachov
3f23539cff [AArch64] Add support for Neoverse E1
This patch adds -mcpu and -mtune support for the Neoverse E1 CPU [1].
The new option is -mcpu=neoverse-e1.
Bootstrapped and tested on aarch64-none-linux-gnu. 

	* config/aarch64/aarch64-cores.def (neoverse-e1): Define.
	* config/aarch64/aarch64-tune.md: Regenerate.
	* doc/invoke.texi (AArch64 Options): Document neoverse-e1 -mcpu option.

From-SVN: r269100
2019-02-22 08:58:04 +00:00
Kyrylo Tkachov
9ed6834dea [AArch64] Add support for Neoverse N1
This patch adds support for the Neoverse N1 CPU [1]. This was supported in GCC earlier through the codename Ares,
which it now replaces. -mcpu=ares is still accepted as there's been a binutils release supporting it,
but the internal structures are renamed to use Neoverse N1-related identifiers.

Bootstrapped and tested on aarch64-none-linux-gnu.


	* config/aarch64/aarch64.c (ares_tunings): Rename to...
	(neoversen1_tunings): ... This.
	* config/aarch64/aarch64-cores.def (ares): Change tuning to the above.
	(neoverse-n1): New CPU.
	* config/aarch64/aarch64-tune.md: Regenerate.
	* doc/invoke.txt (AArch64 Options): Document neoverse-n1.

From-SVN: r269099
2019-02-22 08:56:50 +00:00
Richard Biener
229d576cde re PR tree-optimization/87609 (miscompilation with restrict and loop)
2019-02-22  Richard Biener  <rguenther@suse.de>

	PR middle-end/87609
	* cfghooks.h (dependence_hash): New typedef.
	(struct copy_bb_data): New type.
	(cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument.
	(duplicate_block): Likewise.
	* cfghooks.c (duplicate_block): Pass down copy_bb_data.
	(copy_bbs): Create and pass down copy_bb_data.
	* cfgrtl.c (cfg_layout_duplicate_bb): Adjust.
	(rtl_duplicate_bb): Likewise.
	* tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL
	remap dependence info.

	* gcc.dg/torture/restrict-7.c: New testcase.

From-SVN: r269098
2019-02-22 08:38:14 +00:00
Richard Biener
3c8b06dcc6 re PR tree-optimization/87609 (miscompilation with restrict and loop)
2019-02-22  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/87609
	* tree-core.h (tree_base): Document special clique values.
	* tree-inline.c (remap_dependence_clique): Do not use the
	special clique value of one.
	(maybe_set_dependence_info): Use clique one.
	(clear_dependence_clique): New callback.
	(compute_dependence_clique): Clear clique one from all refs
	before assigning it (again).

From-SVN: r269097
2019-02-22 08:36:30 +00:00
Eric Botcazou
406e490892 configure.host (abi_baseline_pair): Adjust for SPARC64/Linux.
* configure.host (abi_baseline_pair): Adjust for SPARC64/Linux.
	* config/abi/post/sparc64-linux-gnu: New directory.
	* config/abi/post/sparc64-linux-gnu/baseline_symbols.txt: New file.
	* config/abi/post/sparc64-linux-gnu/32: New directory.
	* config/abi/post/sparc64-linux-gnu/32/baseline_symbols.txt: New file.

From-SVN: r269096
2019-02-22 07:25:52 +00:00
Jason Merrill
9adf74a36e PR c++/87685 - generic lambda 'this' capture error.
The standard says that in a generic lambda we should speculatively capture
'this' if we see a call to an overload set that contains a non-static member
function, but it seems wrong to reject the program if we can't capture,
since it might not actually be needed.

	* lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
	(maybe_generic_this_capture): Pass -1.

From-SVN: r269095
2019-02-22 01:47:37 -05:00
Jason Merrill
d36b4bf752 PR c++/88394 - ICE with VLA init-capture.
We mostly use is_normal_capture_proxy to decide whether or not to use
DECL_CAPTURED_VARIABLE; we could just check whether it's set.  VLA capture
is still mostly broken, but this fixes this ICE.

	* lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.

From-SVN: r269094
2019-02-21 21:47:33 -05:00
Jason Merrill
c8b7e64d36 PR c++/88869 - C++17 ICE with CTAD and explicit specialization.
The members of an explicit specialization of a class template don't have the
template parameters of that class template, so we shouldn't try to provide
arguments for them.  Only set outer_args when the class is an instantiation.

	* pt.c (do_class_deduction): Don't include explicit specialization
	args in outer_args.

From-SVN: r269093
2019-02-21 21:08:05 -05:00
Jonathan Wakely
148864cb8c Add tests for C++2a content of <atomic> header
* testsuite/29_atomics/headers/atomic/types_std_c++20.cc: New test.
	* testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc: New
	test.

From-SVN: r269091
2019-02-22 01:16:15 +00:00
Tom Honermann
5940bb028b P0482R5 char8_t: Updates to gdb pretty printing support
This patch adds recognition of the u8string and u8string_view type
aliases to the gdb pretty printer extension.

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

	* python/libstdcxx/v6/printers.py (register_type_printers): Add type
	printers for u8string and u8string_view.

From-SVN: r269090
2019-02-22 01:16:11 +00:00
Tom Honermann
59019b4223 P0482R5 char8_t: Updates to existing standard library tests
This patch augments existing tests to validate behavior for char8_t.  In
all cases, added test cases are cloned from existing tests for wchar_t
or char16_t.

A few tests required updates to line numbers for diagnostic messages.

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

	* testsuite/18_support/byte/ops.cc: Validate
	std::to_integer<char8_t>, std::to_integer<char16_t>, and
	std::to_integer<char32_t>.
	* testsuite/18_support/numeric_limits/dr559.cc: Validate
	std::numeric_limits<char8_t>.
	* testsuite/18_support/numeric_limits/lowest.cc: Validate
	std::numeric_limits<char8_t>::lowest().
	* testsuite/18_support/numeric_limits/max_digits10.cc: Validate
	std::numeric_limits<char8_t>::max_digits10.
	* testsuite/18_support/type_info/fundamental.cc: Validate
	typeinfo for char8_t.
	* testsuite/20_util/from_chars/1_c++20_neg.cc: New test, validating
	std::from_chars with char8_t.
	* testsuite/20_util/hash/requirements/explicit_instantiation.cc:
	Validate explicit instantiation of std::hash<char8_t>.
	* testsuite/20_util/is_integral/value.cc: Validate
	std::is_integral<char8_t>.
	* testsuite/20_util/make_signed/requirements/typedefs-4.cc:
	Validate std::make_signed<char8_t>.
	* testsuite/21_strings/basic_string/cons/char/deduction.cc:
	Validate u8string construction from char8_t sources.
	* testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Validate
	std::pmr::u8string.
	* testsuite/21_strings/basic_string_view/operations/compare/
	char/70483.cc: Validate substr operations on u8string_view.
	* testsuite/21_strings/basic_string_view/typedefs.cc: Validate that
	the u8string_view typedef is defined.
	* testsuite/21_strings/char_traits/requirements/
	constexpr_functions.cc: Validate char_traits<char8_t> constexpr
	member functions.
	* testsuite/21_strings/char_traits/requirements/
	constexpr_functions_c++17.cc: Validate char_traits<char8_t> C++17
	constexpr member functions.
	* testsuite/21_strings/headers/string/types_std_c++0x.cc: Validate
	that the u8string typedef is defined.
	* testsuite/22_locale/locale/cons/unicode.cc: Validate the presence
	of the std::codecvt<char16_t, char8_t, std::mbstate_t> and
	std::codecvt<char32_t, char8_t, std::mbstate_t> facets.
	* testsuite/29_atomics/atomic/cons/assign_neg.cc: Update line
	numbers.
	* testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
	* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc:
	Likewise.
	* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
	* testsuite/29_atomics/atomic_integral/is_always_lock_free.cc:
	Validate std::atomic<char8_t>::is_always_lock_free
	* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc:
	Update line numbers.
	* testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc:
	Likewise.
	* testsuite/29_atomics/atomic_integral/operators/increment_neg.cc:
	Likewise.
	* testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc:
	Validate std::experimental::pmr::u8string.
	* testsuite/experimental/string_view/typedefs.cc: Validate that the
	u8string_view typedef is defined.
	* testsuite/util/testsuite_common_types.h: Add char8_t, char16_t and
	char32_t to the typelists.

From-SVN: r269089
2019-02-22 01:16:08 +00:00
Tom Honermann
65bbaf3125 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
2019-02-22 01:15:58 +00:00
Ian Lance Taylor
f08e60e988 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
2019-02-22 00:47:30 +00:00
Ian Lance Taylor
8aef6e02ad 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
2019-02-22 00:41:25 +00:00
GCC Administrator
2496137abd Daily bump.
From-SVN: r269085
2019-02-22 00:16:20 +00:00
Martin Sebor
a90b0cdd44 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
2019-02-21 16:23:12 -07:00
Jason Merrill
4bcd47e2e1 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
2019-02-21 18:07:47 -05:00
Jason Merrill
5498361c0f 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
2019-02-21 18:07:12 -05:00
Ian Lance Taylor
eeb20b9696 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
2019-02-21 22:50:24 +00:00
Jakub Jelinek
43574e4ff2 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
2019-02-21 22:21:25 +01:00
Jonathan Wakely
d331c5f10d 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
2019-02-21 20:47:43 +00:00
H.J. Lu
f43044a3d7 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
2019-02-21 10:59:00 -08:00
Jason Merrill
7b45322a5e 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
2019-02-21 13:16:15 -05:00
Wilco Dijkstra
f64629aa9a 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
2019-02-21 18:08:56 +00:00
Thomas Koenig
5ea0d4df1e 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
2019-02-21 18:03:30 +00:00
Thomas Koenig
9e6644c6fd 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
2019-02-21 18:01:41 +00:00
H.J. Lu
eb74a883e8 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
2019-02-21 05:41:53 -08:00
Jakub Jelinek
8be5348868 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
2019-02-21 13:04:26 +01:00
Martin Jambor
031c5c8b60 [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
2019-02-21 12:00:47 +01:00
Richard Biener
0864e3fcb6 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
2019-02-21 08:03:40 +00:00
Jason Merrill
752620bec6 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
2019-02-20 21:24:40 -05:00
Ian Lance Taylor
556bef7efc 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
2019-02-21 01:06:01 +00:00
GCC Administrator
a9977ffb13 Daily bump.
From-SVN: r269062
2019-02-21 00:16:45 +00:00
Jakub Jelinek
e843f1890b 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
2019-02-21 01:09:47 +01:00
Jakub Jelinek
73ab3eb732 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
2019-02-21 01:08:59 +01:00
Jakub Jelinek
37d7267f80 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
2019-02-21 00:02:29 +01:00
Jakub Jelinek
cd56fb7957 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
2019-02-21 00:01:41 +01:00
Jakub Jelinek
b2d6c9e88c 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
2019-02-20 23:41:26 +01:00
Uros Bizjak
c5a32f1ae9 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
2019-02-20 22:58:45 +01:00
Uros Bizjak
1ed28eda9f 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
2019-02-20 22:37:21 +01:00
Jakub Jelinek
ed4ec9ceba 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
2019-02-20 22:16:27 +01:00
David Malcolm
200a8e1a38 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
2019-02-20 20:07:20 +00:00
Ian Lance Taylor
b054705ae6 compiler: fix a typo in comments
Reviewed-on: https://go-review.googlesource.com/c/163097

From-SVN: r269049
2019-02-20 19:14:12 +00:00
Jason Merrill
60067b8763 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
2019-02-20 13:59:18 -05:00
Jason Merrill
e3fe9cfb2f * g++.old-deja/g++.robertl/eb92.C: Handle warning as well.
From-SVN: r269047
2019-02-20 13:58:46 -05:00
Jason Merrill
e0737c209b 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
2019-02-20 13:54:45 -05:00
Will Wray
cb13308543 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
2019-02-20 13:50:32 -05:00
Pat Haugen
990525f659 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
2019-02-20 17:50:28 +00:00