Commit Graph

167948 Commits

Author SHA1 Message Date
Ville Voutilainen
f1ba6c5a51 Use single-visitation in variant assignment and swap and relops.
Also use indices instead of types when checking whether
variants hold the same thing.
* include/std/variant (__do_visit): Add a template parameter
for index visitation, invoke with indices if index visitation
is used.
(__variant_idx_cookie): New.
(__visit_with_index): Likewise.
(_Copy_assign_base::operator=): Do single-visitation with
an index visitor.
(_Move_assign_base::operator=): Likewise.
(_Extra_visit_slot_needed): Adjust.
(__visit_invoke): Call with indices if it's an index visitor.
(relops): Do single-visitation with an index visitor.
(swap): Likewise.
(__visitor_result_type): New.

From-SVN: r270056
2019-04-01 16:57:41 +03:00
Richard Biener
e37240b0b5 re PR tree-optimization/46590 (long compile time with -O2 and many loops)
2019-04-01  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/46590
	* domwalk.h (dom_walker::dom_walker): Consolidate constructors.
	(dom_walker::m_reachability): Add in place of...
	(dom_walker::m_skip_unreachable_blocks): ...this.
	* domwalk.c (dom_walker::dom_walker): Consoliate constructors.
	Move complex initialization ...
	(dom_walker::walk): Here.  Especially compute m_bb_to_rpo
	lazily and initialize edge flags on each invocation.
	(dom_walker::bb_reachable): Use m_reachability.

From-SVN: r270055
2019-04-01 11:36:25 +00:00
Martin Liska
90f1430589 Enhance option suggestion for options expected an argument (PR driver/89861).
2019-04-01  Martin Liska  <mliska@suse.cz>

	PR driver/89861
	* opt-suggestions.c (option_proposer::build_option_suggestions):
	Add variant without any argument in order to provide better
	hints.
2019-04-01  Martin Liska  <mliska@suse.cz>

	PR driver/89861
	* gcc.dg/spellcheck-options-18.c: New test.
	* gcc.dg/spellcheck-options-19.c: New test.
	* gcc.dg/spellcheck-options-20.c: New test.
	* gcc.dg/spellcheck-options-13.c: Adjust expected output.
	* gcc.dg/completion-2.c: Add one variant with no argument.

From-SVN: r270053
2019-04-01 07:17:38 +00:00
Richard Biener
2a82beaa82 re PR c/71598 (Wrong optimization with aliasing enums)
2019-04-01  Richard Biener  <rguenther@suse.de>

	PR c/71598
	* gimple.c: Include langhooks.h.
	(gimple_get_alias_set): Treat enumeral types as the underlying
	integer type.

	c/
	* c-tree.h (c_get_alias_set): Declare.
	* c-objc-common.h (LANG_HOOKS_GET_ALIAS_SET): Use c_get_alias_set.
	* c-objc-common.c (c_get_alias_set): Treat enumeral types
	as the underlying integer type.

	* gcc.dg/torture/pr71598-1.c: New testcase.
	* gcc.dg/torture/pr71598-2.c: Likewise.
	* gcc.dg/torture/pr71598-3.c: Likewise.

From-SVN: r270052
2019-04-01 07:16:38 +00:00
GCC Administrator
acf8e57ae2 Daily bump.
From-SVN: r270051
2019-04-01 00:16:21 +00:00
Marek Polacek
a81c8e8c9a PR c++/89852 - ICE with C++11 functional cast with { }.
* constexpr.c (fold_non_dependent_expr_template): New static function
	broken out of...
	(fold_non_dependent_expr): ...here.
	(fold_non_dependent_init): New function.
	* cp-tree.h (fold_non_dependent_init): Declare.
	* typeck2.c (massage_init_elt): Call fold_non_dependent_init instead
	of fold_non_dependent_expr.  Don't call maybe_constant_init.

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

