Commit Graph

163252 Commits

Author SHA1 Message Date
Tom de Vries
9e28b10779 [libgomp, nvptx] Minimize lifetime of CUDA_ONE_CALL defines
This patch makes sure that the lifetimes of the CUDA_ONE_CALL macro (which is
defined twice in plugin-nvptx.c) are minimized, to make it obvious that the
definitions are used only in the lib-cuda.def include.

Build on x86_64 with nvptx accelerator and reg-tested libgomp.

2018-08-07  Tom de Vries  <tdevries@suse.de>

	* plugin/plugin-nvptx.c (struct cuda_lib_s, init_cuda_lib): Put
	CUDA_ONE_CALL defines right before the cuda-lib.def include, and the
	corresponding undefs right after.

From-SVN: r263345
2018-08-06 22:13:46 +00:00
John David Anglin
611c75f0ef re PR target/86807 (spu port needs updating for CVE-2017-5753)
PR target/86807
	* config/pa/pa.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
	Define to speculation_safe_value_not_needed.

From-SVN: r263344
2018-08-06 21:47:54 +00:00
Jeff Law
47ca20b4f6 tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Pass down the vr_values instance to cprop_into_stmt.
* tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Pass down
	the vr_values instance to cprop_into_stmt.
	(cprop_into_stmt): Pass vr_values instance down to cprop_operand.
	(cprop_operand): Also query EVRP to determine if OP is a constant.

From-SVN: r263342
2018-08-06 14:13:20 -06:00
Nathan Sidwell
9e525f085b [PATCH] Diagnostic included-from loop
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00416.html
	* diagnostic.c (diagnostic_report_current_module): Reroll
	included-at loop.  Translate text.

From-SVN: r263341
2018-08-06 16:52:38 +00:00
Marek Polacek
0250ba589b re PR c++/86767 (continue statements in constexpr functions causes unbounded looping)
PR c++/86767
	* constexpr.c (cxx_eval_statement_list): Handle continue.

	* g++.dg/cpp1y/constexpr-86767.C: New test.

From-SVN: r263340
2018-08-06 16:46:13 +00:00
David Malcolm
5242b3cb24 Fix memory leak in selftest::test_expansion_to_rtl
"make selftest-valgrind" shows:

187 bytes in 1 blocks are definitely lost in loss record 567 of 669
    at 0x4A081D4: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x1F08260: xcalloc (xmalloc.c:162)
    by 0xB24F32: init_emit() (emit-rtl.c:5843)
    by 0xC10080: prepare_function_start() (function.c:4803)
    by 0xC10254: init_function_start(tree_node*) (function.c:4877)
    by 0x1CDF92A: selftest::test_expansion_to_rtl() (function-tests.c:595)
    by 0x1CE007C: selftest::function_tests_c_tests() (function-tests.c:676)
    by 0x1E010E7: selftest::run_tests() (selftest-run-tests.c:98)
    by 0x1062D1E: toplev::run_self_tests() (toplev.c:2225)
    by 0x1062F40: toplev::main(int, char**) (toplev.c:2303)
    by 0x1E5B90A: main (main.c:39)

The allocation in question is:

  crtl->emit.regno_pointer_align
    = XCNEWVEC (unsigned char, crtl->emit.regno_pointer_align_length);

This patch fixes this leak (and makes the output of
"make selftest-valgrind" clean) by calling free_after_compilation at the
end of the selftest in question.

gcc/ChangeLog:
	* function-tests.c (selftest::test_expansion_to_rtl): Call
	free_after_compilation.

From-SVN: r263339
2018-08-06 16:25:27 +00:00
Uros Bizjak
27ee6398a6 pr86763.C (dg-additional-options): Add -lrt for target *-*-linux-gnu.
* g++.dg/torture/pr86763.C (dg-additional-options): Add -lrt
	for target *-*-linux-gnu.

From-SVN: r263338
2018-08-06 17:49:05 +02:00
Alan Hayward
234c900079 Enable clobber high for tls descs on Aarch64
gcc/
	* config/aarch64/aarch64.md: Add clobber highs to tls_desc.

