Commit Graph

164688 Commits

Author SHA1 Message Date
Pat Haugen d8b1c3f075 tree-ssa-loop-ivcanon.c (try_peel_loop): Fix typo and remove dead initialization.
* tree-ssa-loop-ivcanon.c (try_peel_loop): Fix typo and remove dead
	initialization.

From-SVN: r265693
2018-10-31 15:30:48 +00:00
Nathan Sidwell f3f6029db2 [6/6] Preprocessor forced macro location
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02044.html
	libcpp/
	* internal.h (struct cpp_reader): Rename forced_token_location_p
	to forced_token_location and drop its pointerness.
	* include/cpplib.h (cpp_force_token_locations): Take location, not
	pointer to one.
	* init.c (cpp_create_reader): Adjust.
	* lex.c (cpp_read_main_file): 

	gcc/c-family/
	* c-opts.c (c_finish_options): Adjust cpp_force_token_locations call.

	gcc/fortran/
	* cpp.c (gfc_cpp_init): Adjust cpp_force_token_locations call.

From-SVN: r265692
2018-10-31 15:26:28 +00:00
Michael Ploujnikov 82a14443db Add myself to MAINTAINERS
ChangeLog:

2018-10-31  Michael Ploujnikov  <michael.ploujnikov@oracle.com>

	* MAINTAINERS (Write After Approval): Add myself.

From-SVN: r265691
2018-10-31 15:16:31 +00:00
Nathan Sidwell 705b0c059f [5/6] Preprocessor include
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02041.html
	* directives.c (do_include_common): Commonize cleanup path.
	(_cpp_pop_buffer): Fix leak.

From-SVN: r265690
2018-10-31 15:03:04 +00:00
Nathan Sidwell 87bacc2b39 [4/7] Preprocessor location-kind predicates
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02040.html
	* include/line-map.h (IS_ORDINARY_LOC, IS_MACRO_LOC): New
	predicates.
	(IS_ADHOC_LOC): Move earlier.
	(MAP_ORDINARY_P): Use IS_ORDINARY_LOC.
	* line-map.c (linemap_location_from_macro_expansion_p): Use
	IS_MACRO_LOC.

From-SVN: r265689
2018-10-31 14:57:13 +00:00
Nathan Sidwell c9fb347ea1 [3/7] Preprocessor macro loc
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02039.html
	* include/cpplib.h (cpp_macro_definition_location): Make inline.
	* macro.c (warn_of_redefinition): Fix comments, examine macro
	type, use C++ for.
	(cpp_macro_definition_location): Don't define here.

From-SVN: r265688
2018-10-31 14:51:54 +00:00
Nathan Sidwell 43af5ef1ce [2/7] Preprocessor node access
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02038.html
	* include/cpplib.h (HT_NODE): Don't cast NODE.
	(NODE_LEN, NODE_NAME): Use HT_NODE.

From-SVN: r265687
2018-10-31 14:46:39 +00:00
Martin Liska c788734738 Provide extension hint for aarch64 target (PR driver/83193).
2018-10-31  Martin Liska  <mliska@suse.cz>

	PR driver/83193
	* common/config/aarch64/aarch64-common.c (aarch64_parse_extension):
	Add new argument invalid_extension.
	(aarch64_get_all_extension_candidates): New function.
	(aarch64_rewrite_selected_cpu): Add NULL to function call.
	* config/aarch64/aarch64-protos.h (aarch64_parse_extension): Add
	new argument.
	(aarch64_get_all_extension_candidates): New function.
	* config/aarch64/aarch64.c (aarch64_parse_arch): Add new
	argument invalid_extension.
	(aarch64_parse_cpu): Likewise.
	(aarch64_print_hint_for_extensions): New function.
	(aarch64_validate_mcpu): Provide hint about invalid extension.
	(aarch64_validate_march): Likewise.
	(aarch64_handle_attr_arch): Pass new argument.
	(aarch64_handle_attr_cpu): Provide hint about invalid extension.
	(aarch64_handle_attr_isa_flags): Likewise.
