1. 13 Dec, 2016 16 commits
  2. 12 Dec, 2016 24 commits
    • re PR tree-optimization/78777 (ICE in mark_reachable_handlers, at tree-eh.c:3823… · 1697df8c
      re PR tree-optimization/78777 (ICE in mark_reachable_handlers, at tree-eh.c:3823 (aarch64-linux-gnu))
      
      	PR tree-optimization/78777
      	* gimple-ssa-strength-reduction.c (create_add_on_incoming_edge,
      	insert_initializers): Use stmt_ends_bb_p instead of is_ctrl_stmt.
      
      	* g++.dg/torture/pr78777.C: New test.
      
      From-SVN: r243584
      Jakub Jelinek committed
    • re PR other/78766 (GCC Awk scripts use the non-POSIX /^{/ regex) · 27ec2266
      	PR other/78766
      	* opt-functions.awk (opt_args): Use [{] instead of { in regexps.
      	Formatting fix.
      
      From-SVN: r243583
      Jakub Jelinek committed
    • PR middle-end/78622 - -Wformat-length/-fprintf-return-value incorrect with overflow/wrapping · 573aa7d4
      gcc/ChangeLog:
      
      	PR middle-end/78622
      	PR middle-end78606
      	* gimple-ssa-sprintf.c (min_bytes_remaining): Use res.knownrange
      	rather than res.bounded.
      	(get_width_and_precision): Set precision to -1 when negative.
      	(adjust_range_for_overflow): New function.
      	(format_integer): Correct the handling of the space, plus, and pound
      	flags, and the special case of zero precision.
      	Always set res.bounded to true unless either precision or width
      	is specified and unknown.
      	Call adjust_range_for_overflow.
      	Avoid use zero as the shortest value when precision is specified
      	but unknown.
      	(format_directive): Remove vestigial quoting.  Always inform of
      	argument value or range when it's available.
      	(add_bytes): Correct the computation of boundrange used to
      	decide whether a warning is of a "maybe" or "defnitely" kind.
      
      gcc/testsuite/ChangeLog:
      
      	PR middle-end/78622
      	PR middle-end78606
      	* gcc.c-torture/execute/pr78622.c: New test.
      	* gcc.dg/tree-ssa/builtin-sprintf-2.c: Remove "benign" undefined
      	behavior inadvertently introduced in a previous commit.  Tighten
      	up final checking.
      	* gcc.dg/tree-ssa/builtin-sprintf-5.c: Rename macros for clarity.
      	Add test cases.
      	* gcc.dg/tree-ssa/builtin-sprintf-6.c: Add test cases.
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Same.
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-2.c: Same.
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c: Same.
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-5.c: Same.
      	* gcc.dg/tree-ssa/builtin-sprintf-warn-6.c: Remove xfails and
      	add a final optimization check.
      	* gcc.dg/tree-ssa/builtin-sprintf.c: Add test cases.
      	* gcc.dg/tree-ssa/pr78622.c: New test.
      
      From-SVN: r243582
      Martin Sebor committed
    • re PR fortran/78392 (ICE in gfc_trans_auto_array_allocation, at fortran/trans-array.c:5979) · 068b961b
      2016-12-12  Janus Weil  <janus@gcc.gnu.org>
      
      	PR fortran/78392
      	* expr.c (gfc_is_constant_expr): Specification functions are not
      	compile-time constants. Update documentation (add reference to F08
      	standard), add a FIXME.
      	(external_spec_function): Add reference to F08 standard.
      	* resolve.c (resolve_fl_variable): Ditto.
      
      2016-12-12  Janus Weil  <janus@gcc.gnu.org>
      
      	PR fortran/78392
      	* gfortran.dg/constant_shape.f90: New test case.
      
      From-SVN: r243580
      Janus Weil committed
    • combine: Handle mode expanding zero_extracts in change_zero_ext. · e4d60406
      Example:
      
        (zero_extract:DI (reg:SI)
                         (const_int 24)
                         (const_int 0))
      
      -->
      
        (and:DI (subreg:DI (lshiftrt:SI (reg:SI) (const_int 8))
                           0)
                (const_int 16777215))
      
      
      2016-12-12  Dominik Vogt  <vogt@linux.vnet.ibm.com>
      
      	* combine.c (change_zero_ext): Handle mode expanding zero_extracts.
      
      From-SVN: r243578
      Dominik Vogt committed
    • re PR c++/78647 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler… · fe366b87
      re PR c++/78647 (ICE on invalid C++ code on x86_64-linux-gnu (internal compiler error: tree check: expected tree_list, have error_mark in get_attribute_name, at attribs.c:664))
      
      	PR c++/78647
      	* c-common.c (attribute_fallthrough_p): Return false for
      	error_mark_node.
      
      	* g++.dg/parse/error58.C: New.
      
      From-SVN: r243575
      Marek Polacek committed
    • re PR preprocessor/78680 (ICE in get_substring_ranges_for_loc, at input.c:1398) · 470a60b2
      Fix for PR preprocessor/78680
      
      PR preprocessor/78680 identifies a crash when attempting to issue
      a -Wformat warning, where the format string includes a string token
      split across multiple physical source lines via backslash-continued
      lines.
      
      The issue is that libcpp is generating bogus range information for
      such tokens.
      
      For example, in:
      
      void fn1() {
        __builtin_printf("\
           %ld.\n\
              2\n"); };
      
      the range of the string token is printed as:
      
         __builtin_printf("\
                          ^~
      
      whereas the range ought to be:
      
        __builtin_printf("\
                         ^~
           %ld.\n\
           ~~~~~~~
              2\n"); };
              ~~~~
      
      The root cause is that the line notes expressing the update
      of the buffer in lex.c aren't yet updated when the end-point of
      the token is computed
      
      3095	    tok_range.m_finish
      3096	      = linemap_position_for_column (pfile->line_table,
      3097					     CPP_BUF_COLUMN (buffer, buffer->cur));
      
      so that the physical line is still regarded as that of the start
      of the token, and, where CPP_BUF_COLUMN uses (BUF)->line_base,
      line_base is still the location of the first physical line in the
      and hence the column information is too large (as if it were the
      offset in the *logical* line).
      
      (the printed range is somewhat misleading; the actual buggy range
      extends beyond the "\ in the line, but within diagnostic-show-locus.c
      layout::print_annotation_line only prints up to the xbound set by
      layout::print_source_line and so truncates most of the buggy range).
      
      The fix is to ensure that line notes are handled before calculating
      the end-point of the token range.
      
      This leads to the range for the string token being correctly
      computed, as:
      
        __builtin_printf("\
                         ^~
           %ld.\n\
           ~~~~~~~
              2\n"); };
              ~~~~
      
      and this leads to get_substring_ranges_for_loc failing gracefully,
      rather than crashing.
      
      gcc/testsuite/ChangeLog:
      	PR preprocessor/78680
      	* gcc.dg/format/pr78680.c: New test case.
      	* gcc.dg/plugin/diagnostic-test-expressions-1.c
      	(test_multiline_token): New function.
      	* gcc.dg/plugin/diagnostic-test-string-literals-1.c
      	(test_backslash_continued_logical_lines): New function.
      
      libcpp/ChangeLog:
      	PR preprocessor/78680
      	* lex.c (_cpp_lex_direct): Ensure line notes are processed before
      	computing the end-point of the token.
      
      From-SVN: r243567
      David Malcolm committed
    • re PR other/78252 (C++ demangler crashes with infinite recursion with lambda (auto)) · 8e09a726
      	libiberty/
      	PR c++/78252
      	* cp-demangle.c (struct d_print_info): Add is_lambda_arg field.
      	(d_print_init): Initialize it.
      	(d_print_comp_inner) <DEMANGLE_COMPONENT_TEMPLATE_PARAM>: Check
      	is_lambda_arg for auto.
      	<DEMANGLE_COMPONENT_REFERENCE,
      	DEMANGLE_COMPONENT_RVALUE_REFERENCE>: Skip smashing check when
      	is_lambda_arg.
      	<DEMANGLE_COMPONENT_LAMBDA>: Increment is_lambda_arg around arg
      	printing.
      	* testsuite/demangle-expected: Add lambda auto mangling cases.
      
      	gcc/testsuite/
      	PR c++/78252
      	* g++.dg/cpp1y/lambda-mangle-1.C: New.
      
      From-SVN: r243566
      Nathan Sidwell committed
    • re PR target/78738 (ICE in extract_insn, at recog.c:2311) · b8cab8a5
      	PR target/78738
      	* config/i386/i386.h (X87_ENABLE_ARITH): Also enable for
      	flag_unsafe_math_optimizations.
      	(X87_ENABLE_FLOAT): Ditto.
      
      testsuite/ChangeLog:
      
      	PR target/78738
      	* gcc.target/i386/pr78738.c: New test.
      
      From-SVN: r243559
      Uros Bizjak committed
    • [libstdc++][testsuite] XFAIL tests relying on long double-to-string conversions on broken newlib · 39c42937
          * lib/target-supports.exp
          (check_effective_target_newlib_broken_long_double_io): New check.
          (check_effective_target_frexpl): Likewise.
      
          * testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
          XFAIL run if newlib_broken_long_double_io.
          * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc:
          Likewise.
          * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc:
          Likewise.
          * testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
          Likewise.
      
      From-SVN: r243558
      Kyrylo Tkachov committed
    • Remove stray character at end of dg-do directive · 1c433842
      	* testsuite/experimental/filesystem/operations/is_empty.cc:
      	Remove stray character at end of dg-do directive.
      
      From-SVN: r243555
      Jonathan Wakely committed
    • re PR middle-end/78716 (ICE in gimplify_va_arg_expr, at gimplify.c:12650 (i686-linux-gnu)) · 3071bfa9
      	PR middle-end/78716
      	* gimplify.c (gimplify_va_arg_expr): Don't require ADDR_EXPR for
      	Case 1; check POINTER_TYPE_P instead.
      
      	* g++.dg/other/vararg-5.C: New.
      
      From-SVN: r243553
      Marek Polacek committed
    • Disable hwcaps on libgfortran · 66dbcf2d
      	libgfortran:
      	* configure.ac: Call GCC_CHECK_LINKER_HWCAP.
      	* Makefile.am (libgfortran_la_LDFLAGS): Add HWCAP_LDFLAGS.
      	* aclocal.m4: Regenerate.
      	* configure: Regenerate.
      	* Makefile.in: Regenerate.
      
      	config:
      	* hwcaps.m4: New file.
      
      	libitm:
      	* acinclude.m4 (LIBITM_CHECK_LINKER_FEATURES): Remove.
      	* aclocal.m4: Regenerate.
      	* configure.ac: Call GCC_CHECK_LINKER_HWCAP instead of
      	LIBITM_CHECK_LINKER_HWCAP.
      
      From-SVN: r243552
      Rainer Orth committed
    • re PR rtl-optimization/78669 (ICE: in combine_and_move_insns, at ira.c:3665 with… · fba12165
      re PR rtl-optimization/78669 (ICE: in combine_and_move_insns, at ira.c:3665 with -Os -fno-tree-ter -mavx512bw)
      
      
      	PR rtl-optimization/78669
      	* ira.c (combine_and_move_insns): When deleting an insn, clear the
      	replace flag for all used regs in that insn.
      
      	PR rtl-optimization/78669
      	* gcc.target/i386/pr78669.c: New test.
      
      From-SVN: r243551
      Bernd Schmidt committed
    • Remove stray character at end of dg-do directive · 8152d6ef
      	* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
      	Remove stray character at end of dg-do directive.
      
      From-SVN: r243548
      Jonathan Wakely committed
    • lib1funcs.S (__ashrdi3): Fix typo from r243545. · 8ae1c2c1
      libgcc/
      	* config/avr/lib1funcs.S (__ashrdi3): Fix typo from r243545.
      
      From-SVN: r243546
      George Spelvin committed
    • lib1funcs.S (__ashldi3): Use __tmp_reg__ to restore R16 instead of push + pop. · a5b947fa
      libgcc/
      	2016-12-12  George Spelvin  <linux@sciencehorizons.net>
      	* config/avr/lib1funcs.S (__ashldi3): Use __tmp_reg__ to restore
      	R16 instead of push + pop.
      	(__ashrdi3, __lshrdi3): Same. And use __zero_reg__ for signs.
      
      From-SVN: r243545
      George Spelvin committed
    • Fix g++.dg/debug/dwarf2/typedef1.C · 9e903493
      	* g++.dg/debug/dwarf2/typedef1.C: Adjust pattern for last change.
      
      From-SVN: r243544
      Rainer Orth committed
    • MIPS: Upgrade to R2 for -mnan=2008 and -mabs=2008. · 4a584d05
      gcc/testsuite/
      
      	* gcc.target/mips/mips.exp (mips-dg-options): Upgrade to R2 for
      	-mnan=2008 and -mabs=2008.
      
      From-SVN: r243542
      Toma Tabacu committed
    • Define arm_arch_core_flags in a single file · 6e4e50f5
      2016-12-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>
      
          gcc/
          * config/arm/arm-opts.h: Move struct arm_arch_core_flag and
          arm_arch_core_flags to ...
          * common/config/arm/arm-common.c: There.
      
      From-SVN: r243541
      Thomas Preud'homme committed
    • constraints.md (T): Use special memory constraint. · 5c2ee2f1
      	* config/sparc/constraints.md (T): Use special memory constraint.
      	(U): Minor tweak.
      	(W): Add TARGET_ARCH64 test.
      	* config/sparc/sparc.md (*movdi_insn_sp32): Replace 'W' with 'T'.
      	(*movdf_insn_sp32): Likewise.
      	(*mov<VM64:mode>_insn_sp32): Likewise.  Replace 'e' with 'f' in
      	conjunction with offsettable memory references.
      
      From-SVN: r243540
      Eric Botcazou committed
    • invoke.texi: Correct capitalization of OpenMP. · d688bd65
      	* doc/invoke.texi: Correct capitalization of OpenMP.
      
      From-SVN: r243539
      John David Anglin committed
    • nios2.c (nios2_emit_move_sequence): Call copy_rtx to avoid shared structure error. · 1cf4526c
      2016-12-11  Sandra Loosemore  <sandra@codesourcery.com>
      
      	gcc/
      	* config/nios2/nios2.c (nios2_emit_move_sequence): Call copy_rtx
      	to avoid shared structure error.
      
      From-SVN: r243538
      Sandra Loosemore committed
    • Daily bump. · 8a828956
      From-SVN: r243537
      GCC Administrator committed