gcc/testsuite/
	* gcc.target/aarch64/sve/tls_preserve_1.c: New test.
	* gcc.target/aarch64/sve/tls_preserve_2.c: New test.
	* gcc.target/aarch64/sve/tls_preserve_3.c: New test.

From-SVN: r263337
2018-08-06 15:33:00 +00:00
Andreas Krebbel
8eed4721de S/390: Don't unroll memory blk op loops
gcc/ChangeLog:

2018-08-06  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390.c (s390_loop_unroll_adjust): Prevent small
	loops with memory block operations from getting unrolled.

gcc/testsuite/ChangeLog:

2018-08-06  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/nomemloopunroll-1.c: New test.

From-SVN: r263336
2018-08-06 15:01:00 +00:00
Ulrich Weigand
2f171da9cc [spu, commit] Define TARGET_HAVE_SPECULATION_SAFE_VALUE
The SPU processor is not affected by speculation, so this macro can
safely be defined as speculation_safe_value_not_needed.

gcc/ChangeLog:

	PR target/86807
	* config/spu/spu.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
	Define to speculation_safe_value_not_needed.

From-SVN: r263335
2018-08-06 14:40:56 +00:00
Jeff Law
5dc096267c reload1.c (forget_old_reloads_1): Adjust CLOBBER_HIGH assert.
* reload1.c (forget_old_reloads_1): Adjust CLOBBER_HIGH
	assert.

From-SVN: r263333
2018-08-06 07:49:10 -06:00
Jozef Lawrynowicz
edbbb166f7 re PR target/86662 (msp430-elf segfault with -flto and -mlarge)
PR target/86662

        * gcc/tree.c (build_common_tree_nodes): Initialize integer_types array
        with all enabled __intN types.

        * gcc/testsuite/gcc.target/msp430/pr86662.c: New test.

From-SVN: r263332
2018-08-06 10:29:17 +00:00
Alan Hayward
8df47bdf99 Remaining support for clobber high
gcc/
	* alias.c (record_set): Check for clobber high.
	* cfgexpand.c (expand_gimple_stmt): Likewise.
	* combine-stack-adj.c (single_set_for_csa): Likewise.
	* combine.c (find_single_use_1): Likewise.
	(set_nonzero_bits_and_sign_copies): Likewise.
	(get_combine_src_dest): Likewise.
	(is_parallel_of_n_reg_sets): Likewise.
	(try_combine): Likewise.
	(record_dead_and_set_regs_1): Likewise.
	(reg_dead_at_p_1): Likewise.
	(reg_dead_at_p): Likewise.
	* dce.c (deletable_insn_p): Likewise.
	(mark_nonreg_stores_1): Likewise.
	(mark_nonreg_stores_2): Likewise.
	* df-scan.c (df_find_hard_reg_defs): Likewise.
	(df_uses_record): Likewise.
	(df_get_call_refs): Likewise.
	* dwarf2out.c (mem_loc_descriptor): Likewise.
	* haifa-sched.c (haifa_classify_rtx): Likewise.
	* ira-build.c (create_insn_allocnos): Likewise.
	* ira-costs.c (scan_one_insn): Likewise.
	* ira.c (equiv_init_movable_p): Likewise.
	(rtx_moveable_p): Likewise.
	(interesting_dest_for_shprep): Likewise.
	* jump.c (mark_jump_label_1): Likewise.
	* postreload-gcse.c (record_opr_changes): Likewise.
	* postreload.c (reload_cse_simplify): Likewise.
	(struct reg_use): Add source expr.
	(reload_combine): Check for clobber high.
	(reload_combine_note_use): Likewise.
	(reload_cse_move2add): Likewise.
	(move2add_note_store): Likewise.
	* print-rtl.c (print_pattern): Likewise.
	* recog.c (decode_asm_operands): Likewise.
	(store_data_bypass_p): Likewise.
	(if_test_bypass_p): Likewise.
	* regcprop.c (kill_clobbered_value): Likewise.
	(kill_set_value): Likewise.
	* reginfo.c (reg_scan_mark_refs): Likewise.
	* reload1.c (maybe_fix_stack_asms): Likewise.
	(eliminate_regs_1): Likewise.
	(elimination_effects): Likewise.
	(mark_not_eliminable): Likewise.
	(scan_paradoxical_subregs): Likewise.
	(forget_old_reloads_1): Likewise.
	* reorg.c (find_end_label): Likewise.
	(try_merge_delay_insns): Likewise.
	(redundant_insn): Likewise.
	(own_thread_p): Likewise.
	(fill_simple_delay_slots): Likewise.
	(fill_slots_from_thread): Likewise.
	(dbr_schedule): Likewise.
	* resource.c (update_live_status): Likewise.
	(mark_referenced_resources): Likewise.
	(mark_set_resources): Likewise.
	* rtl.c (copy_rtx): Likewise.
	* rtlanal.c (reg_referenced_p): Likewise.
	(single_set_2): Likewise.
	(noop_move_p): Likewise.
	(note_stores): Likewise.
	* sched-deps.c (sched_analyze_reg): Likewise.
	(sched_analyze_insn): Likewise.