2018-10-31  Martin Liska  <mliska@suse.cz>

	PR driver/83193
	* gcc.target/aarch64/spellcheck_7.c: New test.
	* gcc.target/aarch64/spellcheck_8.c: New test.
	* gcc.target/aarch64/spellcheck_9.c: New test.

From-SVN: r265686
2018-10-31 14:46:17 +00:00
Nathan Sidwell ff65e98035 [1/7] Preprocessor cleanup
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02037.html
	* directives.c (DIRECTIVE_TABLE): Drop historical frequency
	comments.
	* files.c (_cpp_stack_file): Fix indentation.

From-SVN: r265685
2018-10-31 14:41:35 +00:00
Jonathan Wakely d5e33619bf More testing for std::pair layout change
* testsuite/20_util/pair/87822.cc: Test deeper nesting.

From-SVN: r265680
2018-10-31 12:58:45 +00:00
Nathan Sidwell 8e82c473f5 [C++ PATCH] Simplify overloads
https://gcc.gnu.org/ml/gcc-patches/2018-10/msg02026.html
	gcc/cp/
	* cp-tree.h (OVL_DEDUP_P): New.
	* name-lookup.c (name_lookup::add_overload): Check OVL_DEDUP_P.
	(get_class_binding_direct): Likwise.
	* tree.c (ovl_make): Propagate OVL_DEDUP_P.
	(ovl_copy): Copy it.
	(ovl_insert): Do not keep using-decls ordered.
	(lookup_maybe_add): Adjust comment.

	gcc/testsuite/
	* g++.dg/lookup/using60.C: New.

From-SVN: r265679
2018-10-31 12:42:35 +00:00
Jonathan Wakely 0db78d0a5e PR libstdc++/87822 fix layout change for nested std::pair
The introduction of the empty __pair_base base class for PR 86751
changed the layout of std::pair<std::pair<...>, ...>. The outer pair and
its first member both have a base class of the same type, which cannot
exist at the same address. This causes the first member to be at a
non-zero offset.

The solution is to make the base class depend on the template
parameters, so that each pair type has a different base class type,
which allows the base classes of the outer pair and its first member to
have the same address.

	PR libstdc++/87822
	* include/bits/stl_pair.h (__pair_base): Change to class template.
	(pair): Make base class type depend on template parameters.
	* testsuite/20_util/pair/87822.cc: New test.

From-SVN: r265678
2018-10-31 12:29:02 +00:00
Richard Biener ef976be1a2 re PR middle-end/70359 (Code size increase for x86/ARM/others compared to gcc-5.3.0)
2018-10-31  Richard Biener  <rguenther@suse.de>

	PR middle-end/70359
	PR middle-end/86270
	* tree-outof-ssa.c (insert_backedge_copies): Restrict
	copy generation to useful cases.  Place the copy before
	the definition of the backedge value when possible.

	* gcc.target/i386/pr70359.c: New testcase.
	* gcc.target/i386/pr86270.c: Likewise.

From-SVN: r265677
2018-10-31 11:57:33 +00:00
Claudiu Zissulescu 635aeaa20f [ARC] Handle store cacheline hazard.
Handle store cacheline hazard for A700 cpus by inserting two NOP_S
between ST ST LD or their logical equivalent (like ST ST NOP_S NOP_S
J_L.D LD)

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc-arch.h (ARC_TUNE_ARC7XX): New tune value.
        * config/arc/arc.c (arc_active_insn): New function.
        (check_store_cacheline_hazard): Likewise.
        (workaround_arc_anomaly): Use check_store_cacheline_hazard.
        (arc_override_options): Disable delay slot scheduler for older
        A7.
        (arc_store_addr_hazard_p): New implementation, old one renamed to
        ...
        (arc_store_addr_hazard_internal_p): Renamed.
        (arc_reorg): Don't combine into brcc instructions which are part
        of hardware hazard solution.
        * config/arc/arc.md (attr tune): Consider new arc7xx tune value.
        (tune_arc700): Likewise.
        * config/arc/arc.opt (arc7xx): New tune value.
        * config/arc/arc700.md: Improve A7 scheduler.