From-SVN: r270048
2019-03-31 20:37:22 +00:00
Harald Anlauf
93755deb5c re PR fortran/83515 (ICE: Invalid expression in gfc_element_size)
2019-03-31  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/83515
	PR fortran/85797
	* trans-types.c (gfc_typenode_for_spec): Handle conversion for
	procedure pointers.
	* target-memory.c (gfc_element_size): Handle size determination
	for procedure pointers.

	PR fortran/83515
	PR fortran/85797
	* gfortran.dg/pr85797.f90: New test.

From-SVN: r270045
2019-03-31 18:33:51 +00:00
Thomas Koenig
60e8cda674 dump-parse-tree.c (debug): Add for symbol_attribute *, symbol_attribute and gfc_ref * arguments.
2019-03-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

    * dump-parse-tree.c (debug):  Add for symbol_attribute *,
    symbol_attribute and gfc_ref * arguments.

From-SVN: r270044
2019-03-31 15:21:10 +00:00
Iain Buclaw
1605fb3ed0 d: Fix run-time SIGSEGV reading ModuleInfo.flags()
The current forced alignment is not necessary, and is problematic on
targets that have strict alignment rules.

gcc/d/ChangeLog:

2019-03-31  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/88462
	* modules.cc (layout_moduleinfo_fields): Properly align ModuleInfo,
	instead of forcing alignment to be 1.

From-SVN: r270043
2019-03-31 14:34:41 +00:00
Rainer Orth
16216c7fbe Enable gcc.dg/attr-aligned-3.c on Solaris
* gcc.dg/attr-aligned-3.c: Enable on *-*-solaris2.*.

From-SVN: r270042
2019-03-31 09:26:22 +00:00
GCC Administrator
e27f601405 Daily bump.
From-SVN: r270041
2019-03-31 00:16:29 +00:00
Iain Buclaw
1821f97bb4 testsuite/gdc.test: Merge upstream dmd 5dd3eccc3
The D2 testsuite script has been updated to handle EXTRA_SOURCES and
EXTRA_FILES settings being split across multiple lines, which is how
they appear in upstream.

Reviewed-on: https://github.com/dlang/dmd/pull/9517

gcc/testsuite/ChangeLog:

2019-03-30  Iain Buclaw  <ibuclaw@gdcproject.org>

	* gdc.test/gdc-test.exp (gdc-copy-extra): Append copied files to
	cleanup_extra_files.
	(dmd2dg): Copy additional files after test is processed.
	(gdc-do-test): Remove all copied files after test.

From-SVN: r270038
2019-03-30 22:10:12 +00:00
Paul Thomas
0324a4978e re PR fortran/89841 (improper descriptor information passed to C)
2019-03-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89841
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Use the formal
	argument attributes rather than those of the actual argument.

	PR fortran/89842
	* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Call
	'set_dtype_for_unallocated' for any type of arrayspec.

2019-03-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/89841
	* gfortran.dg/ISO_Fortran_binding_1.f90: Change the interfaces
	for c_deallocate, c_allocate and c_assumed_size so that the
	attributes of the array arguments are correct and are typed.
	* gfortran.dg/ISO_Fortran_binding_7.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_7.c: Additional source.

	PR fortran/89842
	* gfortran.dg/ISO_Fortran_binding_8.f90: New test.
	* gfortran.dg/ISO_Fortran_binding_8.c: Additional source.

From-SVN: r270037
2019-03-30 15:39:00 +00:00
Jason Merrill
26b81a446f PR c++/89744 - ICE with specialization of member class template.
My fix five years ago for PR 60241 was incomplete: when we reassign implicit
instances of a partial instantiation of a member template to the explicit
specialization of that partial instantiation, we also need to adjust the
CLASSTYPE_TI_ARGS to match what we'd get when looking up that instance after
the explicit specialization.  We also need to do this when we later look up
the instance in a way that only finds the explicit specialization halfway
through lookup_template_class_1.

	* pt.c (lookup_template_class_1): If the partial instantiation is
	explicitly specialized, adjust.
	(maybe_process_partial_specialization): Also adjust
	CLASSTYPE_TI_ARGS.