From-SVN: r263331
2018-08-06 09:57:03 +00:00
Alan Hayward
99788e0630 cse support for clobber_high
gcc/
	* cse.c (invalidate_reg): New function extracted from...
	(invalidate): ...here.
	(canonicalize_insn): Check for clobber high.
	(invalidate_from_clobbers): invalidate clobber highs.
	(invalidate_from_sets_and_clobbers): Likewise.
	(count_reg_usage): Check for clobber high.
	(insn_live_p): Likewise.
	* cselib.c (cselib_expand_value_rtx_1):Likewise.
	(cselib_invalidate_regno): Check for clobber in setter.
	(cselib_invalidate_rtx): Pass through setter.
	(cselib_invalidate_rtx_note_stores):
	(cselib_process_insn): Check for clobber high.
	* cselib.h (cselib_invalidate_rtx): Add operand.

From-SVN: r263330
2018-08-06 09:54:28 +00:00
Alan Hayward
30dc1902a7 lra support for clobber_high
gcc/
	* lra-eliminations.c (lra_eliminate_regs_1): Check for clobber high.
	(mark_not_eliminable): Likewise.
	* lra-int.h (struct lra_insn_reg): Add clobber high marker.
	* lra-lives.c (process_bb_lives): Check for clobber high.
	* lra.c (new_insn_reg): Remember clobber highs.
	(collect_non_operand_hard_regs): Check for clobber high.
	(lra_set_insn_recog_data): Likewise.
	(add_regs_to_insn_regno_info): Likewise.
	(lra_update_insn_regno_info): Likewise.

From-SVN: r263329
2018-08-06 09:51:01 +00:00
Alan Hayward
6a7fa0c213 Add func to check if register is clobbered by clobber_high
gcc/
	* rtl.h (reg_is_clobbered_by_clobber_high): Add declarations.
	* rtlanal.c (reg_is_clobbered_by_clobber_high): Add function.

From-SVN: r263328
2018-08-06 09:38:29 +00:00
Alan Hayward
14196e023f Generation support for CLOBBER_HIGH
Ensure clobber high is a register expression.
Info is passed through for the error case.

gcc/
	* emit-rtl.c (verify_rtx_sharing): Check for CLOBBER_HIGH.
	(copy_insn_1): Likewise.
	(gen_hard_reg_clobber_high): New gen function.
	* genconfig.c (walk_insn_part): Check for CLOBBER_HIGH.
	* genemit.c (gen_exp): Likewise.
	(gen_emit_seq): Pass through info.
	(gen_insn): Check for CLOBBER_HIGH.
	(gen_expand): Pass through info.
	(gen_split): Likewise.
	(output_add_clobbers): Likewise.
	* genrecog.c (validate_pattern): Check for CLOBBER_HIGH.
	(remove_clobbers): Likewise.
	* rtl.h (gen_hard_reg_clobber_high): New declaration.

From-SVN: r263327
2018-08-06 09:16:24 +00:00
Alan Hayward
601e86a57f Add CLOBBER_HIGH expression
Includes documentation.