From-SVN: r265676
2018-10-31 12:27:46 +01:00
Claudiu Zissulescu aac1c11ce4 [ARC] Add BI/BIH instruction support.
Use BI/BIH instruction to implement casesi pattern. Only ARC V2.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

        * config/arc/arc.c (arc_override_options): Remove
        TARGET_COMPACT_CASESI.
        * config/arc/arc.h (ASM_OUTPUT_ADDR_DIFF_ELT): Update.
        (CASE_VECTOR_MODE): Likewise.
        (CASE_VECTOR_PC_RELATIVE): Likewise.
        (CASE_VECTOR_SHORTEN_MODE): Likewise.
        (CASE_VECTOR_SHORTEN_MODE1): Delete.
        (ADDR_VEC_ALIGN): Update.
        (ASM_OUTPUT_CASE_LABEL): Undefine.
        (ASM_OUTPUT_BEFORE_CASE_LABEL): Undefine.
        (TARGET_BI_BIH): Define.
        (DEFAULT_BRANCH_INDEX): Likewise.
        * config/arc/arc.md (casesi): Rework to accept BI/BIH
        instructions, remove compact_casesi use case.
        (casesi_compact_jump): Remove.
        (casesi_dispatch): New pattern.
        * config/arc/arc.opt: Add mbranch-index option. Deprecate
        compact_casesi option.
        * doc/invoke.texi: Document mbranch-index option.

gcc/testsuite
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

        * gcc.target/arc/jumptable.c: New test.

From-SVN: r265675
2018-10-31 12:27:35 +01:00
Claudiu Zissulescu 8efa18d693 [ARC] Cleanup TLS implementation and add a number of tests.
gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.c (arc_get_tp): Remove function.
	(arc_emit_call_tls_get_addr): Likewise.
	(arc_call_tls_get_addr): New function.
	(arc_legitimize_tls_address): Make use of arc_call_tls_get_addr.
	* config/arc/arc.md (tls_load_tp_soft): Remove.
	(tls_gd_get_addr): Likewise.

testsuite/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/tls-gd.c: New file.
	* gcc.target/arc/tls-ie.c: Likewise.
	* gcc.target/arc/tls-ld.c: Likewise.
	* gcc.target/arc/tls-le.c: Likewise.
	* gcc.target/arc/tls-1.c: Update test.

From-SVN: r265674
2018-10-31 12:27:19 +01:00
Martin Liska 088371bfc5 Update LOCAL_PATCHES after libsanitizer merge.
2018-10-31  Martin Liska  <mliska@suse.cz>

	* LOCAL_PATCHES: Update to installed revisions.

From-SVN: r265673
2018-10-31 11:27:16 +00:00
Claudiu Zissulescu 8180cde0fb [ARC] Remove non standard funcions calls.
Replace all custom "library" calls with compiler known patterns.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.md (mulsi3): Remove call to mulsi_600_lib.
	(mulsi3_600_lib): Remove pattern.
	(umulsi3_highpart_600_lib_le): Likewise.
	(umulsi3_highpart): Remove call to umulsi3_highpart_600_lib_le.
	(umulsidi3): Remove call to umulsidi3_600_lib.
	(umulsidi3_600_lib): Remove pattern.
	(peephole2): Remove peephole using the above deprecated patterns.

testsuite/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* gcc.target/arc/mulsi3_highpart-2.c: Update test.

libgcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/lib1funcs.S (_muldi3): New function.
	* config/arc/t-arc (LIB1ASMFUNCS): Add _muldi3.

From-SVN: r265672
2018-10-31 12:27:07 +01:00
Martin Liska fad03406eb Update test-suite expected output after rewording in libsanitizer.
2018-10-31  Martin Liska  <mliska@suse.cz>

	* c-c++-common/ubsan/pr63839.c: Update to new sanitizer message.
	* c-c++-common/ubsan/unreachable-1.c (main): Likewise.
	* c-c++-common/ubsan/unreachable-2.c: Likewise.
	* c-c++-common/ubsan/unreachable-4.c (main): Likewise.