From-SVN: r270036
2019-03-30 11:23:37 -04:00
Thomas Koenig
5c95b82b61 re PR fortran/89866 ([F08] wrong-code problem with POINTER, INTENT(IN) argument)
2019-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/89866
	* gfortran.dg/pointer_intent_8.f90: New test.

From-SVN: r270034
2019-03-30 13:41:10 +00:00
Eric Botcazou
29b129b855 * src/c++17/fs_ops.cc (fs::permissions): Use std::errc::not_supported.
From-SVN: r270033
2019-03-30 13:36:16 +00:00
Kugan Vivekanandarajah
09062aa45c re PR rtl-optimization/89862 (LTO bootstrap fails for ARM)
2019-03-29  Kugan Vivekanandarajah  <kuganv@linaro.org>
	    Eric Botcazou  <ebotcazou@adacore.com>

	PR rtl-optimization/89862
	* rtl.h (word_register_operation_p): Exclude CONST_INT from operations
	that operates on the full registers for WORD_REGISTER_OPERATIONS
	architectures.


Co-Authored-By: Eric Botcazou <ebotcazou@adacore.com>

From-SVN: r270030
2019-03-30 04:24:22 +00:00
GCC Administrator
593f8d6466 Daily bump.
From-SVN: r270029
2019-03-30 00:16:18 +00:00
Jim Wilson
76d4accffd RISC-V: Fix __riscv_compressed regression.
This was accidentally broken by the patch adding ELF attribute support.
The __riscv_compressed predefined macro is not being defined when the
target supports the C extension.  The fix adds testcases to verify that
all of the predefined macros are correct for various option combinations.

	gcc/
	* common/config/riscv/riscv-common.c (riscv_parse_arch_string):
	Clear MASK_RVC and then set if C subset supported.

	gcc/testsuite/
	* gcc.target/riscv/predef-1.c: New.
	* gcc.target/riscv/predef-2.c: New.
	* gcc.target/riscv/predef-3.c: New.
	* gcc.target/riscv/predef-4.c: New.
	* gcc.target/riscv/predef-5.c: New.
	* gcc.target/riscv/predef-6.c: New.
	* gcc.target/riscv/predef-7.c: New.
	* gcc.target/riscv/predef-8.c: New.

From-SVN: r270026
2019-03-29 14:51:58 -07:00
Jakub Jelinek
54ae50ac45 re PR rtl-optimization/89865 (FAIL: gcc.target/i386/pr49095.c scan-assembler-times \\\\), % 45)
PR rtl-optimization/89865
	* gcc.target/i386/pr49095.c: Include in scan-assembler-times patterns
	the first argument register, so that occassional spills/fills are
	ignored.

From-SVN: r270025
2019-03-29 21:51:15 +01:00
Jakub Jelinek
2b53407efb re PR sanitizer/89869 (-fsanitize=undefined miscompilation)
PR sanitizer/89869
	* typeck.c: Include gimplify.h.
	(cp_build_modify_expr) <case COND_EXPR>: Unshare rhs before using it
	for second time.  Formatting fixes.

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

From-SVN: r270024
2019-03-29 21:10:19 +01:00
Jakub Jelinek
77527d8ac4 re PR c/89872 (GCC does not generate read access to volatile compound literal)
PR c/89872
	* gimplify.c (gimplify_compound_literal_expr): Don't optimize a
	non-addressable complit into its initializer if it is volatile.

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

From-SVN: r270023
2019-03-29 20:32:20 +01:00
Roman Zhuykov
7ad99f7d21 opts-common.c (integral_argument): Set errno properly in one case.
* opts-common.c (integral_argument): Set errno properly in one case.

    * gcc.dg/diag-sanity.c: New test.

From-SVN: r270022
2019-03-29 12:44:01 -06:00
Marek Polacek
c072398e0f PR c++/89876 - ICE with deprecated conversion.
* call.c (convert_like_real): Only give warnings with tf_warning.

	* g++.dg/warn/conv5.C: New test.