2018-08-06  Alan Hayward  <alan.hayward@arm.com>

	* doc/rtl.texi (clobber_high): Add.
	(parallel): Add in clobber high
	* rtl.c (rtl_check_failed_code3): Add function.
	* rtl.def (CLOBBER_HIGH): Add expression.
	* rtl.h (RTL_CHECKC3): Add macro.
	(rtl_check_failed_code3): Add declaration.
	(XC3EXP): Add macro.

From-SVN: r263326
2018-08-06 09:07:57 +00:00
Naveen H.S
6e9f49e456 MAINTAINERS: Update my email address.
* MAINTAINERS: Update my email address.

From-SVN: r263325
2018-08-06 07:22:57 +00:00
GCC Administrator
7aa6ee2cce Daily bump.
From-SVN: r263324
2018-08-06 00:16:32 +00:00
Iain Buclaw
2206fb8940 libbacktrace: Suppress the default action-if-found for AC_CHECK_LIBS.
Zlib is not a dependency of libbacktrace, and so it shouldn't be added
to LIBS.

libbacktrace/

	* configure.ac: Move define of HAVE_ZLIB into check for -lz.
	* Makefile.in: Regenerate.
	* config.h.in: Likewise.
	* configure: Likewise.

From-SVN: r263320
2018-08-05 20:24:59 +00:00
François Dumont
dd5faf200e stl_iterator.h: Fix comment.
2018-08-05  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_iterator.h: Fix comment.

From-SVN: r263318
2018-08-05 15:33:58 +00:00
H.J. Lu
91539305a8 i386: Set cfun->machine->max_used_stack_alignment if needed
cfun->machine->max_used_stack_alignment is used to decide how stack frame
should be aligned.  This is independent of any psABIs nor 32-bit vs 64-bit.
It is always safe to compute max_used_stack_alignment.  We compute it only
if 128-bit aligned load/store may be generated on misaligned stack slot
which will lead to segfault.

gcc/

	PR target/86386
	* config/i386/i386.c (ix86_finalize_stack_frame_flags): Set
	cfun->machine->max_used_stack_alignment if needed.

gcc/testsuite/

	PR target/86386
	* gcc.target/i386/pr86386.c: New file.

From-SVN: r263317
2018-08-05 05:46:13 -07:00
GCC Administrator
7ff1e4e9c0 Daily bump.
From-SVN: r263316
2018-08-05 00:16:33 +00:00
Martin Sebor
bd1f3566b1 PR tree-optimization/86571 - AIX NaNQ and NaNS output format conflicts with __builtin_sprintf
gcc/ChangeLog:

	PR tree-optimization/86571
	* gimple-ssa-sprintf.c (format_floating): Extend upper bound of
	NaN output to 4.

From-SVN: r263312
2018-08-04 16:14:41 -06:00
Tom de Vries
3d3e5ba262 [testsuite, guality] Use absolute line number in pass/fail line
2018-08-04  Tom de Vries  <tdevries@suse.de>

	* lib/gcc-gdb-test.exp: Use absolute line number in pass/fail line.

From-SVN: r263311
2018-08-04 21:42:53 +00:00
Tom de Vries
099400909e [libgomp, nvptx, --without-cuda-driver] Don't use system cuda driver
Using libgomp configure option --with-cuda-driver=<dir> we can indicate what
cuda driver to use to build the libgomp nvptx plugin.  Without such an option,
the system cuda driver is used, if available.  If not availabe, a dlopen
interface is used instead.

However, when we use --without-cuda-driver (or the equivalent
--with-cuda-driver=no) the system cuda driver is still used if available.

This patch fixes that, making sure that --without-cuda-driver selects the dlopen
interface.

Build on x86_64 with nvptx accelerator and tested libgomp testsuite, with and
without option --without-cuda-driver.

2018-08-04  Tom de Vries  <tdevries@suse.de>

	* plugin/configfrag.ac: For --without-cuda-driver, set
	CUDA_DRIVER_INCLUDE and CUDA_DRIVER_LIB to no.  Handle
	CUDA_DRIVER_INCLUDE == no and CUDA_DRIVER_LIB == no.
	* configure: Regenerate.

From-SVN: r263310
2018-08-04 20:07:22 +00:00
Andreas Schwab
11fc901348 const-volatile.c: Remove duplicate test "type:cvip".
* gcc.dg/guality/const-volatile.c: Remove duplicate test
"type:cvip".