From-SVN: r265670
2018-10-31 11:17:30 +00:00
Martin Liska c244886cc4 New local GCC patch for CAN_SANITIZE_UB ifdef.
2018-10-31  Martin Liska  <mliska@suse.cz>

	* ubsan/ubsan_platform.h: Add ifndef as we define it with
	-DCAN_SANITIZE_UB CFLAGS.

From-SVN: r265669
2018-10-31 11:17:10 +00:00
Martin Liska f607b87cbe Revert https://reviews.llvm.org/D40908 which changes asan offset to 1<<44.
2018-10-31  Martin Liska  <mliska@suse.cz>

	* asan/asan_mapping.h: Revert shadow memory offset to 1 << 41.

From-SVN: r265668
2018-10-31 11:16:41 +00:00
Martin Liska e63c967765 Apply LOCAL_PATCHES and remove not used ones.
2018-10-31  Martin Liska  <mliska@suse.cz>

	* LOCAL_PATCHES: Update patch list.
	* asan/asan_globals.cc (CheckODRViolationViaIndicator): Apply
	patches from GCC's trunk.
	(CheckODRViolationViaPoisoning): Likewise.
	(RegisterGlobal): Likewise.
	* sanitizer_common/sanitizer_mac.cc (defined): Likewise.
	* sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Likewise.
	* ubsan/ubsan_handlers.cc (__ubsan::__ubsan_handle_cfi_bad_icall): Likewise.
	(__ubsan::__ubsan_handle_cfi_bad_icall_abort): Likewise.
	* ubsan/ubsan_handlers.h (struct CFIBadIcallData): Likewise.
	(struct CFICheckFailData): Likewise.
	(RECOVERABLE): Likewise.

From-SVN: r265667
2018-10-31 11:16:17 +00:00
Martin Liska 8468f94425 Update build system: include new files and run autoheader, autoconf, automake
2018-10-31  Martin Liska  <mliska@suse.cz>

	* config.h.in: Regenerate.
	* configure: Likewise.
	* sanitizer_common/Makefile.am: Include new files, remove old
	files.
	* sanitizer_common/Makefile.in: Regenerate.
	* ubsan/Makefile.am: Include new files, remove old
	files.
	* ubsan/Makefile.in: Likewise.
	* asan/Makefile.am: Include new files.
	* asan/Makefile.in: Regenerate.

From-SVN: r265666
2018-10-31 11:15:57 +00:00
Martin Liska eac9753122 backport: All source files: Merge from upstream 345033.
Merge from upstream 345033.

2018-10-31  Martin Liska  <mliska@suse.cz>

	* All source files: Merge from upstream 345033.

From-SVN: r265665
2018-10-31 11:14:23 +00:00
Martin Liska 95fba530b6 Update merge script and HOWTO_MERGE documentation.
2018-10-31  Martin Liska  <mliska@suse.cz>

	* HOWTO_MERGE: Enhance documentation.
	* merge.sh: Add support for git as well.

From-SVN: r265664
2018-10-31 11:09:26 +00:00
Martin Liska 2e71b5714d Fix hash-table violation in trans-decl.c.
2018-10-31  Martin Liska  <mliska@suse.cz>

	* trans-decl.c (struct module_hasher): Call htab_hash_string
	for s->name and not for s.

From-SVN: r265663
2018-10-31 10:59:34 +00:00
Thomas Preud'homme 6dc8ee419e Fix PR87374: ICE with -mslow-flash-data and -mword-relocations
GCC ICEs under -mslow-flash-data and -mword-relocations because there
is no way to load an address, both literal pools and MOVW/MOVT being
forbidden. This patch gives an error message when both options are
specified by the user and adds the according dg-skip-if directives for
tests that use either of these options. It also explicitely set the
option when in PIC mode as per documentation rather than always check
for target_word_relocation together with flag_pic.