From-SVN: r270021
2019-03-29 18:40:31 +00:00
Marek Polacek
a1c56deaa2 re PR c++/89871 (Wall + designated initializers)
PR c++/89871
	* g++.dg/cpp2a/desig14.C: New test.

From-SVN: r270019
2019-03-29 15:24:00 +00:00
Martin Liska
b56c578ce4 Remove -Wchkp from documentation.
2019-03-29  Martin Liska  <mliska@suse.cz>

	* doc/invoke.texi: Remove -Wchkp from documentation.

From-SVN: r270017
2019-03-29 14:53:12 +00:00
Martin Liska
dd7fa0d4f3 Dump -fdbg-cnt limit reach also to stderr stream.
2019-03-29  Martin Liska  <mliska@suse.cz>

	* dbgcnt.c (print_limit_reach): New function.
	(dbg_cnt): Use it.
2019-03-29  Martin Liska  <mliska@suse.cz>

	* gcc.dg/ipa/ipa-icf-39.c: Prine '***dbgcnt' output.
	* gcc.dg/pr68766.c: Likewise.

From-SVN: r270015
2019-03-29 11:45:56 +00:00
Martin Liska
2a7108b96e Fix multiple values for -fdbg-cnt.
2019-03-29  Martin Liska  <mliska@suse.cz>

	* dbgcnt.c (dbg_cnt_process_single_pair): Fix GNU coding style.
	(dbg_cnt_process_opt): Parse first tokens aas
	dbg_cnt_process_single_pair is also using strtok.

From-SVN: r270014
2019-03-29 11:45:39 +00:00
Jakub Jelinek
a6240447c4 re PR rtl-optimization/87485 (Compile time hog w/ -O2 -fschedule-insns -fno-guess-branch-probability -fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer -fno-split-wide-types -fno-tree-ccp -fno-tree-sra)
PR rtl-optimization/87485
	* function.c (expand_function_end): Move stack_protect_epilogue
	before loading of return value into hard register(s).

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

From-SVN: r270013
2019-03-29 12:42:51 +01:00
GCC Administrator
34f95cbdc5 Daily bump.
From-SVN: r270012
2019-03-29 00:16:31 +00:00
Jakub Jelinek
79d64ee829 re PR middle-end/89621 (ICE with allocatable character and openmp)
PR middle-end/89621
	* tree-inline.h (struct copy_body_data): Add
	dont_remap_vla_if_no_change flag.
	* tree-inline.c (remap_type_3, remap_type_2): New functions.
	(remap_type): Don't remap vla types if id->dont_remap_vla_if_no_change
	and remap_type_2 returns false.
	* omp-low.c (new_omp_context): Set ctx->cb.dont_remap_vla_if_no_change.
	Move ctx->cb.adjust_array_error_bounds setting to the outermost ctx
	only from where it is copied to nested contexts.

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

From-SVN: r270009
2019-03-28 23:33:29 +01:00
Martin Sebor
e4479ec676 PR c++/66548 - Invalid class member access expression in decltype sometimes
PR c++/66548 - Invalid class member access expression in decltype sometimes
accepted

gcc/testsuite/ChangeLog:
	* g++.dg/cpp0x/decltype-pr66548.C: New test.

From-SVN: r270007
2019-03-28 15:32:11 -06:00
Martin Sebor
4eb8255191 PR c++/81506 - Invalid declaration with decltype accepted
testsuite/ChangeLog:
	* g++.dg/cpp0x/decltype-pr81506.C: New test.

From-SVN: r270006
2019-03-28 15:20:18 -06:00
Marek Polacek
c526171d73 PR c++/89612 - ICE with member friend template with noexcept.
* pt.c (maybe_instantiate_noexcept): For function templates, use their
	template result (function decl).  Don't set up local specializations.
	Temporarily turn on processing_template_decl.  Update the template type
	too.

	* g++.dg/cpp0x/noexcept38.C: New test.
	* g++.dg/cpp0x/noexcept39.C: New test.
	* g++.dg/cpp1z/noexcept-type21.C: New test.