From-SVN: r263309
2018-08-04 16:50:02 +00:00
Janus Weil
d50cd259be re PR fortran/45521 ([F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE)
2018-08-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/45521
	* interface.c (gfc_compare_interfaces): Apply additional
	distinguishability criteria of F08 to operator interfaces.


2018-08-04  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/45521
	* gfortran.dg/interface_assignment_6.f90: New test case.

From-SVN: r263308
2018-08-04 17:37:23 +02:00
Uros Bizjak
5b1dd92aac re PR testsuite/86153 (test case g++.dg/pr83239.C fails starting with r261585)
PR testsuite/86153
	* g++.dg/pr83239.C (dg-options): Add -finline-limit=500.

From-SVN: r263306
2018-08-04 12:01:54 +02:00
GCC Administrator
430af0a96b Daily bump.
From-SVN: r263305
2018-08-04 00:16:28 +00:00
Sandra Loosemore
e23f36192d nios2.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define.
2018-08-03  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/
	* config/nios2/nios2.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
	Define.

From-SVN: r263301
2018-08-03 18:40:08 -04:00
Jeff Law
5ae10dbaec Remove nfs bogon
From-SVN: r263300
2018-08-03 14:53:48 -06:00
Sergei Trofimovich
f6a9dfd369 sjlj.S: Adjust to use PIC vs normal code to avoid absolute relocation in a shared library.
* config/sh/sjlj.S: Adjust to use PIC vs normal code to avoid
	absolute relocation in a shared library.

From-SVN: r263299
2018-08-03 14:53:08 -06:00
David Malcolm
bc31a87ac7 Add fix-it hint for missing return statement in assignment operators (PR c++/85523)
gcc/cp/ChangeLog:

	PR c++/85523
	* decl.c: Include "gcc-rich-location.h".
	(add_return_star_this_fixit): New function.
	(finish_function): When warning about missing return statements in
	functions returning non-void, add a "return *this;" fix-it hint for
	assignment operators.

gcc/testsuite/ChangeLog:

	PR c++/85523
	* g++.dg/pr85523.C: New test.


Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>

From-SVN: r263298
2018-08-03 18:38:13 +00:00
Jeff Law
2e2bd24b7c re PR target/86795 (mn10300 port needs updating for CVE-2017-5753)
PR target/86795
	* config/mn10300/mn10300.c (TARGET_HAVE_SPECULATION_SAFE_VALUE):
	Define to speculation_safe_value_not_needed.

From-SVN: r263296
2018-08-03 11:39:00 -06:00
David Malcolm
c64f2af342 docs: fix stray duplicated words
gcc/ChangeLog:
	* doc/gcov.texi (-x): Remove duplicate "to".
	* doc/invoke.texi (-Wnoexcept-type): Remove duplicate "calls".
	(-Wif-not-aligned): Remove duplicate "is".
	(-flto): Remove duplicate "the".
	(MicroBlaze Options): In examples of "-mcpu=cpu-type", remove
	duplicate "v5.00.b".
	(MSP430 Options): Remove duplicate "and" from the description
	of "-mgprel-sec=regexp".
	(x86 Options): Remove duplicate copies of "vmldLog102" and
	vmlsLog104 from description of "-mveclibabi=type".

From-SVN: r263295
2018-08-03 15:49:12 +00:00
Bogdan Harjoc
e5e7e50d4f Avoid infinite loop with duplicate anonymous union fields (PR c/86690).
If a struct contains an anonymous union and both have a field with the
same name, detect_field_duplicates_hash() will replace one of them
with NULL.  If compilation doesn't stop immediately, it may later call
lookup_field() on the union, which falsely assumes the union's
LANG_SPECIFIC array is sorted, and may loop indefinitely because of
this.

2018-08-03  Bogdan Harjoc  <harjoc@gmail.com>

	PR c/86690
gcc/c:
	* c-typeck.c (lookup_field): Do not use TYPE_LANG_SPECIFIC after
	errors.

gcc/testsuite:
	* gcc.dg/union-duplicate-field.c: New test.

From-SVN: r263294
2018-08-03 16:25:35 +01:00
Jason Merrill
d198fc5a69 re PR c++/86706 (ICE in build_base_path, at cp/class.c:294)
PR c++/86706
	* class.c (build_base_path): Use currently_open_class.

	* g++.dg/template/pr86706.C: New test.

From-SVN: r263293
2018-08-03 17:10:32 +02:00
Uros Bizjak
0b0c7dc602 ChangeLog: Move entry ...
* ChangeLog: Move entry ...
	* cp/ChangeLog: ... here.

From-SVN: r263292
2018-08-03 15:55:31 +02:00
Pierre-Marie de Rodat
1ae45251d9 [Ada] Partially revert "Makefile patches from initial RISC-V cross/native build."
This partially reverts r262482, at it broke canadian builds.

2018-08-03  Pierre-Marie de Rodat  <derodat@adacore.com>

gcc/ada/

	Reverts
	2018-07-06  Jim Wilson  <jimw@sifive.com>

	* Make-generated.in (treeprs.ads): Use $(GNATMAKE) instead of gnatmake.
	(einfo.h, sinfo.h, stamp-snames, stamp-nmake): Likewise.
	* gcc-interface/Makefile.in (xoscons): Likewise.

From-SVN: r263291
2018-08-03 13:22:38 +00:00
Richard Sandiford
0246112a9d Handle SLP of call pattern statements
We couldn't vectorise:

  for (int j = 0; j < n; ++j)
    {
      for (int i = 0; i < 16; ++i)
	a[i] = (b[i] + c[i]) >> 1;
      a += step;
      b += step;
      c += step;
    }

at -O3 because cunrolli unrolled the inner loop and SLP couldn't handle
AVG_FLOOR patterns (see also PR86504).  The problem was some overly
strict checking of pattern statements compared to normal statements
in vect_get_and_check_slp_defs:

          switch (gimple_code (def_stmt))
            {
            case GIMPLE_PHI:
            case GIMPLE_ASSIGN:
	      break;

	    default:
	      if (dump_enabled_p ())
		dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
				 "unsupported defining stmt:\n");
	      return -1;
            }