2018-10-31  Thomas Preud'homme  <thomas.preudhomme@linaro.org>

    gcc/
    PR target/87374
    * config/arm/arm.c (arm_option_check_internal): Disable the combined
    use of -mslow-flash-data and -mword-relocations.
    (arm_option_override): Enable -mword-relocations if -fpic or -fPIC.
    * config/arm/arm.md (SYMBOL_REF MOVT splitter): Stop checking for
    flag_pic.
    * doc/invoke.texi (-mword-relocations): Mention conflict with
    -mslow-flash-data.
    (-mslow-flash-data): Reciprocally.

    gcc/testsuite/
    PR target/87374
    * gcc.target/arm/movdi_movt.c: Skip if both -mslow-flash-data and
    -mword-relocations would be passed when compiling the test.
    * gcc.target/arm/movsi_movt.c: Likewise.
    * gcc.target/arm/pr81863.c: Likewise.
    * gcc.target/arm/thumb2-slow-flash-data-1.c: Likewise.
    * gcc.target/arm/thumb2-slow-flash-data-2.c: Likewise.
    * gcc.target/arm/thumb2-slow-flash-data-3.c: Likewise.
    * gcc.target/arm/thumb2-slow-flash-data-4.c: Likewise.
    * gcc.target/arm/thumb2-slow-flash-data-5.c: Likewise.
    * gcc.target/arm/tls-disable-literal-pool.c: Likewise.

From-SVN: r265662
2018-10-31 10:05:54 +00:00
Richard Henderson 563cc649be aarch64: Force TImode values into even registers
The LSE CASP instruction requires values to be placed in even
register pairs.  A solution involving two additional register
classes was rejected in favor of the much simpler solution of
simply requiring all TImode values to be aligned.

	* config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Force
	16-byte modes held in GP registers to use an even regno.

From-SVN: r265661
2018-10-31 03:00:45 -07:00
Richard Henderson 7803ec5ee2 aarch64: Improve atomic-op lse generation
Fix constraints; avoid unnecessary split.  Drop the use of the atomic_op
iterator in favor of the ATOMIC_LDOP iterator; this is simplier and more
logical for ldclr aka bic.

	* config/aarch64/aarch64.c (aarch64_emit_bic): Remove.
	(aarch64_atomic_ldop_supported_p): Remove.
	(aarch64_gen_atomic_ldop): Remove.
	* config/aarch64/atomic.md (atomic_<atomic_optab><ALLI>):
	Fully expand LSE operations here.
	(atomic_fetch_<atomic_optab><ALLI>): Likewise.
	(atomic_<atomic_optab>_fetch<ALLI>): Likewise.
	(aarch64_atomic_<ATOMIC_LDOP><ALLI>_lse): Drop atomic_op iterator
	and use ATOMIC_LDOP instead; use register_operand for the input;
	drop the split and emit insns directly.
	(aarch64_atomic_fetch_<ATOMIC_LDOP><ALLI>_lse): Likewise.
	(aarch64_atomic_<atomic_op>_fetch<ALLI>_lse): Remove.
	(@aarch64_atomic_load<ATOMIC_LDOP><ALLI>): Remove.

From-SVN: r265660
2018-10-31 02:58:48 -07:00
Richard Henderson 8f5603d363 aarch64: Improve swp generation
Allow zero as an input; fix constraints; avoid unnecessary split.

	* config/aarch64/aarch64.c (aarch64_emit_atomic_swap): Remove.
	(aarch64_gen_atomic_ldop): Don't call it.
	* config/aarch64/atomics.md (atomic_exchange<ALLI>):
	Use aarch64_reg_or_zero.
	(aarch64_atomic_exchange<ALLI>): Likewise.
	(aarch64_atomic_exchange<ALLI>_lse): Remove split; remove & from
	operand 0; use aarch64_reg_or_zero for input; merge ...
	(@aarch64_atomic_swp<ALLI>): ... this and remove.

From-SVN: r265659
2018-10-31 02:47:21 -07:00
Iain Buclaw 260eedb901 re PR d/87788 (Support D on x86_64-apple-darwin*)
ChangeLog:

2018-10-31  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR bootstrap/87788
	PR d/87799
	* configure: Rebuild.
	* configure.ac: Disable D on systems where it is known not to work.

libphobos/ChangeLog:

2018-10-31  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR bootstrap/87789
	PR d/87818
	PR d/87819
	* configure.tgt: New file.