From-SVN: r270005
2019-03-28 20:24:48 +00:00
Uros Bizjak
ddfd99ac13 re PR rtl-optimization/89865 (FAIL: gcc.target/i386/pr49095.c scan-assembler-times \\\\), % 45)
PR target/89865
	* config/i386/i386.md (RMW operation with LEA peephole):
	Use LEAMODE mode attribute instead of SWI mode iterator for
	LEA pattern.

From-SVN: r270004
2019-03-28 20:33:22 +01:00
Uros Bizjak
198c27e983 re PR target/89848 (ICE: in convert_op, at config/i386/i386.c:2099 with -O2 -msse2 -mtune=pentium3m)
PR target/89848
	* config/i386/i386.c (dimode_scalar_chain::make_vector_copies):
	Also process XEXP (src, 0) of a shift insn.

testsuite/ChangeLog:

	PR target/89848
	* gcc.target/i386/pr89848.c: New test.

From-SVN: r270003
2019-03-28 20:15:58 +01:00
Marek Polacek
c91b271552 PR c++/89836 - bool constant expression and explicit conversions.
* call.c (build_converted_constant_expr_internal): New function,
	renamed from...
	(build_converted_constant_expr): ...this.  New.
	(build_converted_constant_bool_expr): New.
	* cp-tree.h (build_converted_constant_bool_expr): Declare.
	* decl.c (build_explicit_specifier): Call
	build_converted_constant_bool_expr.

	* g++.dg/cpp2a/explicit15.C: New test.

From-SVN: r270002
2019-03-28 18:23:18 +00:00
Jakub Jelinek
bb15c8b7f7 re PR c/89812 (incorrect maximum in error: requested alignment ‘536870912’ exceeds maximum 2147483648)
PR c/89812
	* gcc.dg/attr-aligned-3.c: Limit the test to known ELF targets
	other than AVR.  Add dg-options "".

From-SVN: r270001
2019-03-28 18:14:05 +01:00
Ville Voutilainen
337d1fec36 Don't revisit a variant we are already visiting.
* include/std/variant (__variant_construct_single): New.
(__variant_construct): Use it.
(_M_destructive_move): Likewise.
(_M_destructive_copy): Likewise.
(_Copy_assign_base::operator=): Adjust.
(_Move_assign_base::operator=): Likewise.
(swap): Likewise.

From-SVN: r269996
2019-03-28 18:18:49 +02:00
Jakub Jelinek
c7a53bdbb1 re PR c++/89785 (Incorrect "not a constant expression" error with switch statement that returns)
PR c++/89785
	* constexpr.c (struct check_for_return_continue_data): New type.
	(check_for_return_continue): New function.
	(potential_constant_expression_1) <case SWITCH_STMT>: Walk
	SWITCH_STMT_BODY to find RETURN_EXPRs or CONTINUE_STMTs not nested
	in loop bodies and set *jump_target to that if found.

	* g++.dg/cpp1y/constexpr-89785-1.C: New test.
	* g++.dg/cpp1y/constexpr-89785-2.C: New test.

From-SVN: r269995
2019-03-28 15:47:47 +01:00
David Malcolm
12b9247b19 optinfo-emit-json.cc: don't call get_fnname_from_decl (PR middle-end/89725)
optrecord_json_writer::optinfo_to_json can in theory be called from any
optimization pass, but currently uses get_fnname_from_decl, which
is RTL-specific.

In that PR, Jakub suggested using either DECL_ASSEMBLER_NAME or the
"printable name" (via current_function_name).

This patch makes it use DECL_ASSEMBLER_NAME.

gcc/ChangeLog:
	PR middle-end/89725
	* optinfo-emit-json.cc (optrecord_json_writer::optinfo_to_json):
	Use DECL_ASSEMBLER_NAME rather than get_fnname_from_decl.