The easy fix would have been to add GIMPLE_CALL to the switch,
but I don't think the switch is doing anything useful.  We only create
pattern statements that the rest of the vectoriser can handle, and the
other checks in this function and elsewhere check whether SLP is possible.

I'm also not sure why:

          if (!first && !oprnd_info->first_pattern
	      /* Allow different pattern state for the defs of the
		 first stmt in reduction chains.  */
	      && (oprnd_info->first_dt != vect_reduction_def

is necessary.  All that should matter is that the statements in the
node are "similar enough".  It turned out to be quite hard to find a
convincing example that used a mixture of pattern and non-pattern
statements, so bb-slp-pow-1.c is the best I could come up with.
But it does show that the combination of "xi * xi" statements and
"pow (xj, 2) -> xj * xj" patterns are handled correctly.

The patch therefore just removes the whole if block.

The loop also needed commutative swapping to be extended to at least
AVG_FLOOR.

This gives +3.9% on 525.x264_r at -O3.

2018-08-03  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* internal-fn.h (first_commutative_argument): Declare.
	* internal-fn.c (first_commutative_argument): New function.
	* tree-vect-slp.c (vect_get_and_check_slp_defs): Remove extra
	restrictions for pattern statements.  Use first_commutative_argument
	to look for commutative operands in calls to internal functions.

gcc/testsuite/
	* gcc.dg/vect/bb-slp-over-widen-1.c: Expect AVG_FLOOR to be used
	on vect_avg_qi targets.
	* gcc.dg/vect/bb-slp-over-widen-2.c: Likewise.
	* gcc.dg/vect/bb-slp-pow-1.c: New test.
	* gcc.dg/vect/vect-avg-15.c: Likewise.

From-SVN: r263290
2018-08-03 12:56:55 +00:00
Jonathan Wakely
d7487e2ae8 Add workaround for non-unique errno values on AIX
* src/c++11/system_error.cc
	(system_error_category::default_error_condition): Add workaround for
	ENOTEMPTY and EEXIST having the same value on AIX.
	* testsuite/19_diagnostics/error_category/system_category.cc: Add
	extra testcases for EDOM, EILSEQ, ERANGE, EEXIST and ENOTEMPTY.

From-SVN: r263289
2018-08-03 13:53:34 +01:00
Aldy Hernandez
c9f8fca6d6 Makefile.in (wide-int-range.o): New.
* Makefile.in (wide-int-range.o): New.
	* tree-vrp.c: Move all the wide_int_* functions to...
	* wide-int-range.cc: ...here.
	* tree-vrp.h: Move all the wide_int_* prototypes to...
	* wide-int-range.h: ...here.

From-SVN: r263288
2018-08-03 11:31:22 +00:00
Tom de Vries
d989dba8ef [c++] Don't emit exception tables for UI_NONE
If a target does not support exceptions, it can indicate this by returning
UI_NONE in TARGET_EXCEPT_UNWIND_INFO.  Currently the compiler still emits
exception tables for such a target.

This patch makes sure that no exception tables are emitted if the target does
not support exceptions.  This allows us to remove a workaround in
TARGET_ASM_BYTE_OP in the nvptx port.

Build on x86_64 with nvptx accelerator, and tested libgomp.

Build and reg-tested on x86_64.

2018-08-03  Tom de Vries  <tdevries@suse.de>

	* common/config/nvptx/nvptx-common.c (nvptx_except_unwind_info): Return
	UI_NONE.
	* config/nvptx/nvptx.c (TARGET_ASM_BYTE_OP): Remove define.
	* except.c (output_function_exception_table): Do early exit if
	targetm_common.except_unwind_info (&global_options) == UI_NONE.

From-SVN: r263287
2018-08-03 11:21:09 +00:00
Martin Liska
a77e3a39de Print heuristics probability fraction part with 2 digits.
2018-08-03  Martin Liska  <mliska@suse.cz>

	* predict.c (dump_prediction): Change to 2 digits
        in fraction part.
2018-08-03  Martin Liska  <mliska@suse.cz>

	* gcc.dg/predict-1.c: Adjust scanned pattern to cover 2 digits.
	* gcc.dg/predict-13.c:Likewise.
	* gcc.dg/predict-3.c:Likewise.
	* gcc.dg/predict-4.c:Likewise.
	* gcc.dg/predict-5.c:Likewise.
	* gcc.dg/predict-6.c:Likewise.
	* gcc.dg/predict-9.c:Likewise.
	* gfortran.dg/predict-1.f90:Likewise.

From-SVN: r263286
2018-08-03 07:23:47 +00:00
Siddhesh Poyarekar
561d011953 [aarch64] Fix falkor pipeline description for dup<q>
There was a typo in the pipeline description where DUP was assigned to
the vector pipes for quad mode ops when it really only uses the VTOG
pipes.  Fixing this does not show any noticeable difference in
performance (there's a very small bump of 1.7% in x264 but that's
about it) in my tests but is the more precise description of operations
for falkor.

	* config/aarch64/falkor.md (falkor_am_1_vxvy_vxvy): Move
	neon_dup_q to...
	(falkor_am_1_gtov_gtov): ... a new insn reservation.

From-SVN: r263285
2018-08-03 01:51:42 +00:00
GCC Administrator
90d981fb12 Daily bump.
From-SVN: r263284
2018-08-03 00:16:17 +00:00
Ilya Leoshkevich
65e8746285 nds32.c (nds32_hard_regno_mode_ok): Replace > with >=.
* config/nds32/nds32.c (nds32_hard_regno_mode_ok): Replace > with >=.
	* df-problems.c (df_remove_dead_eq_notes): Replace > with >=.
	* dwarf2out.c (mem_loc_descriptor): Replace > with >=.
	* lra-constraints.c (spill_hard_reg_in_range): Replace <= with <.
	* lra-remat.c (call_used_input_regno_present_p): Replace <= with <.

From-SVN: r263280
2018-08-02 16:39:59 -06:00
David Malcolm
653fee1961 Fix memory leak of pretty_printer prefixes
We were rather sloppy about handling the ownership of prefixes for
pretty_printer, and this lead to a memory leak for any time a
diagnostic_show_locus call emits multiple line spans.

This showed up in "make selftest-valgrind" as:

3,976 bytes in 28 blocks are definitely lost in loss record 632 of 669
   at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x1F08227: xmalloc (xmalloc.c:147)
   by 0x1F083E6: xvasprintf (xvasprintf.c:58)
   by 0x1E7EC7D: build_message_string(char const*, ...) (diagnostic.c:78)
   by 0x1E7F438: diagnostic_get_location_text(diagnostic_context*, expanded_location) (diagnostic.c:328)
   by 0x1E7FD54: default_diagnostic_start_span_fn(diagnostic_context*, expanded_location) (diagnostic.c:626)
   by 0x1EB3508: selftest::test_diagnostic_context::start_span_cb(diagnostic_context*, expanded_location) (selftest-diagnostic.c:57)
   by 0x1E89215: diagnostic_show_locus(diagnostic_context*, rich_location*, diagnostic_t) (diagnostic-show-locus.c:1992)
   by 0x1E8ECAD: selftest::test_fixit_insert_containing_newline_2(selftest::line_table_case const&) (diagnostic-show-locus.c:3044)
   by 0x1EB0606: selftest::for_each_line_table_case(void (*)(selftest::line_table_case const&)) (input.c:3525)
   by 0x1E8F3F5: selftest::diagnostic_show_locus_c_tests() (diagnostic-show-locus.c:3164)
   by 0x1E010BF: selftest::run_tests() (selftest-run-tests.c:88)

4,004 bytes in 28 blocks are definitely lost in loss record 633 of 669
   at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x1F08227: xmalloc (xmalloc.c:147)
   by 0x1F083E6: xvasprintf (xvasprintf.c:58)
   by 0x1E7EC7D: build_message_string(char const*, ...) (diagnostic.c:78)
   by 0x1E7F438: diagnostic_get_location_text(diagnostic_context*, expanded_location) (diagnostic.c:328)
   by 0x1E7FD54: default_diagnostic_start_span_fn(diagnostic_context*, expanded_location) (diagnostic.c:626)
   by 0x1EB3508: selftest::test_diagnostic_context::start_span_cb(diagnostic_context*, expanded_location) (selftest-diagnostic.c:57)
   by 0x1E89215: diagnostic_show_locus(diagnostic_context*, rich_location*, diagnostic_t) (diagnostic-show-locus.c:1992)
   by 0x1E8B373: selftest::test_diagnostic_show_locus_fixit_lines(selftest::line_table_case const&) (diagnostic-show-locus.c:2500)
   by 0x1EB0606: selftest::for_each_line_table_case(void (*)(selftest::line_table_case const&)) (input.c:3525)
   by 0x1E8F3B9: selftest::diagnostic_show_locus_c_tests() (diagnostic-show-locus.c:3159)
   by 0x1E010BF: selftest::run_tests() (selftest-run-tests.c:88)

This patch fixes the leaks by ensuring that the pretty_printer "owns"
the prefix if it's non-NULL, freeing it in the dtor and in pp_set_prefix.

gcc/cp/ChangeLog:
	* error.c (cxx_print_error_function): Duplicate "file" before
	passing it to pp_set_prefix.
	(cp_print_error_function): Use pp_take_prefix when saving the
	existing prefix.

gcc/ChangeLog:
	* diagnostic-show-locus.c (diagnostic_show_locus): Use
	pp_take_prefix when saving the existing prefix.
	* diagnostic.c (diagnostic_append_note): Likewise.
	* langhooks.c (lhd_print_error_function): Likewise.
	* pretty-print.c (pp_set_prefix): Drop the "const" from "prefix"
	param's type.  Free the existing prefix.
	(pp_take_prefix): New function.
	(pretty_printer::pretty_printer): Drop the prefix parameter.
	Rename the length parameter to match the comment.
	(pretty_printer::~pretty_printer): Free the prefix.
	* pretty-print.h (pretty_printer::pretty_printer): Drop the prefix
	parameter.
	(struct pretty_printer): Drop the "const" from "prefix" field's
	type and clarify memory management.
	(pp_set_prefix): Drop the "const" from the 2nd param.
	(pp_take_prefix): New decl.

From-SVN: r263275
2018-08-02 20:07:28 +00:00