From-SVN: r265658
2018-10-31 09:44:31 +00:00
Richard Henderson d400fda3a8 aarch64: Improve cas generation
Do not zero-extend the input to the cas for subword operations;
instead, use the appropriate zero-extending compare insns.
Correct the predicates and constraints for immediate expected operand.

	* config/aarch64/aarch64.c (aarch64_gen_compare_reg_maybe_ze): New.
	(aarch64_split_compare_and_swap): Use it.
	(aarch64_expand_compare_and_swap): Likewise.  Remove convert_modes;
	test oldval against the proper predicate.
	* config/aarch64/atomics.md (@atomic_compare_and_swap<ALLI>):
	Use nonmemory_operand for expected.
	(cas_short_expected_pred): New.
	(@aarch64_compare_and_swap<SHORT>): Use it; use "rn" not "rI" to match.
	(@aarch64_compare_and_swap<GPI>): Use "rn" not "rI" for expected.
	* config/aarch64/predicates.md (aarch64_plushi_immediate): New.
	(aarch64_plushi_operand): New.

From-SVN: r265657
2018-10-31 02:42:39 -07:00
Richard Henderson 77f33f44ba aarch64: Simplify LSE cas generation
The cas insn is a single insn, and if expanded properly need not
be split after reload.  Use the proper inputs for the insn.

	* config/aarch64/aarch64.c (aarch64_expand_compare_and_swap):
	Force oldval into the rval register for TARGET_LSE; emit the compare
	during initial expansion so that it may be deleted if unused.
	(aarch64_gen_atomic_cas): Remove.
	* config/aarch64/atomics.md (@aarch64_compare_and_swap<SHORT>_lse):
	Change =&r to +r for operand 0; use match_dup for operand 2;
	remove is_weak and mod_f operands as unused.  Drop the split
	and merge with...
	(@aarch64_atomic_cas<SHORT>): ... this pattern's output; remove.
	(@aarch64_compare_and_swap<GPI>_lse): Similarly.
	(@aarch64_atomic_cas<GPI>): Similarly.

From-SVN: r265656
2018-10-31 02:29:29 -07:00
Richard Biener 187cea947e re PR testsuite/87802 (g++.dg/vect/slp-pr87105.cc fails starting with r265522)
2018-10-31  Richard Biener  <rguenther@suse.de>

	PR testsuite/87802
	* g++.dg/vect/slp-pr87105.cc: XFAIL for strict alignment targets.

From-SVN: r265655
2018-10-31 08:48:59 +00:00
Richard Biener 1a71493d59 tree-eh.c (replace_trapping_overflow): Simplify ABS_EXPR case using ABSU_EXPR.
2018-10-31  Richard Biener  <rguenther@suse.de>

	* tree-eh.c (replace_trapping_overflow): Simplify ABS_EXPR case
	using ABSU_EXPR.

From-SVN: r265654
2018-10-31 08:10:58 +00:00
Sameera Deshpande 2e9d500e4e Add pipeline description for Qualcomm Saphira core.
From-SVN: r265653
2018-10-31 13:02:53 +05:30
GCC Administrator 8f4103c5aa Daily bump.
From-SVN: r265652
2018-10-31 00:17:19 +00:00
Thomas Koenig 0a8949a3f2 re PR fortran/85896 (ICE in gfc_convert_constant(): Unexpected type)
2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/85896
	* simplify.c (simplify_min_max): Do not convert the type of the
	return expression.

2018-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/85896
	* gfortran.dg/min_max_type.f90: New test.

From-SVN: r265649
2018-10-30 23:04:10 +00:00
Martin Sebor 91e3ec29af PR middle-end/87041 - -Wformat reading through null pointer on unreachable code
gcc/ChangeLog:

	PR middle-end/87041
	* gimple-ssa-sprintf.c (format_directive): Use %G to include
	inlining context.
	(sprintf_dom_walker::compute_format_length):
	Avoid setting POSUNDER4K here.
	(get_destination_size): Handle null argument values.
	(get_user_idx_format): New function.
	(sprintf_dom_walker::handle_gimple_call): Handle all printf-like
	functions, including user-defined with attribute format printf.
	Use %G to include inlining context.
	Set POSUNDER4K here.

