1. 20 Aug, 2018 7 commits
    • [PATCH] Kill cpp-id-data.h · abcd1775
      https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01149.html
      	libcpp/
      	* Makefile.in (TAGS_SOURCES): Remove cpp-id-data.h.
      	* include/cpp-id-data.h: Delete.
      	* internal.h: Include cpplib.h not cpp-id-data.h.
      	gcc/
      	* Makefile.in (CPP_ID_DATA_H): Delete.
      	(CPP_INTERNAL_H): Don't add it.
      	(GTFILES): Replace CPP_ID_DATA_H with CPPLIB_H.
      	* gengtype.c (open_base_files): Replace cpp-id-data.h with cpplib.h
      
      From-SVN: r263663
      Nathan Sidwell committed
    • re PR c++/78655 (gcc doesn't exploit the fact that the result of pointer… · 4864297f
      re PR c++/78655 (gcc doesn't exploit the fact that the result of pointer addition can not be nullptr)
      
      2018-08-20  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/78655
      	* tree-vrp.c (extract_range_from_binary_expr_1): Make
      	pointer + offset nonnull if either operand is nonnull work.
      
      	* gcc.dg/tree-ssa/evrp11.c: New testcase.
      
      From-SVN: r263662
      Richard Biener committed
    • PR libstdc++/86963 Remove use of __tuple_base in std::tuple · a2c5e1ae
      The _Tuple_impl base class can be used to disable copy/move assignment,
      without requiring an extra base class.
      
      Exception specifications on std::tuple assignment and swap functions can
      be defined directly using is_nothrow_swappable, instead of querying the
      base classes.
      
      	PR libstdc++/86963
      	* include/std/tuple (_Tuple_impl::operator=): Define as deleted.
      	(_Tuple_impl::_M_assign): New functions to perform assignment instead
      	of assignment operators.
      	(_Tuple_impl::_M_swap): Remove exception specification.
      	(_Tuple_impl<_Idx, _Head>): Likewise.
      	(_TC::_NonNestedTuple, _TC::_NotSameTuple): Use __remove_cvref_t.
      	(__tuple_base): Remove.
      	(tuple, tuple<_T1, _T2>): Remove inheritance from __tuple_base.
      	(tuple::operator=, tuple<_T1, _T2>::operator=): Call _M_assign.
      	(tuple::swap, tuple<_T1, _T2>::swap): Define exception specification
      	using __is_nothrow_swappable.
      	(tuple<_T1, _T2>::tuple(_U1&&, _U2&&)): Use __remove_cvref_t.
      
      From-SVN: r263661
      Jonathan Wakely committed
    • [debug] Fix handling of vlas in lto · ea379c9e
      Atm, when running vla-1.c with -O0 -flto, we have:
      ...
      FAIL: gcc.dg/guality/vla-1.c -O0 -flto -fuse-linker-plugin \
        -fno-fat-lto-objects line 17 sizeof (a) == 6
      ...
      
      The vla a[i + 1] in f1 is gimplified into:
      ...
      f1 (int i)
      {
        char a[0:D.1922] [value-expr: *a.0];
        char[0:D.1922] * a.0;
      
        D.1921 = i + 1;
        D.1926 = (sizetype) D.1921;
        a.0 = __builtin_alloca_with_align (D.1926, 8);
      ...
      
      The early debug info for the upper bound of the type of vla a that we stream
      out is:
      ...
        DIE    0: DW_TAG_subrange_type (0x7f85029a90f0)
          DW_AT_upper_bound: location descriptor:
            (0x7f85029a9230) DW_OP_GNU_variable_value die -> 0 (0x7f85029a94b0), 0
        DIE    0: DW_TAG_variable (0x7f85029a94b0)
          DW_AT_name: "D.1922"
          DW_AT_type: die -> 0 (0x7f85029a3d70)
          DW_AT_artificial: 1
      ...
      
      and in ltrans we have for that same upper bound:
      ...
        DIE    0: DW_TAG_subrange_type (0x7f5183b57d70)
          DW_AT_upper_bound: die -> 0 (0x7f5183b576e0)
        DIE    0: DW_TAG_variable (0x7f5183b576e0)
          DW_AT_name: "D.4278"
          DW_AT_abstract_origin: die -> label: vla_1.c.6719312a + 193 (0x7f5183b57730)
      ...
      where D.4278 has abstract origin D.1922.
      
      The D.4278 die has no DW_AT_location, so when evaluting "sizeof (a)" in the
      debugger, we can't find the information to get the value of D.4278, and the
      debugger prints "<optimized out>".
      
      This patch fixes that by either:
      - adding DW_AT_location to the referenced variable die, or
      - instead of using a ref for the upper bound, using an exprloc.
      
      When changing gcc.dg/guality/guality.exp to run the usual flto flavours
      "-fno-use-linker-plugin -flto-partition=none" and "-fuse-linker-plugin
      -fno-fat-lto-objects" in combination with O0, Og, O1, O2, O3 and Os, this patch
      fixes all (20) failures in vla-1.c, leaving only:
      ...
      No symbol "i" in current context.
      UNSUPPORTED: gcc.dg/guality/vla-1.c  -O3 -flto -fno-use-linker-plugin \
        -flto-partition=none line 17 i == 5
      'a' has unknown type; cast it to its declared type
      UNSUPPORTED: gcc.dg/guality/vla-1.c  -O3 -flto -fno-use-linker-plugin \
        -flto-partition=none line 17 sizeof (a) == 6
      ...
      
      Bootstrapped and reg-tested on x86_64.
      
      2018-08-20  Tom de Vries  <tdevries@suse.de>
      
      	* dwarf2out.c (add_scalar_info): Don't add reference to existing die
      	unless the referenced die describes the added property using
      	DW_AT_location or DW_AT_const_value.  Fall back to exprloc case.
      	Otherwise, add a DW_AT_location to the referenced die.
      
      From-SVN: r263660
      Tom de Vries committed
    • [PATCH] #assert becomes macro-like · 3fb558b1
      https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01140.html
      	libcpp/
      	* include/cpp-id-data.h (struct answer): Delete.
      	* include/cpplib.h (struct answer): Don't forward-declare.
      	(enum cpp_macro_kind): Add cmk_assert.
      	(struct cpp_macro): Union parms and next assert chain.
      	(union _cpp_hashnode_value): 'answer' field is cpp_macro.
      	* directives.c (parse_answer): Convert to use cpp_macro. Return
      	true on success. 
      	(parse_assertion, find_answer, _cpp_test_assertion, cpp_do_assert)
      	(cpp_do_unassert): Convert to use cpp_macro.
      	* macro.c (warn_of_redefinition, _cpp_new_macro)
      	(check_trad_stringification, cpp_macro_definition): Adjust macro
      	parm access.
      	* traditional.c (_cpp_replacement_text_len)
      	(_cpp_copy_replacement_text, _cpp_create_trad_definition): Likewise.
      	gcc/c-family/
      	* c-ada-spec.c (macro_length, dump_ada_macros): Adjust macro parm
      	access.
      
      From-SVN: r263658
      Nathan Sidwell committed
    • Refactor std::optional SFINAE constraints · b655b8fc
      	* include/std/optional (_Optional_payload): Use variable templates
      	for conditions in default template arguments and exception
      	specifications.
      	(optional): Likewise. Adjust indentation.
      	(optional::__not_self, optional::__not_tag, optional::_Requires): New
      	SFINAE helpers.
      	(optional::optional): Use new helpers in constructor constraints.
      	* include/std/type_traits (__or_v, __and_v): New variable templates.
      	* testsuite/20_util/optional/cons/value_neg.cc: Change dg-error to
      	dg-prune-output. Remove unused header.
      
      From-SVN: r263657
      Jonathan Wakely committed
    • Daily bump. · 285ee4d0
      From-SVN: r263656
      GCC Administrator committed
  2. 19 Aug, 2018 2 commits
  3. 18 Aug, 2018 4 commits
  4. 17 Aug, 2018 21 commits
    • [PATCH] Adjust lazy macro definition · 800c0e98
      https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01072.html
      	libcpp/
      	* include/cpplib.h (struct cpp_callbacks): Replace
      	user_builtin_macro with user_lazy_macro.
      	(struct cpp_macro): add lazy field.
      	(enum cpp_builtin_type): Remove BT_FIRST_USER, BT_LAST_USER.
      	(cpp_define_lazily): Declare.
      	* macro.c (enter_macro_context) Use _cpp_maybe_notify_macro_use.
      	(warn_of_redefinition): Use cpp_builtin_macro_p, directly call
      	user_lazy_macro hook.
      	(_cpp_new_macro): Clear lazy field.
      	(cpp_define_lazily): Define.
      	(_cpp_notify_macro_use): Adjust lazy definition code.
      	(cpp_macro_definition): No need to do lazy definition here.
      	* pch.c (write_macdef, save_macros): Likewise.
      	gcc/c-family/
      	* c-cppbuiltin.c (struct lazy_hex_fp_value_struct): Remove macro
      	field.
      	(laxy_hex_fp_value_count): Make unsigned.
      	(lazy_hex_fp_value): Provided with macro & lazy number.  Directly
      	manipulate the macro.
      	(builtin_defin_with_hex_fp_value): Adjust callback name, use
      	cpp_define_lazily.
      
      From-SVN: r263640
      Nathan Sidwell committed
    • re PR testsuite/86996 (gcc.dg/tree-ssa/builtin-sprintf-warn-1.c FAILs) · 6f0821f4
      PR testsuite/86996
      
      gcc/testsuite/CHangeLog:
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Adjust.
      
      From-SVN: r263636
      Martin Sebor committed
    • C++: -Wwrite-strings: use location of string constant · 505ce5ab
      Consider:
      
      extern int callee (const char *one, char *two, const char *three);
      
      int test ()
      {
        return callee ("first", "second", "third");
      }
      
      for which -Wwrite-strings was emitting:
      
      Wwrite-strings.C: In function 'int test()':
      Wwrite-strings.C:10:44: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
      10 |   return callee ("first", "second", "third");
         |                                            ^
      
      This patch fixes the warning so that it underlines the pertinent argument
      at the callsite:
      
      Wwrite-strings.C: In function 'int test()':
      Wwrite-strings.C:10:27: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
      10 |   return callee ("first", "second", "third");
         |                           ^~~~~~~~
      
      Ideally we ought to also issue a "note" highlighting the pertinent
      parameter within the decl, but that's not readily available, so I'm
      saving it for another patch.
      
      gcc/cp/ChangeLog:
      	* typeck.c (string_conv_p): Extract location from EXP and use it
      	in preference to input_location when issuing warnings.
      
      gcc/testsuite/ChangeLog:
      	* g++.dg/conversion/Wwrite-strings.C: New test.
      
      From-SVN: r263635
      David Malcolm committed
    • doc: Use @ref, not @xref, in the middle of a sentence · 8bdea528
      makeinfo warns about this.
      
      
      	* doc/md.texi (Patterns): Use @ref instead of @xref in the middle of
      	a sentence.
      
      From-SVN: r263633
      Segher Boessenkool committed
    • 2018-08-17 Sandra Loosemore <sandra@codesourcery.com> · 661d1750
      	MAINTAINERS: Add c-sky port maintainers.
      
      From-SVN: r263632
      Sandra Loosemore committed
    • C-SKY port: libgcc · 4cd0bc3b
      2018-08-17  Jojo  <jijie_rong@c-sky.com>
      	    Huibin Wang  <huibin_wang@c-sky.com>
      	    Sandra Loosemore  <sandra@codesourcery.com>
      	    Chung-Lin Tang  <cltang@codesourcery.com>
      
      	C-SKY port: libgcc
      
      	libgcc/
      	* config.host: Add C-SKY support.
      	* config/csky/*: New.
      
      Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com>
      Co-Authored-By: Huibin Wang <huibin_wang@c-sky.com>
      Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>
      
      From-SVN: r263631
      Jojo committed
    • C-SKY port: Testsuite · 9d21b398
      2018-08-17  Sandra Loosemore  <sandra@codesourcery.com>
      	    Chung-Lin Tang  <cltang@codesourcery.com>
      	    Xianmiao Qu  <xianmiao_qu@c-sky.com>
      
      	C-SKY port: Testsuite
      
      	gcc/testsuite/
      	* g++.dg/Wno-frame-address.C: Adjust for C-SKY.
      	* g++.dg/torture/type-generic-1.C: Likewise.
      	* gcc.c-torture/compile/20000804-1.c: Likewise.
      	* gcc.c-torture/execute/20101011-1.c: Likewise.
      	* gcc.c-torture/execute/ieee/mul-subnormal-single-1.x: Likewise.
      	* gcc.dg/20020312-2.c: Likewise.
      	* gcc.dg/Wno-frame-address.c: Likewise.
      	* gcc.dg/c11-true_min-1.c: Likewise.
      	* gcc.dg/sibcall-10.c: Likewise.
      	* gcc.dg/sibcall-9.c: Likewise.
      	* gcc.dg/stack-usage-1.c: Likewise.
      	* gcc.dg/torture/float32-tg-3.c: Likewise.
      	* gcc.dg/torture/float32x-tg-3.c: Likewise.
      	* gcc.dg/torture/float64-tg-3.c: Likewise.
      	* gcc.dg/torture/float64x-tg-3.c: Likewise.
      	* gcc.dg/torture/type-generic-1.c: Likewise.
      	* gcc.target/csky/*: New.
      	* lib/target-supports.exp (check_profiling_available): Add
      	csky-*-elf.
      	(check_effective_target_hard_float): Handle C-SKY targets with
      	single-precision hard float only.
      	(check_effective_target_logical_op_short_circuit): Handle C-SKY.
      
      Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com>
      Co-Authored-By: Xianmiao Qu <xianmiao_qu@c-sky.com>
      
      From-SVN: r263630
      Sandra Loosemore committed
    • C-SKY port: Documentation · fbceb769
      2018-08-17  Sandra Loosemore  <sandra@codesourcery.com>
      
      	C-SKY port: Documentation
      
      	gcc/
      	* doc/extend.texi (C-SKY Function Attributes): New section.
      	* doc/invoke.texi (Option Summary): Add C-SKY options.
      	(C-SKY Options): New section.
      	* doc/md.texi (Machine Constraints): Document C-SKY constraints.
      
      From-SVN: r263629
      Sandra Loosemore committed
    • C-SKY port: Backend implementation · cc7232b9
      2018-08-17  Jojo  <jijie_rong@c-sky.com>
      	    Huibin Wang  <huibin_wang@c-sky.com>
      	    Sandra Loosemore  <sandra@codesourcery.com>
      	    Chung-Lin Tang  <cltang@codesourcery.com>
      
      	C-SKY port: Backend implementation
      
      	gcc/
      	* config/csky/*: New.
      	* common/config/csky/*: New.
      
      Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com>
      Co-Authored-By: Huibin Wang <huibin_wang@c-sky.com>
      Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>
      
      From-SVN: r263628
      Jojo committed
    • C-SKY port: Configury · 56856b58
      2018-08-17  Jojo  <jijie_rong@c-sky.com>
      	    Huibin Wang  <huibin_wang@c-sky.com>
      	    Sandra Loosemore  <sandra@codesourcery.com>
      	    Chung-Lin Tang  <cltang@codesourcery.com>
      	    Andrew Jenner  <andrew@codesourcery.com>
      
      	C-SKY port: Configury
      
      	gcc/
      	* config.gcc (csky-*-*): New.
      	* configure.ac: Add csky to targets for dwarf2 debug_line support.
      	* configure: Regenerated.
      
      	contrib/
      	* config-list.mk (LIST): Add csky-elf and csky-linux-gnu.
      
      
      
      Co-Authored-By: Andrew Jenner <andrew@codesourcery.com>
      Co-Authored-By: Chung-Lin Tang <cltang@codesourcery.com>
      Co-Authored-By: Huibin Wang <huibin_wang@c-sky.com>
      Co-Authored-By: Sandra Loosemore <sandra@codesourcery.com>
      
      From-SVN: r263627
      Jojo committed
    • Formatted printing for dump_* in the middle-end · 6f795a92
      This patch converts dump_print and dump_printf_loc from using
      printf (and thus ATTRIBUTE_PRINTF) to using a new pretty-printer
      based on pp_format, which supports formatting middle-end types.
      
      In particular, the following codes are implemented (in addition
      to the standard pretty_printer ones):
      
         %E: gimple *:
             Equivalent to: dump_gimple_expr (MSG_*, TDF_SLIM, stmt, 0)
         %G: gimple *:
             Equivalent to: dump_gimple_stmt (MSG_*, TDF_SLIM, stmt, 0)
         %T: tree:
             Equivalent to: dump_generic_expr (MSG_*, arg, TDF_SLIM).
      
      Hence it becomes possible to convert e.g.:
      
        if (dump_enabled_p ())
          {
            dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                             "not vectorized: different sized vector "
                             "types in statement, ");
            dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, vectype);
            dump_printf (MSG_MISSED_OPTIMIZATION, " and ");
            dump_generic_expr (MSG_MISSED_OPTIMIZATION, TDF_SLIM, nunits_vectype);
            dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
          }
      
      into a one-liner:
      
        if (dump_enabled_p ())
          dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
                           "not vectorized: different sized vector "
                           "types in statement, %T and %T\n",
                           vectype, nunits_vectype);
      
      Unlike regular pretty-printers, this one captures optinfo_item
      instances for the formatted chunks as appropriate, so that when
      written out to a JSON optimization record, the relevant parts of
      the message are labelled by type, and by source location (so that
      e.g. %G is entirely equivalent to using dump_gimple_stmt).
      
      dump_printf and dump_printf_loc become marked with
      ATTRIBUTE_GCC_DUMP_PRINTF, which the patch also implements.
      
      gcc/c-family/ChangeLog:
      	* c-format.c (enum format_type): Add gcc_dump_printf_format_type.
      	(gcc_dump_printf_length_specs): New.
      	(gcc_dump_printf_flag_pairs): New.
      	(gcc_dump_printf_flag_specs): New.
      	(gcc_dump_printf_char_table): New.
      	(format_types_orig): Add entry for "gcc_dump_printf".
      	(init_dynamic_diag_info): Set up length_char_specs and
      	conversion_specs for gcc_dump_printf_format_type.
      	(handle_format_attribute): Handle gcc_dump_printf_format_type.
      
      gcc/ChangeLog:
      	* dump-context.h: Include "dumpfile.h".
      	(dump_context::dump_printf_va): Convert final param from va_list
      	to va_list *.  Convert from ATTRIBUTE_PRINTF to
      	ATTRIBUTE_GCC_DUMP_PRINTF.
      	(dump_context::dump_printf_loc_va): Likewise.
      	* dumpfile.c: Include "stringpool.h".
      	(make_item_for_dump_printf_va): Delete.
      	(make_item_for_dump_printf): Delete.
      	(class dump_pretty_printer): New class.
      	(dump_pretty_printer::dump_pretty_printer): New ctor.
      	(dump_pretty_printer::emit_items): New member function.
      	(dump_pretty_printer::emit_any_pending_textual_chunks): New member
      	function.
      	(dump_pretty_printer::emit_item): New member function.
      	(dump_pretty_printer::stash_item): New member function.
      	(dump_pretty_printer::format_decoder_cb): New member function.
      	(dump_pretty_printer::decode_format): New member function.
      	(dump_context::dump_printf_va): Reimplement in terms of
      	dump_pretty_printer.
      	(dump_context::dump_printf_loc_va): Convert final param from va_list
      	to va_list *.
      	(dump_context::begin_scope): Reimplement call to
      	make_item_for_dump_printf.
      	(dump_printf): Update for change to dump_printf_va.
      	(dump_printf_loc): Likewise.
      	(selftest::test_capture_of_dump_calls): Convert "stmt" from
      	greturn * to gimple *.  Add a test_decl.  Add tests of dump_printf
      	with %T, %E, and %G.
      	* dumpfile.h (ATTRIBUTE_GCC_DUMP_PRINTF): New macro.
      	(dump_printf): Replace ATTRIBUTE_PRINTF_2 with
      	ATTRIBUTE_GCC_DUMP_PRINTF (2, 3).
      	(dump_printf_loc): Replace ATTRIBUTE_PRINTF_3 with
      	ATTRIBUTE_GCC_DUMP_PRINTF (3, 0).
      	* tree-vect-data-refs.c (vect_lanes_optab_supported_p): Convert
      	use of HOST_WIDE_INT_PRINT_DEC on unsigned HOST_WIDE_INT "count"
      	within a dump_printf_loc call to "%wu".
      	(vector_alignment_reachable_p): Merge two dump_printf[_loc] calls,
      	converting a use of HOST_WIDE_INT_PRINT_DEC to "%wd".  Add a
      	missing space after "=".
      	* tree-vect-loop.c (vect_analyze_loop_2) Within a dump_printf
      	call, convert use of HOST_WIDE_INT_PRINT_DEC to "%wd".
      	* tree-vect-slp.c (vect_slp_bb): Within a dump_printf_loc call,
      	convert use of HOST_WIDE_INT_PRINT_UNSIGNED to "%wu".
      	* tree-vectorizer.c (try_vectorize_loop_1): Likewise.  Remove
      	duplicate "vectorized" from message.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/format/gcc_diag-1.c: Fix typo.  Add test coverage for
      	gcc_dump_printf.
      	* gcc.dg/format/gcc_diag-10.c: Add gimple typedef.  Add test
      	coverage for gcc_dump_printf.
      
      From-SVN: r263626
      David Malcolm committed
    • PR libstdc++/86963 Implement LWG 2729 constraints on tuple assignment · 478490f6
      	PR libstdc++/86963
      	* include/std/tuple (__tuple_base): New class template with deleted
      	copy assignment operator.
      	(tuple, tuple<_T1, _T2>): Derive from __tuple_base<tuple> so that
      	implicit copy/move assignment operator will be deleted/suppressed.
      	(tuple::__assignable, tuple<_T1, _T2>::__assignable): New helper
      	functions for SFINAE constraints on assignment operators.
      	(tuple::__nothrow_assignable, tuple<_T1, _T2>::__nothrow_assignable):
      	New helper functions for exception specifications.
      	(tuple::operator=(const tuple&), tuple::operator=(tuple&&))
      	(tuple<_T1, _T2>::operator=(const tuple&))
      	(tuple<_T1, _T2>::operator=(tuple&&)): Change parameter types to
      	__nonesuch_no_braces when the operator should be defined implicitly.
      	Use __nothrow_assignable for exception specifications.
      	(tuple::operator=(const tuple<_UElements...>&))
      	(tuple::operator=(tuple<_UElements...>&&))
      	(tuple<_T1, _T2>::operator=(const tuple<_U1, _U2>&))
      	(tuple<_T1, _T2>::operator=(tuple<_U1, _U2>&&))
      	(tuple<_T1, _T2>::operator=(const pair<_U1, _U2>&))
      	(tuple<_T1, _T2>::operator=(pair<_U1, _U2>&&)): Constrain using
      	__assignable and use __nothrow_assignable for exception
      	specifications.
      	* python/libstdcxx/v6/printers.py (is_specialization_of): Accept
      	gdb.Type as first argument, instead of a string.
      	(StdTuplePrinter._iterator._is_nonempty_tuple): New method to check
      	tuple for expected structure.
      	(StdTuplePrinter._iterator.__init__): Use _is_nonempty_tuple.
      	* testsuite/20_util/tuple/dr2729.cc: New test.
      	* testsuite/20_util/tuple/element_access/get_neg.cc: Change dg-error
      	to dg-prune-output.
      
      From-SVN: r263625
      Jonathan Wakely committed
    • Fix poly types after PR tree-optimization/71625 strlen optimization · 81bf52f5
      Same as r263561, but for arm: avoid compilation errors caused by poly
      initializers getting treated as string literals.
      
      Tested on arm-none-linux-gnueabihf.
      
      gcc/ChangeLog:
      
      	* config/arm/arm-builtins.c (arm_init_simd_builtin_types): Clear
      	polyNxK_t element's TYPE_STRING_FLAG.
      
      From-SVN: r263624
      Szabolcs Nagy committed
    • rs6000: Give names to cbranch/creturn patterns · 071db4aa
      This gives a name to the conditional branch and conditional return
      patterns, so that it looks neater in dumps and verbose asm.  Also, the
      comment for conditional branch was out of date; this fixes it.
      
      
      	* config/rs6000/rs6000.md (*cbranch, *creturn): Name these patterns
      	(they were unnamed before).  Fix comments.
      
      From-SVN: r263623
      Segher Boessenkool committed
    • [PATCH] Macro body is trailing array · 10f04917
      https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01037.html
      	* include/cpplib.h (enum cpp_macro_kind): New.
      	(struct cpp_macro): Make body trailing array.  Add kind field,
      	delete traditional flag.
      	* internal.h (_cpp_new_macro): Declare.
      	(_cpp_reserve_room): New inline.
      	(_cpp_commit_buf): Declare.
      	(_cpp_create_trad_definition): Return new macro.
      	* lex.c (_cpp_commit_buff): New.
      	* macro.c (macro_real_token_count): Count backwards.
      	(replace_args): Pointer equality not orderedness.
      	(_cpp_save_parameter): Use _cpp_reserve_room.
      	(alloc_expansion_token): Delete.
      	(lex_expansion_token): Return macro pointer.  Use _cpp_reserve_room.
      	(create_iso_definition): Allocate macro itself.  Adjust for
      	different allocation ordering.
      	(_cpp_new_macro): New.
      	(_cpp_create_definition): Adjust for API changes.
      	* traditional.c (push_replacement_text): Don't set traditional
      	flag.
      	(save_replacement_text): Likewise.
      	(_cpp_create_trad_definition): Allocate macro itself, Adjust for
      	different allocation ordering.
      
      From-SVN: r263622
      Nathan Sidwell committed
    • [PATCH] Move cpp_macro to cpplib.h · c5d725c0
      https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01016.html
      	libcpp/
      	* cpp-id-data.h (uchar, UC): Move to internal.h
      	(struct cpp_macro): Move to cpplib.h.
      	* internal.h (uchar, UC): From cpp-id-data.h.
      	* include/cpplib.h (struct cpp_macro): From cpp-id-data.h.
      	gcc/c-family/
      	* c-ada-spec.c: Don't #include "cpp-id-data.h"
      	* c-cppbuiltin.c: Likewise.
      	gcc/
      	* cppbuiltin.c: Include "cpplib.h", not "cpp-id-data.h".
      
      From-SVN: r263618
      Nathan Sidwell committed
    • re PR tree-optimization/86841 (ICE in gcc/gcc/tree-vrp.c:1325 with graphite) · 0138492e
      2018-08-17  Richard Biener  <rguenther@suse.de>
      
      	PR tree-optimization/86841
      	* wide-int-range.cc (wide_int_range_lshift): Use to_uhwi.
      
      From-SVN: r263615
      Richard Biener committed
    • Merge Ignore and Deprecated in .opt files. · c0c12356
      2018-08-17  Martin Liska  <mliska@suse.cz>
      
      	* common.opt: Remove Warn, Init and Report for options with
              Ignore/Deprecated flag. Warning is done automatically for
              Deprecated flags.
      	* config/i386/i386.opt: Likewise.
      	* config/ia64/ia64.opt: Likewise.
      	* config/rs6000/rs6000.opt: Likewise.
      	* cppbuiltin.c (define_builtin_macros_for_compilation_flags):
              Remove usage of flag_check_pointer_bounds.
      	* lto-wrapper.c (merge_and_complain): Do not handle
              OPT_fcheck_pointer_bounds.
      	(append_compiler_options): Likewise.
      	* opt-functions.awk: Do not handle Deprecated.
      	* optc-gen.awk: Check that Var, Report and Init are not
              used for an option with Ignore/Deprecated flag.
      	* opts-common.c (decode_cmdline_option): Do not report
              CL_ERR_DEPRECATED.
      	(read_cmdline_option): Report warning for OPT_SPECIAL_deprecated
              options.
      	* opts.h (struct cl_option): Remove cl_deprecated flag.
      	(CL_ERR_DEPRECATED): Remove error enum value.
      2018-08-17  Martin Liska  <mliska@suse.cz>
      
      	* g++.dg/opt/mpx.C: Fix scanned pattern.
      	* gcc.target/i386/mpx.c: Likewise.
      	* g++.dg/warn/Wunreachable-code-1.C: Remove.
      	* g++.dg/warn/Wunreachable-code-2.C: Likewise.
      	* gcc.dg/torture/pr52969.c: Likewise.
      	* g++.dg/warn/pr31246-2.C: Likewise.
      	* g++.dg/warn/pr31246.C: Likewise.
      	* gcc.dg/pr33092.c: Likewise.
      	* g++.dg/opt/eh1.C: Remove a deprecated option.
      	* g++.dg/template/inline1.C: Likewise.
      	* g++.dg/tree-ssa/pr81408.C: Likewise.
      	* gcc.dg/pr41837.c: Likewise.
      	* gcc.dg/pr41841.c: Likewise.
      	* gcc.dg/pr42250.c: Likewise.
      	* gcc.dg/pr43084.c: Likewise.
      	* gcc.dg/pr43317.c: Likewise.
      	* gcc.dg/pr51879-18.c: Likewise.
      	* gcc.dg/torture/pr36066.c: Likewise.
      	* gcc.dg/tree-ssa/ifc-8.c: Likewise.
      	* gcc.dg/tree-ssa/ifc-cd.c: Likewise.
      	* gcc.dg/tree-ssa/pr19210-1.c: Likewise.
      	* gcc.dg/tree-ssa/pr45122.c: Likewise.
      	* gcc.target/i386/pr45352-2.c: Likewise.
      	* gcc.target/i386/zee.c: Likewise.
      	* gfortran.dg/auto_char_len_2.f90: Likewise.
      	* gfortran.dg/auto_char_len_4.f90: Likewise.
      	* gfortran.dg/c_ptr_tests_15.f90: Likewise.
      	* gfortran.dg/char_array_structure_constructor.f90: Likewise.
      	* gfortran.dg/gomp/pr47331.f90: Likewise.
      	* gfortran.dg/pr40999.f: Likewise.
      	* gfortran.dg/pr41011.f: Likewise.
      	* gfortran.dg/pr42051.f03: Likewise.
      	* gfortran.dg/pr46804.f90: Likewise.
      	* gfortran.dg/pr83149_1.f90: Likewise.
      	* gfortran.dg/pr83149_b.f90: Likewise.
      	* gfortran.dg/whole_file_1.f90: Likewise.
      	* gfortran.dg/whole_file_10.f90: Likewise.
      	* gfortran.dg/whole_file_11.f90: Likewise.
      	* gfortran.dg/whole_file_12.f90: Likewise.
      	* gfortran.dg/whole_file_13.f90: Likewise.
      	* gfortran.dg/whole_file_14.f90: Likewise.
      	* gfortran.dg/whole_file_15.f90: Likewise.
      	* gfortran.dg/whole_file_16.f90: Likewise.
      	* gfortran.dg/whole_file_17.f90: Likewise.
      	* gfortran.dg/whole_file_18.f90: Likewise.
      	* gfortran.dg/whole_file_19.f90: Likewise.
      	* gfortran.dg/whole_file_2.f90: Likewise.
      	* gfortran.dg/whole_file_20.f03: Likewise.
      	* gfortran.dg/whole_file_3.f90: Likewise.
      	* gfortran.dg/whole_file_4.f90: Likewise.
      	* gfortran.dg/whole_file_5.f90: Likewise.
      	* gfortran.dg/whole_file_6.f90: Likewise.
      	* gfortran.dg/whole_file_7.f90: Likewise.
      	* gfortran.dg/whole_file_8.f90: Likewise.
      	* gfortran.dg/whole_file_9.f90: Likewise.
      	* gcc.dg/vect/vect.exp: Likewise.
      2018-08-17  Martin Liska  <mliska@suse.cz>
      
      	* c.opt: Remove Warn, Init and Report for options with
              Ignore/Deprecated flag. Warning is done automatically for
              Deprecated flags.
      
      From-SVN: r263614
      Martin Liska committed
    • re PR middle-end/86505 (__builtin_va_arg_pack_len() computes the number of arguments wrongly) · 36a072b4
      2018-08-17  Richard Biener  <rguenther@suse.de>
      
      	PR middle-end/86505
      	* tree-inline.c (copy_bb): When inlining __builtin_va_arg_pack_len ()
      	across a va-arg-pack using call adjust its return value accordingly.
      
      	* gcc.dg/torture/pr86505.c: New testcase.
      
      From-SVN: r263613
      Richard Biener committed
    • re PR tree-optimization/86853 (sprintf optimization for wide strings doesn't… · bbcbd744
      re PR tree-optimization/86853 (sprintf optimization for wide strings doesn't account for conversion failure)
      
      gcc/ChangeLog:
      
      	PR tree-optimization/86853
      	* gimple-ssa-sprintf.c (struct format_result): Rename member.
      	(struct fmtresult): Add member and initialize it in ctors.
      	(format_character): Handle %C.  Extend range to NUL.  Set MAYFAIL.
      	(format_string): Handle %S the same as %ls.  Set MAYFAIL.
      	(format_directive): Set POSUNDER4K when MAYFAIL is set.
      	(parse_directive): Handle %C same as %c.
      	(sprintf_dom_walker::compute_format_length): Adjust.
      	(is_call_safe): Adjust.
      
      gcc/testsuite/ChangeLog:
      
      	PR tree-optimization/86853
      	* gcc.dg/tree-ssa/builtin-sprintf-10.c: New test.
      	* gcc.dg/tree-ssa/builtin-sprintf-11.c: New test.
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-18.c: Adjust.
      
      From-SVN: r263612
      Martin Sebor committed
    • Daily bump. · e584cd35
      From-SVN: r263611
      GCC Administrator committed
  5. 16 Aug, 2018 6 commits
    • builtins.c (c_strlen): Add new parameter eltsize. · 4148b00d
      	* builtins.c (c_strlen): Add new parameter eltsize.  Use it
      	for determining how to count the elements.
      	* builtins.h (c_strlen): Adjust prototype.
      	* expr.c (string_constant): Add new parameter mem_size.
      	Set *mem_size appropriately.
      	* expr.h (string_constant): Adjust protoype.
      	* gimple-fold.c (get_range_strlen): Add new parameter eltsize.
      	* gimple-fold.h (get_range_strlen): Adjust prototype.
      	* gimple-ssa-sprintf.c (get_string_length): Add new parameter eltsize.
      	(format_string): Call get_string_length with eltsize.
      
      From-SVN: r263607
      Bernd Edlinger committed
    • diagnostics: fix bad interaction between line spans and line numbers · 5c6a2bf2
      Without this patch, the "line span" markers and the line numbering
      interacted badly, leading to stray copies of the line-span markers
      appearing as prefixes on the first source line in a span:
      
      missing-header-fixit-3.c: In function 'test':
      missing-header-fixit-3.c:9:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
      9 |   printf ("%i of %i\n", i, j);
        |   ^~~~~~
      missing-header-fixit-3.c:9:3: warning: incompatible implicit declaration of built-in function 'printf'
      missing-header-fixit-3.c:9:3: note: include '<stdio.h>' or provide a declaration of 'printf'
      missing-header-fixit-3.c:1:1:
        |+#include <stdio.h>
      missing-header-fixit-3.c:1:1:1 | /* Example of a fix-it hint that adds a #include directive,
      missing-header-fixit-3.c:9:3:
      missing-header-fixit-3.c:9:3:9 |   printf ("%i of %i\n", i, j);
        |   ^~~~~~
      
      With this patch, we now correctly print:
      
      missing-header-fixit-3.c: In function 'test':
      missing-header-fixit-3.c:9:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
      9 |   printf ("%i of %i\n", i, j);
        |   ^~~~~~
      missing-header-fixit-3.c:9:3: warning: incompatible implicit declaration of built-in function 'printf'
      missing-header-fixit-3.c:9:3: note: include '<stdio.h>' or provide a declaration of 'printf'
      missing-header-fixit-3.c:1:1:
      + |+#include <stdio.h>
      1 | /* Example of a fix-it hint that adds a #include directive,
      missing-header-fixit-3.c:9:3:
      9 |   printf ("%i of %i\n", i, j);
        |   ^~~~~~
      
      gcc/ChangeLog:
      	* diagnostic.c (default_diagnostic_start_span_fn): Call pp_string
      	to emit the span, rather than setting it as the prefix.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/missing-header-fixit-3.c: New test.
      
      From-SVN: r263606
      David Malcolm committed
    • diagnostics: tweak to line-insertion fix-it hints with line-numbering · 5218dafd
      This commit slightly tweaks line-insertion fix-it hints, so that
      with line-numbering, rather than e.g.:
      
       99 |       x = a;
          |+      break;
      110 |     case 'b':
          |     ^~~~~~~~
      
      we fill the margin with "+":
      
       99 |       x = a;
      +++ |+      break;
      110 |     case 'b':
          |     ^~~~~~~~
      
      to emphasize that this is a suggested new line, rather than the user's
      source.
      
      gcc/ChangeLog:
      	* diagnostic-show-locus.c (layout::start_annotation_line): Add
      	"margin_char" parameter, defaulting to space.  Use it in place
      	of pp_space for the initial part of the margin.
      	(layout::print_leading_fixits): Use '+' when filling the margin
      	of line-insertion fix-it hints.
      
      gcc/testsuite/ChangeLog:
      	* gcc.dg/plugin/diagnostic-test-show-locus-bw-line-numbers.c
      	(test_fixit_insert_newline): Update expected output to show '+'
      	characters in margin of line-insertion fix-it hint.
      
      From-SVN: r263605
      David Malcolm committed
    • rs6000: Delete old add+cmp patterns · 4416420e
      There are some patterns that recognise the parallel of an add and a
      compare, and split it back to the same two insns.  This apparently
      helped RIOS machines before RTL scheduling existed?  Either way, it
      isn't helpful anymore, and even hurts a tiny bit.  So, delete it.
      
      
      	* config/rs6000/rs6000.md (two unnamed define_insn and define_split):
      	Delete.
      
      From-SVN: r263604
      Segher Boessenkool committed
    • rs6000: Remove "length 4" from other insns · b24a46be
      There were many insns that set "length 4" explicitly while that does
      not make anything clearer to the reader.  So, simplify the code.
      
      
      	* config/rs6000/altivec.md: Don't set length attribute to the default
      	value.
      	* config/rs6000/darwin.md: Ditto.
      	* config/rs6000/dfp.md: Ditto.
      	* config/rs6000/htm.md: Ditto.
      	* config/rs6000/rs6000.md: Ditto.
      	* config/rs6000/sync.md: Ditto.
      	* config/rs6000/vsx.md: Ditto.
      
      From-SVN: r263603
      Segher Boessenkool committed
    • rs6000: Remove "length 4" from branch insns · a79db151
      Now that it is the default for branch insns like for all other insns,
      we don't need to set it explicitly so often anymore.
      
      
      	* config/rs6000/altivec.md: Don't set length attribute to the default
      	value, for branch instructions.
      	* config/rs6000/darwin.md: Ditto.
      	* config/rs6000/rs6000.md: Ditto.
      
      From-SVN: r263602
      Segher Boessenkool committed