From-SVN: r269994
2019-03-28 14:40:56 +00:00
Jakub Jelinek
cdd82c1ee8 regcprop.c (copyprop_hardreg_forward_1): Remove redundant INSN_P test.
* regcprop.c (copyprop_hardreg_forward_1): Remove redundant INSN_P
	test.
	(cprop_hardreg_bb, cprop_hardreg_debug): New functions.
	(pass_cprop_hardreg::execute): Use those.  Don't repeat bb processing
	immediately after first one with df_analyze in between, but rather
	process all bbs, queueing ones that need second pass in a worklist,
	df_analyze, process queued debug insn changes and if second pass is
	needed, process bbs from worklist, df_analyze, process queued debug
	insns again.

From-SVN: r269992
2019-03-28 15:20:10 +01:00
Jakub Jelinek
c84e2d3d18 rtl.h (NONDEBUG_INSN_P): Define as NONJUMP_INSN_P or JUMP_P or CALL_P instead of INSN_P && !DEBUG_INSN_P.
* rtl.h (NONDEBUG_INSN_P): Define as NONJUMP_INSN_P or JUMP_P
	or CALL_P instead of INSN_P && !DEBUG_INSN_P.
	(INSN_P): Define using NONDEBUG_INSN_P or DEBUG_INSN_P.

From-SVN: r269991
2019-03-28 15:07:40 +01:00
Jonathan Wakely
92cf93d98f PR c/79022 fix mismatch parameter order in declaratio
The declaration of create_nested_ptr_option in the header has the 'from'
and 'to' parameters in the opposite order from the definition in
gengtype.c:

  /* Return an options structure for a "nested_ptr" option.  */
  options_p
  create_nested_ptr_option (options_p next, type_p t,
                            const char *to, const char *from)

and the only caller in gengtype-parse.c:

  return create_nested_ptr_option (prev, ty, to, from);

This patch swaps the parameter names in the declaration.

	PR c/79022
	* gengtype.h (create_nested_ptr_option): Fix parameter names to match
	definition.

From-SVN: r269990
2019-03-28 13:42:48 +00:00
Martin Liska
684f60085b Revert r254150 (PR bootstrap/89829).
2019-03-28  Martin Liska  <mliska@suse.cz>

	PR bootstrap/89829
	* Makefile.in: Revert r254150.
	* Makefile.tpl: Likewise.

From-SVN: r269985
2019-03-28 08:44:44 +00:00
Ben Elliston
fed156ac66 MAINTAINERS (Various Maintainers): Remove myself from dfp.c and related, and libdecnumber.
* MAINTAINERS (Various Maintainers): Remove myself from dfp.c and
	related, and libdecnumber.

From-SVN: r269984
2019-03-28 17:55:57 +11:00
GCC Administrator
bad1b9594c Daily bump.
From-SVN: r269983
2019-03-28 00:16:26 +00:00
Janus Weil
7076b27b74 re PR fortran/85537 ([F08] Invalid memory reference at runtime when calling subroutine through procedure pointer)
fix PR 85537

2019-03-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/85537
	* expr.c (gfc_check_assign_symbol): Reject internal and dummy procedures
	in procedure pointer initialization.

2019-03-27  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/85537
	* gfortran.dg/dummy_procedure_11.f90: Fix test case.
	* gfortran.dg/pointer_init_11.f90: New test case.

From-SVN: r269980
2019-03-27 23:40:22 +01:00
Mateusz B
303d6cb276 re PR target/85667 (ms_abi rules aren't followed when returning short structs with float values)
PR target/85667
	* config/i386/i386.c (ix86_function_value_1): Call the newly added
	function for 32-bit MS_ABI.
	(function_value_ms_32): New function.

testsuite/ChangeLog:

	PR target/85667
	* gcc.target/i386/pr85667-5.c: New testcase.
	* gcc.target/i386/pr85667-6.c: New testcase.

From-SVN: r269979
2019-03-27 22:17:48 +01:00
Bill Schmidt
1509905e82 pr81740-2.c: Require vect_hw_misalign.
2019-03-27  Bill Schmidt  <wschmidt@linux.ibm.com>

	* gcc.dg/vect/pr81740-2.c: Require vect_hw_misalign.

From-SVN: r269978
2019-03-27 20:39:22 +00:00