gcc/c-family/ChangeLog:

	PR middle-end/87041
	* c-format.c (check_format_types): Avoid diagnosing null pointer
	arguments to printf-family of functions.

gcc/testsuite/ChangeLog:

	PR middle-end/87041
	* gcc.c-torture/execute/fprintf-2.c: New test.
	* gcc.c-torture/execute/printf-2.c: Same.
	* gcc.c-torture/execute/user-printf.c: Same.
	* gcc.dg/tree-ssa/builtin-fprintf-warn-1.c: Same.
	* gcc.dg/tree-ssa/builtin-printf-2.c: Same.
	* gcc.dg/tree-ssa/builtin-printf-warn-1.c: Same.
	* gcc.dg/tree-ssa/user-printf-warn-1.c: Same.

From-SVN: r265648
2018-10-30 15:58:35 -06:00
Jan Hubicka 448af20a27 * params.def (lto-partitions): Bump from 32 to 128.
From-SVN: r265647
2018-10-30 21:47:19 +00:00
Marek Polacek b5ff4f5c0d Implement P0892R2, explicit(bool).
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_explicit_bool.

	* call.c (add_template_candidate_real): Return if the declaration is
	explicit and we're only looking for non-converting constructor.
	* cp-tree.h (lang_decl_fn): Add has_dependent_explicit_spec_p bit.
	(DECL_HAS_DEPENDENT_EXPLICIT_SPEC_P): New macro.
	(cp_decl_specifier_seq): Add explicit_specifier field.
	(build_explicit_specifier, store_explicit_specifier): Declare.
	* decl.c (grokdeclarator): Call store_explicit_specifier.
	(build_explicit_specifier): New function.
	* parser.c (cp_parser_function_specifier_opt) <case RID_EXPLICIT>:
	Parse C++20 explicit(bool).
	* pt.c (store_explicit_specifier, lookup_explicit_specifier): New.
	(tsubst_function_decl): Handle explicit(dependent-expr).

	* g++.dg/cpp2a/explicit1.C: New test.
	* g++.dg/cpp2a/explicit10.C: New test.
	* g++.dg/cpp2a/explicit11.C: New test.
	* g++.dg/cpp2a/explicit12.C: New test.
	* g++.dg/cpp2a/explicit13.C: New test.
	* g++.dg/cpp2a/explicit2.C: New test.
	* g++.dg/cpp2a/explicit3.C: New test.
	* g++.dg/cpp2a/explicit4.C: New test.
	* g++.dg/cpp2a/explicit5.C: New test.
	* g++.dg/cpp2a/explicit6.C: New test.
	* g++.dg/cpp2a/explicit7.C: New test.
	* g++.dg/cpp2a/explicit8.C: New test.
	* g++.dg/cpp2a/explicit9.C: New test.

	* testsuite/20_util/any/cons/explicit.cc: Adjust dg-error.
	* testsuite/20_util/pair/cons/explicit_construct.cc: Likewise.
	* testsuite/20_util/tuple/cons/explicit_construct.cc: Likewise.

From-SVN: r265641
2018-10-30 19:59:41 +00:00
Segher Boessenkool 8d42623b37 xfail ira-shrink-wrap-prep tests (PR87708)
After r265398, the ira-shrinkwrap-prep-[12].c tests fail on all
targets, because the IRA feature tested can only move hard registers
down, and we no longer have hard registers for the function parameters
at this stage.


gcc/testsuite/
	PR rtl-optimization/87708
	gcc.dg/ira-shrinkwrap-prep-1.c: xfail test.
	gcc.dg/ira-shrinkwrap-prep-2.c: xfail test.

From-SVN: r265639
2018-10-30 20:49:36 +01:00
Jan Hubicka 3487ab638e * tree.c
(free_lang_data_d, add_tree_to_fld_list, fld_worklist_push): Move
	head in file.
	(free_lang_data_in_type): Forward declare.
	(fld_type_variant_equal_p): New function.
	(fld_type_variant): New function
	(fld_incomplete_types): New hash.
	(fld_incomplete_type_of): New function
	(fld_simplfied-type): New function.
	(free_lang_data_in_decl): Add fld parameter; simplify type of FIELD_DECL
	(free_lang_data): Allocate and free fld_incomplete_type; update call
	of free_lang_data_in_decl.

From-SVN: r265638
2018-10-30 19:13:47 +00:00
Paolo Carlini 190facef83 decl.c (grokdeclarator): Use declarator->id_loc in diagnostic about flexible array members.
/cp
2018-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* decl.c (grokdeclarator): Use declarator->id_loc in diagnostic
	about flexible array members.

/testsuite
2018-10-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp1z/has-unique-obj-representations1.C: Test location too.
	* g++.dg/ext/flexarray-mangle-2.C: Likewise.
	* g++.dg/ext/flexarray-mangle.C: Likewise.
	* g++.dg/ext/flexarray-subst.C: Likewise.
	* g++.dg/ext/flexary10.C: Likewise.
	* g++.dg/ext/flexary11.C: Likewise.
	* g++.dg/ext/flexary14.C: Likewise.
	* g++.dg/ext/flexary16.C: Likewise.
	* g++.dg/ext/flexary26.C: Likewise.
	* g++.dg/ext/flexary27.C: Likewise.
	* g++.dg/ext/flexary7.C: Likewise.
	* g++.dg/ext/pr71290.C: Likewise.

From-SVN: r265636
2018-10-30 18:29:49 +00:00
Eric Botcazou 6a6e0926b2 * gcov.c (output_lines): Remove duplicate line.
From-SVN: r265634
2018-10-30 18:01:41 +00:00
Aaron Sawdey 320314dba3 rs6000.md (bswapdi2): Force address into register if not in indexed or indirect form.
2018-10-30  Aaron Sawdey  <acsawdey@linux.ibm.com>

	* config/rs6000/rs6000.md (bswapdi2): Force address into register
	if not in indexed or indirect form.
	(bswapdi2_load): Change predicate to indexed_or_indirect_operand.
	(bswapdi2_store): Ditto.
	* config/rs6000/rs6000.c (rs6000_force_indexed_or_indirect_mem): New
	helper function.
	* config/rs6000/rs6000-protos.h (rs6000_force_indexed_or_indirect_mem):
	Prototype for helper function.

From-SVN: r265632
2018-10-30 12:05:37 -05:00
Martin Sebor d2bfc447e8 extend.texi (optimize): Clarify/expand attribute documentation.
gcc/ChangeLog:

	* doc/extend.texi (optimize): Clarify/expand attribute documentation.
	(target, pragma GCC optimize, pragma GCC target): Ditto.

From-SVN: r265631
2018-10-30 09:46:07 -06:00
Jeff Law a2e0398a31 Add PR marker
From-SVN: r265628
2018-10-30 09:14:39 -06:00
Nicholas Krause 1f82422acc method-serial.cc: Mark varible as potentially unused to silence warning.
* method-serial.cc: Mark varible as potentially unused
        to silence warning.

From-SVN: r265627
2018-10-30 09:13:26 -06:00
Jonathan Wakely 0321d9fac6 PR libstdc++/87809 avoid invalid expressions in exception specifications
If the allocator isn't default constructible then checking if the
default constructor throws in an exception specification makes the
declaration invalid. Use the type trait instead.

	PR libstdc++/87809
	* include/bits/forward_list.h (_Fwd_list_impl::_Fwd_list_impl()): Use
	trait in exception-specification instead of possibly invalid
	expression.
	* include/bits/stl_bvector.h (_Bvector_impl::_Bvector_impl()):
	Likewise.
	* include/bits/stl_list.h (_List_impl::_List_impl()): Likewise.
	* include/bits/stl_vector.h (_Vector_impl::_Vector_impl()): Likewise.
	* testsuite/23_containers/forward_list/cons/87809.cc: New test.
	* testsuite/23_containers/list/cons/87809.cc: New test.
	* testsuite/23_containers/vector/bool/cons/87809.cc: New test.
	* testsuite/23_containers/vector/cons/87809.cc: New test.

From-SVN: r265626
2018-10-30 14:49:43 +00:00