Commit Graph

139492 Commits

Author SHA1 Message Date
Thomas Koenig
c219aeb7de arith.c (gfc_arith_divide): With -Winteger-division...
2015-07-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* arith.c (gfc_arith_divide):  With -Winteger-division,
	warn about contant integer division if there is a non-zero
	remainder.
	* invoke.texi:  Document -Winteger-division.
	* lang.opt:  Add -Winteger-division.

2015-07-01  Thomas Koenig  <tkoenig@gcc.gnu.org>

	* gfortran.dg/warn_conversion_8.f90:  New test.

From-SVN: r225262
2015-07-01 16:43:53 +00:00
Bernd Edlinger
1e67793833 re PR rtl-optimization/61047 (wrong code at -O1 on x86_64-linux)
gcc/ChangeLog:
2015-07-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR rtl-optimization/61047
        * rtlanal.c (get_initial_register_offset): New function.
        (rtx_addr_can_trap_p_1): Check offsets of stack references.

testsuite/ChangeLog:
2015-07-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR rtl-optimization/61047
        * gcc.c-torture/execute/20150611-1.c: New testcase.

From-SVN: r225260
2015-07-01 16:10:30 +00:00
Richard Biener
2ee05f1e9b fold-const.c (fold_comparison): Move X - Y CMP 0 -> X CMP Y...
2015-07-01  Richard Biener  <rguenther@suse.de>

	* fold-const.c (fold_comparison): Move X - Y CMP 0 -> X CMP Y,
	X * C1 CMP 0 -> X CMP 0, X CMP X, ~X CMP ~Y -> Y CMP X and
	~X CMP C -> X CMP' ~C to ...
	* match.pd: ... patterns here.

From-SVN: r225249
2015-07-01 13:18:49 +00:00
David Malcolm
e09abfa408 PR jit/66700: set TREE_ADDRESSABLE when building an ADDR_EXPR
gcc/jit/ChangeLog:
	PR jit/66700
	* jit-playback.c (jit_mark_addressable): New function.
	(gcc::jit::playback::lvalue::get_address): Call
	jit_mark_addressable on the underlying tree.

gcc/testsuite/ChangeLog:
	PR jit/66700
	* jit.dg/all-non-failing-tests.h: Add
	test-pr66700-observing-write-through-ptr.c.
	* jit.dg/test-pr66700-observing-write-through-ptr.c: New testcase.

From-SVN: r225248
2015-07-01 12:50:50 +00:00
David Malcolm
e807aeaae3 jit: document union types
gcc/jit/ChangeLog:
	* docs/topics/types.rst (gcc_jit_context_new_union_type): Add
	documentation.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.

gcc/testsuite/ChangeLog:
	* jit.dg/test-accessing-union.c: Add comments for use by
	gcc/jit/docs/topics/types.rst.

From-SVN: r225246
2015-07-01 12:41:18 +00:00
David Malcolm
c575221ada jit: clarify (lack of) lifetime requirements on input const char *
gcc/jit/ChangeLog:
	* docs/topics/contexts.rst (gcc_jit_context_set_bool_option):
	Clarify lack of lifetime requirements on (const char *) parameter.
	* docs/topics/expressions.rst
	(gcc_jit_context_new_string_literal): Likewise.
	(gcc_jit_context_new_global): Likewise.
	* docs/topics/functions.rst (gcc_jit_context_new_param): Likewise.
	(gcc_jit_context_new_function): Likewise.
	(gcc_jit_function_new_block): Likewise.
	(gcc_jit_block_add_comment): Likewise.
	* docs/topics/locations.rst (gcc_jit_context_new_location):
	Likewise.
	* docs/topics/types.rst (gcc_jit_context_new_field): Likewise.
	(gcc_jit_context_new_struct_type): Likewise.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.

From-SVN: r225245
2015-07-01 12:34:24 +00:00
Jonathan Wakely
7946683835 alloc_traits.h (__alloctr_rebind): Remove.
* include/bits/alloc_traits.h (__alloctr_rebind): Remove.
	(__allocator_traits_base): New base class.
	(__alloc_rebind): Reimplement in terms of detection idiom.
	(allocator_traits): Derive from __allocator_traits_base. Reimplement
	nested types in terms of detection idiom. Simplify SFINAE constraints
	on overloaded static member functions.
	* include/bits/hashtable.h (_Hashtable): Use __alloc_rebind instead
	of __alloctr_rebind.
	* testsuite/20_util/scoped_allocator/propagation.cc: Define rebind.
	* testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust
	dg-error line number.

From-SVN: r225244
2015-07-01 13:24:09 +01:00
Jonathan Wakely
4f44c5556f ptr_traits.h (__ptrtr_elt_type, [...]): Remove
* include/bits/ptr_traits.h (__ptrtr_elt_type, __ptrtr_diff_type,
	__ptrtr_rebind, __ptrtr_not_void): Remove
	(__get_first_arg, __replace_first_arg, __make_not_void): Define new
	transformations.
	(__detected_or_): New detection trait.
	(pointer_traits): Use new traits.
	* testsuite/20_util/pointer_traits/pointer_to.cc: Add rebind member.
	* testsuite/20_util/pointer_traits/requirements/
	explicit_instantiation.cc: Use valid arguments to pointer_traits.

From-SVN: r225243
2015-07-01 13:24:03 +01:00
Jonathan Wakely
6af6bef4ac Implement N4502, the C++ Detection Idiom.
* doc/xml/manual/status_cxx2017.xml: Update status table.
	* include/experimental/type_traits (void_t, is_detected,
	is_detected_v, detected_t, detected_or, detected_or_t,
	is_detected_exact, is_detected_exact_v, is_detected_convertible,
	is_detected_convertible_v): Define.
	* include/std/type_traits (__detector, __detected_or, __detected_or_t,
	__detected_or_t_): Define.
	* testsuite/experimental/type_traits/detection.cc: New.

From-SVN: r225242
2015-07-01 13:23:54 +01:00
Matthew Wahab
9735e6ea8e armv8-sync-comp-swap.c: Replace 'do-require-effective-target' with 'dg-require-effective-target'.
2015-07-01  Matthew Wahab  <matthew.wahab@arm.com>

	* gcc.target/arm/armv8-sync-comp-swap.c: Replace
	'do-require-effective-target' with 'dg-require-effective-target'.
	* gcc.target/arm/armv8-sync-op-full.c: Likewise.
	* gcc.target/arm/armv8-sync-op-release.c: Likewise.
	* gcc.target/arm/armv8-sync-op-acquire.c: Likewise.  Also, replace
        'stlex' with 'strex' as the expected output.

From-SVN: r225241
2015-07-01 12:16:01 +00:00
Nick Clifton
85bd3c0150 msp430.md (zero_extendhipsi2): Use MOVX.A to store a 16-bit value into a 20-bit memory slot.
* config/msp430/msp430.md (zero_extendhipsi2): Use MOVX.A to store
	a 16-bit value into a 20-bit memory slot.

From-SVN: r225240
2015-07-01 11:35:48 +00:00
Paolo Carlini
a31dc4e516 re PR c++/60365 (multiple noreturn attribute specifiers in a single declaration doesn't result in a diagnostic)
/cp
2015-07-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60365
	* parser.c (cp_parser_check_std_attribute): New.
	(cp_parser_std_attribute_list): Call it.

/testsuite
2015-07-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60365
	* g++.dg/cpp0x/gen-attrs-60.C: New.
	* g++.dg/cpp1y/attr-deprecated-2.C: Likewise.

From-SVN: r225234
2015-07-01 09:08:17 +00:00
Jiong Wang
d0baaae351 [AArch64] Document several AArch64-specific test directives
2015-07-01  Jiong Wang  <jiong.wang@arm.com>

	* doc/sourcebuild.texi (AArch64-specific attributes): Document
	"aarch64_tiny", "aarch64_small", "aarch64_large",
	"aarch64_little_endian", "aarch64_big_endian".

From-SVN: r225233
2015-07-01 09:01:47 +00:00
Jiong Wang
8997ef1850 [AArch64] Restrict pic-small.c by new test directive
2015-07-01  Jiong Wang  <jiong.wang@arm.com>

      gcc/
	* doc/sourcebuild.texi (AArch64-specific attributes): New subsection.
	Document "aarch64_small_fpic".

      gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_aarch64_small_fpic): New function.
	* gcc.target/aarch64/pic-small.c: Restrict this test under
	check_effective_target_aarch64_small_fpic.

From-SVN: r225232
2015-07-01 08:51:49 +00:00
Jiong Wang
34ecdb0f20 [AArch64] Fall back to -fPIC if no support of -fpic in binutils
2015-07-01  Jiong Wang  <jiong.wang@arm.com>

	* configure.ac: Add check for aarch64 assembler -fpic relocation
	modifier support.
	* configure: Regenerate.
	* config.in: Regenerate.
	* config/aarch64/aarch64.c (initialize_aarch64_code_model): Fall back
	to -fPIC if not support of -fpic relocation modifier in assembler.

From-SVN: r225231
2015-07-01 08:45:08 +00:00
Richard Sandiford
1d628b1536 re PR middle-end/66685 (conftest.c:16:1: internal compiler error: in as_a, at is-a.h:192)
gcc/
	PR bootstrap/66685
	* rtl.c (classify_insn): Handle returns in PARALLELs.

From-SVN: r225230
2015-07-01 08:41:33 +00:00
Eric Botcazou
eb71ab9f1f re PR middle-end/66633 (ICE on valid "verify_gimple failed" with OpenMP)
PR middle-end/66633
	* tree-nested.c (convert_nonlocal_omp_clauses): Initialize need_chain
	to true if the function is nested and if not optimizing.
	(convert_local_omp_clauses): Initialize need_frame to true if the
	function contains nested functions and if not optimizing.

From-SVN: r225227
2015-07-01 08:21:40 +00:00
Richard Biener
97e7739106 fold-const.c (fold_binary_loc): Move ~X ^ X -> -1 and (X & Y) ^ Y -> ~X & Y transforms to ...
2015-07-01  Richard Biener  <rguenther@suse.de>

	* fold-const.c (fold_binary_loc): Move ~X ^ X -> -1 and
	(X & Y) ^ Y -> ~X & Y transforms to ...
	* match.pd: ... here.

From-SVN: r225225
2015-07-01 07:42:10 +00:00
Eric Botcazou
a64be36b47 Fix latest entry
From-SVN: r225224
2015-07-01 07:39:55 +00:00
Richard Biener
88a2d13f6c genmatch.c (expr::gen_transform): Shortcut re-simplifying of converts to avoid uninteresting noise from the...
2015-07-01  Richard Biener <rguenther@suse.de>

	* genmatch.c (expr::gen_transform): Shortcut re-simplifying
	of converts to avoid uninteresting noise from the conversion
	simplifying patterns.

From-SVN: r225223
2015-07-01 07:36:25 +00:00
Uros Bizjak
e8cfe4c5a5 * gcc.target/i386/pr66691.c: Update PR number.
From-SVN: r225222
2015-07-01 08:43:18 +02:00
Sandra Loosemore
1e32ce0bc5 c6x.c (try_rename_operands): Do not depend on gcc_assert evaluating its argument for side-effect.
2015-06-30  Sandra Loosemore <sandra@codesourcery.com>

	gcc/
	* config/c6x/c6x.c (try_rename_operands): Do not depend on
	gcc_assert evaluating its argument for side-effect.

From-SVN: r225221
2015-06-30 22:15:32 -04:00
Patrick Palka
f58d5e069d Fix PR c++/66686 (dependent template template substitution)
gcc/cp/ChangeLog:

	PR c++/66686
	* pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
	return 0 if tsubst returns a dependent type.

gcc/testsuite/ChangeLog:

	PR c++/66686
	* g++.dg/template/pr66686.C: New test.

From-SVN: r225220
2015-07-01 01:07:35 +00:00
Kaz Kojima
5be6d9e45f re PR target/64833 ([SH]: Error: pcrel too far when compiling imagemagick and graphicsmagick on Debian sh4)
PR target/64833
* [SH] Set length of casesi_worker_1 insn to 8 when flag_pic is set.

From-SVN: r225219
2015-07-01 01:02:48 +00:00
GCC Administrator
9127ce984d Daily bump.
From-SVN: r225218
2015-07-01 00:16:11 +00:00
Eric Botcazou
cec34ee582 lto-streamer-out.c (class DFS): Adjust hash_scc method.
* lto-streamer-out.c (class DFS): Adjust hash_scc method.
	(DFS::DFS): Pass this_ref_p and ref_p to hash_scc.
	(hash_scc): Add this_ref_p and ref_p parameters and pass them
	to the inner DFS walk.

From-SVN: r225212
2015-06-30 21:05:02 +00:00
Richard Sandiford
ec4a505ff5 target-insns.def (jump): New targetm instruction pattern.
gcc/
	* target-insns.def (jump): New targetm instruction pattern.
	* bb-reorder.c (get_uncond_jump_length): Use targetm.gen_jump
	instead of gen_jump.
	(fix_up_crossing_landing_pad): Likewise.
	(add_labels_and_missing_jumps): Likewise.
	(fix_crossing_conditional_branches): Likewise.
	* cfgrtl.c (try_redirect_by_replacing_jump): Likewise.
	(force_nonfallthru_and_redirect): Likewise.
	* cse.c (cse_insn): Likewise.
	* expmed.c (expand_divmod): Likewise.
	* expr.c (store_expr_with_bounds, expand_expr_real_2): Likewise.
	* haifa-sched.c (init_before_recovery): Likewise.
	(sched_create_recovery_edges): Likewise.
	* ifcvt.c (find_cond_trap): Likewise.
	* optabs.c (expand_doubleword_shift, expand_doubleword_clz): Likewise.
	(expand_float, expand_fix): Likewise.
	* stmt.c (emit_jump): Likewise.

From-SVN: r225211
2015-06-30 20:57:21 +00:00
Richard Sandiford
20fceb31cd gcc/
* defaults.h (HAVE_load_multiple, gen_load_multiple)
	(HAVE_store_multiple, gen_store_multiple): Delete.
	* target-insns.def (load_multiple, store_multiple): New targetm
	instruction patterns.
	* expr.c (move_block_to_reg, move_block_from_reg): Use them instead
	of HAVE_*/gen_* interface.

From-SVN: r225210
2015-06-30 20:56:43 +00:00
Richard Sandiford
ccf5bbdd40 gcc/
* defaults.h (HAVE_mem_thread_fence, gen_mem_thread_fence)
	(HAVE_memory_barrier, gen_memory_barrier, HAVE_mem_signal_fence)
	(gen_mem_signal_fence): Delete.
	* target-insns.def (mem_signal_fence, mem_thread_fence)
	(memory_barrier): New targetm instruction patterns.
	* optabs.c (expand_mem_thread_fence): Use them instead of HAVE_*/gen_*
	interface.
	(expand_mem_signal_fence): Likewise.

From-SVN: r225209
2015-06-30 20:56:14 +00:00
Richard Sandiford
e86a994681 defaults.h (HAVE_epilogue, [...]): Delete.
gcc/
	* defaults.h (HAVE_epilogue, gen_epilogue): Delete.
	* target-insns.def (epilogue, prologue, sibcall_prologue): New
	targetm instruction patterns.
	* alias.c (init_alias_analysis): Use them instead of HAVE_*/gen_*
	interface.
	* calls.c (expand_call): Likewise.
	* cfgrtl.c (cfg_layout_finalize): Likewise.
	* df-scan.c (df_get_entry_block_def_set): Likewise.
	(df_get_exit_block_use_set): Likewise.
	* dwarf2cfi.c (pass_dwarf2_frame::gate): Likewise.
	* final.c (final_start_function): Likewise.
	* function.c (thread_prologue_and_epilogue_insns): Likewise.
	(reposition_prologue_and_epilogue_notes): Likewise.
	* reorg.c (find_end_label): Likewise.
	* toplev.c (process_options): Likewise.

From-SVN: r225208
2015-06-30 20:55:13 +00:00
David Malcolm
ec5d008814 jit: add switch statements
gcc/ChangeLog:
	* typed-splay-tree.h: New file.

gcc/jit/ChangeLog:
	* docs/cp/topics/functions.rst (Blocks): Add switch statements to
	list of ways to terminate a block.
	(gccjit::block::end_with_switch): Add function description.
	(gccjit::case_): Add class.
	(gccjit::context::new_case): Add function description.
	* docs/cp/topics/objects.rst: Add "case_" to class hierarchy.
	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_3): New.
	* docs/topics/functions.rst (Blocks): Add switch statements to
	list of ways to terminate a block.
	(gcc_jit_block_end_with_switch): Add function description.
	(gcc_jit_case): Add type.
	(gcc_jit_context_new_case): Add function description.
	(gcc_jit_case_as_object): Add function description.
	* docs/topics/objects.rst: Add gcc_jit_case to class hierarchy.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
	* jit-common.h (gcc::jit::recording::case_): Add forward decl.
	(gcc::jit::playback::case_): Add forward decl.
	* jit-playback.c (add_case): New function.
	(gcc::jit::playback::block::add_switch): New function.
	* jit-playback.h (gcc::jit::playback::case_): New struct.
	(gcc::jit::playback::block::get_function): New method.
	(gcc::jit::playback::block::add_switch): New method.
	* jit-recording.c: Within namespace gcc::jit...
	(recording::context::new_case): New method.
	(recording::function::validate): Update for change to
	get_successor_blocks.
	(recording::block::end_with_switch): New method.
	(recording::block::get_successor_blocks): Update to support an
	arbitrary number of successor blocks.
	(recording::block::dump_edges_to_dot): Likewise.
	(memento_of_new_rvalue_from_const <int>::get_wide_int): New.
	(memento_of_new_rvalue_from_const <long>::get_wide_int): New.
	(memento_of_new_rvalue_from_const <double>::get_wide_int): New.
	(memento_of_new_rvalue_from_const <void *>::get_wide_int): New.
	(recording::statement::get_successor_blocks): Update to support an
	arbitrary number of successor blocks.
	(recording::conditional::get_successor_blocks): Likewise.
	(recording::jump::get_successor_blocks): Likewise.
	(recording::return_::get_successor_blocks): Likewise.
	(recording::case_::write_reproducer): New.
	(recording::case_::make_debug_string): New.
	(recording::switch_::switch_): New.
	(recording::switch_::replay_into): New.
	(recording::switch_::get_successor_blocks): New.
	(recording::switch_::make_debug_string): New.
	(recording::switch_::write_reproducer): New.
	* jit-recording.h: Within namespace gcc::jit::recording...
	(context::new_case): New.
	(rvalue::is_constant): New.
	(rvalue::get_wide_int): New.
	(block::end_with_switch): New.
	(block::get_successor_blocks): Update to support an arbitrary
	number of successor blocks.
	(memento_of_new_rvalue_from_const::is_constant): New.
	(memento_of_new_rvalue_from_const::get_wide_int): New.
	(statement::get_successor_blocks): Update to support an arbitrary
	number of successor blocks.
	(conditional::get_successor_blocks): Likewise.
	(jump::get_successor_blocks): Likewise.
	(return_::get_successor_blocks): Likewise.
	(case_): New subclass of memento.
	(switch_): New subclass of statement.
	* libgccjit++.h (gccjit::case_): New subclass of gccjit::object.
	(gccjit::context::new_case): New method.
	(gccjit::block::end_with_switch): New method.
	(gccjit::case_::case): New ctors.
	(gccjit::case_::get_inner_case): New method.
	* libgccjit.c: Include "typed-splay-tree.h"
	(struct gcc_jit_case): New.
	(gcc_jit_context_new_case): New function.
	(gcc_jit_case_as_object): New function.
	(valid_dest_for_switch): New function.
	(valid_case_for_switch): New function.
	(class api_call_validator): New class.
	(class case_range_validator): New class.
	(case_range_validator::case_range_validator): New.
	(case_range_validator::validate): New.
	(case_range_validator::case_compare): New.
	(case_range_validator::get_wide_int): new.
	(gcc_jit_block_end_with_switch): New.
	* libgccjit.h: Add gcc_jit_case to class hierarchy comment.
	(gcc_jit_case): New typedef.
	(gcc_jit_context_new_case): New function.
	(gcc_jit_case_as_object): New function.
	(gcc_jit_block_end_with_switch): New function.
	(LIBGCCJIT_HAVE_SWITCH_STATEMENTS): New.
	* libgccjit.map: Add gcc_jit_block_end_with_switch,
	gcc_jit_case_as_object and gcc_jit_context_new_case.

gcc/testsuite/ChangeLog:
	* jit.dg/all-non-failing-tests.h: Add test-switch.c.
	* jit.dg/test-error-gcc_jit_block_end_with_switch-NULL-case.c: New
	testcase.
	* jit.dg/test-error-gcc_jit_block_end_with_switch-mismatching-case-type.c:
	New testcase.
	* jit.dg/test-error-gcc_jit_block_end_with_switch-overlapping-ranges.c:
	New testcase.
	* jit.dg/test-error-gcc_jit_context_new_case-non-const-label.c:
	New testcase.
	* jit.dg/test-error-gcc_jit_context_new_case-non-integer-type.c:
	New testcase.
	* jit.dg/test-error-gcc_jit_context_new_case-reversed-endpoints.c:
	New testcase.
	* jit.dg/test-switch.c: New testcase.
	* jit.dg/test-switch.cc: New testcase.

From-SVN: r225207
2015-06-30 20:39:50 +00:00
David Malcolm
6a3603e356 PR jit/66546: Add gcc_jit_context_set_bool_allow_unreachable_blocks
gcc/jit/ChangeLog:
	PR jit/66546
	* docs/cp/topics/contexts.rst
	(gccjit::context::set_bool_allow_unreachable_blocks): New.
	* docs/topics/compatibility.rst (LIBGCCJIT_ABI_2): New.
	* docs/topics/contexts.rst (Options): Add notes discussing the
	transition from enums to entrypoints for new options.
	(gcc_jit_context_set_bool_allow_unreachable_blocks): New.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
	* jit-common.h (gcc::jit::inner_bool_option): New enum.
	* jit-recording.c: Within namespace gcc::jit...
	(recording::context::context): Handle m_inner_bool_options.
	(recording::context::set_inner_bool_option): New.
	(inner_bool_option_reproducer_strings): New.
	(recording::context::log_all_options): Log the "inner" bool
	options.
	(recording::context::log_inner_bool_option): New.
	(recording::context::dump_reproducer_to_file): Write initializers
	for "inner" bool options.
	(recording::function::validate): Don't check for block
	reachability if INNER_BOOL_OPTION_ALLOW_UNREACHABLE_BLOCKS is set.
	* jit-recording.h: Within namespace gcc::jit...
	(recording::context::set_inner_bool_option): New.
	(recording::context::get_inner_bool_option): New.
	(recording::context::log_inner_bool_option): New.
	(recording::context::m_inner_bool_options): New.
	* libgccjit++.h
	(gccjit::context::set_bool_allow_unreachable_blocks): New.
	* libgccjit.c
	(gcc_jit_context_set_bool_allow_unreachable_blocks): New.
	* libgccjit.h: Add note about options present in the
	initial release of libgccjit.
	(gcc_jit_context_set_bool_allow_unreachable_blocks): New API
	entrypoint.
	(LIBGCCJIT_HAVE_gcc_jit_context_set_bool_allow_unreachable_blocks):
	New macro.
	* libgccjit.map (LIBGCCJIT_ABI_2): New, containing...
	(gcc_jit_context_set_bool_allow_unreachable_blocks): ...this new
	entrypoint.

gcc/testsuite/ChangeLog:
	PR jit/66546
	* jit.dg/all-non-failing-tests.h: Add note about
	test-validly-unreachable-block.c.
	* jit.dg/test-validly-unreachable-block.c: New file.

From-SVN: r225206
2015-06-30 19:38:12 +00:00
David Malcolm
fa22c20d5a PR jit/66628: add gcc_jit_context_add_command_line_option
gcc/jit/ChangeLog:
	PR jit/66628
	* docs/cp/topics/contexts.rst (Additional command-line options):
	New section.
	* docs/topics/compatibility.rst: New file.
	* docs/topics/contexts.rst (Additional command-line options): New
	section.
	* docs/topics/index.rst: Add compatibility.rst.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
	* jit-playback.c (make_fake_args): Add call to
	append_command_line_options.
	* jit-recording.c: Within namespace gcc::jit...
	(recording::context::~context): Free the optnames within
	m_command_line_options.
	(recording::context::set_bool_option): Likewise.
	(recording::context::add_command_line_option): New method.
	(recording::context::append_command_line_options): New method.
	(recording::context::dump_reproducer_to_file): Add command-line
	options.
	* jit-recording.h: Within namespace gcc::jit...
	(recording::context::add_command_line_option): New method.
	(recording::context::append_command_line_options): New method.
	(recording::context::m_command_line_options): New field.
	* libgccjit++.h (gccjit::context::add_command_line_option): New
	method.
	* libgccjit.c (gcc_jit_context_add_command_line_option): New API
	entrypoint.
	* libgccjit.h (gcc_jit_context_add_command_line_option): New API
	entrypoint.
	(LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option): New
	macro.
	* libgccjit.map: Put existing symbols within LIBGCCJIT_ABI_0; add
	LIBGCCJIT_ABI_1 and gcc_jit_context_add_command_line_option.

gcc/testsuite/ChangeLog:
	PR jit/66628
	* jit.dg/all-non-failing-tests.h: Add note about
	test-extra-options.c.
	* jit.dg/test-extra-options.c: New testcase.

From-SVN: r225205
2015-06-30 19:27:19 +00:00
David Malcolm
a6314e15e0 fixes to gcc_jit_context_dump_reproducer_to_file
gcc/jit/ChangeLog:
	* jit-recording.c
	(gcc::jit::recording::context::dump_reproducer_to_file):
	Add pragma to generated reproducers to disable -Wunused-variable.
	Fix handling of NULL string options.

From-SVN: r225204
2015-06-30 19:18:34 +00:00
David Malcolm
adb6d84ba6 jit: fix some .rst issues in docs
gcc/jit/ChangeLog:
	* docs/cp/topics/expressions.rst: Remove stray semicolon.
	* docs/cp/topics/functions.rst: Remove stray backslash.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.

From-SVN: r225203
2015-06-30 19:09:31 +00:00
Vladimir Makarov
633cdd728f Add missed test
From-SVN: r225201
2015-06-30 17:44:00 +00:00
Vladimir Makarov
ef87312ec1 re PR debug/66691 (ICE on valid code at -O3 with -g enabled in simplify_subreg, at simplify-rtx.c:5744)
2015-06-30  Vladimir Makarov  <vmakarov@redhat.com>

	PR debug/66691
	* lra-int.h (lra_substitute_pseudo): Add a parameter.
	(lra_substitute_pseudo_within_insn): Ditto.
	* lra.c (lra_substitute_pseudo): Add a parameter.  Simplify subreg
	of constant.
	(lra_substitute_pseudo_within_insn): Add a parameter.  Transfer it
	to lra_substitute_pseudo.
	* lra-lives.c (process_bb_lives): Add an argument to
	lra_substitute_pseudo_within_insn call.
	* lra-constraints.c (inherit_reload_reg, split_reg): Add an
	argument to lra_substitute_pseudo and
	lra_substitute_pseudo_within_insn calls.
	(remove_inheritance_pseudos, undo_optional_reloads): Ditto.

2015-06-30  Vladimir Makarov  <vmakarov@redhat.com>

	PR debug/66691
	* gcc.target/i386/pr66691.c: New.

From-SVN: r225200
2015-06-30 17:40:55 +00:00
H.J. Lu
8b970b6e69 IA MCU psABI support: testsuite
We run Intel MCU psABI tests on Linux/ia32 with -miamcu.  Since Intel
MCU psABI has a different calling convention, the only Linux libc function
allowed is "abort".

asm-support.S contains some support functions as well as a subset of
soft-fp, which is written in assembly with x87 instructions, to provide
intrinsics needed by -miamcu so that Intel MCU psABI tests can run on
Linux.

	* gcc.target/i386/iamcu/abi-iamcu.exp: New file.
	* gcc.target/i386/iamcu/args.h: Likewise.
	* gcc.target/i386/iamcu/asm-support.S: Likewise.
	* gcc.target/i386/iamcu/defines.h: Likewise.
	* gcc.target/i386/iamcu/macros.h: Likewise.
	* gcc.target/i386/iamcu/test_3_element_struct_and_unions.c: Likewise.
	* gcc.target/i386/iamcu/test_basic_64bit_returning.c: Likewise.
	* gcc.target/i386/iamcu/test_basic_alignment.c: Likewise.
	* gcc.target/i386/iamcu/test_basic_array_size_and_align.c: Likewise.
	* gcc.target/i386/iamcu/test_basic_returning.c: Likewise.
	* gcc.target/i386/iamcu/test_basic_sizes.c: Likewise.
	* gcc.target/i386/iamcu/test_basic_struct_size_and_align.c: Likewise.
	* gcc.target/i386/iamcu/test_basic_union_size_and_align.c: Likewise.
	* gcc.target/i386/iamcu/test_bitfields.c: Likewise.
	* gcc.target/i386/iamcu/test_complex_returning.c: Likewise.
	* gcc.target/i386/iamcu/test_passing_floats.c: Likewise.
	* gcc.target/i386/iamcu/test_passing_integers.c: Likewise.
	* gcc.target/i386/iamcu/test_passing_structs.c: Likewise.
	* gcc.target/i386/iamcu/test_passing_structs_and_unions.c: Likewise.
	* gcc.target/i386/iamcu/test_passing_unions.c: Likewise.
	* gcc.target/i386/iamcu/test_struct_returning.c: Likewise.
	* gcc.target/i386/iamcu/test_varargs.c: Likewise.

From-SVN: r225199
2015-06-30 09:46:45 -07:00
H.J. Lu
cb78b51ca0 IA MCU psABI support: changes to libraries
Patch in the bottom adds support of IA MCU psABI to libgcc (enables
soft-fp) and libdecnumber (enables it for IA MCU).

config/

	* dfp.m4 (enable_decimal_float): Also set to yes for
	i?86*-*-elfiamcu target.

gcc/

	* configure: Regenerated.

libdecnumber/

	* configure: Regenerated.

libgcc/

	* config.host: Support i[34567]86-*-elfiamcu target.
	* config/t-softfp-sfdftf: New file.
	* config/i386/32/t-iamcu: Likewise.
	* configure: Regenerated.

From-SVN: r225198
2015-06-30 09:42:07 -07:00
H.J. Lu
d90639476f IA MCU psABI support: GCC changes
This patch introduces basic IA MCU psABI support into GCC.

	* configure.ac (ospace_frag): Enable for i?86*-*-elfiamcu
	target.
	* configure: Regenerate.

gcc/

	* config.gcc: Support i[34567]86-*-elfiamcu target.
	* config/i386/iamcu.h: New.
	* config/i386/i386.opt: Add -miamcu.
	* doc/invoke.texi: Document -miamcu.
	* common/config/i386/i386-common.c  (ix86_handle_option): Turn
	off x87/MMX/SSE/AVX codegen for -miamcu.
	* config/i386/i386-c.c (ix86_target_macros_internal): Define
	__iamcu/__iamcu__ for -miamcu.
	* config/i386/i386.h (PREFERRED_STACK_BOUNDARY_DEFAULT): Set
	to MIN_STACK_BOUNDARY if TARGET_IAMCU is true.
	(BIGGEST_ALIGNMENT): Set to 32 if TARGET_IAMCU is true.
	* config/i386/i386.c (ix86_option_override_internal): Ignore and
	warn -mregparm for Intel MCU.  Turn on -mregparm=3 for Intel
	MCU by default.  Default long double to 64-bit for Intel MCU.
	Turn on -freg-struct-return for Intel MCU.  Issue an error when
	-miamcu is used in 64-bit or x32 mode or if x87, MMX, SSE or
	AVX is turned on.
	(function_arg_advance_32): Pass value whose size is no larger
	than 8 bytes in registers for Intel MCU.
	(function_arg_32): Likewise.
	(ix86_return_in_memory): Return value whose size is no larger
	than 8 bytes in registers for Intel MCU.
	(iamcu_alignment): New function.
	(ix86_data_alignment): Call iamcu_alignment if TARGET_IAMCU is
	true.
	(ix86_local_alignment): Don't increase alignment for Intel MCU.
	(x86_field_alignment): Return iamcu_alignment if TARGET_IAMCU is
	true.

From-SVN: r225197
2015-06-30 09:40:19 -07:00
Marek Polacek
3db55b2b6d match.pd (~x | x): Don't use tree_nop_conversion_p.
* match.pd (~x | x): Don't use tree_nop_conversion_p.  Build
	the final expression with the operand's type and then convert
	it to the type of the expression.

	* gcc.dg/fold-ior-3.c: New test.

From-SVN: r225196
2015-06-30 16:36:44 +00:00
Marek Polacek
d3bc1d1b65 match.pd (X - (X / Y) * Y): Use convert1 and convert2.
* match.pd (X - (X / Y) * Y): Use convert1 and convert2.  Convert
	both operands of the resulting expression.	

	* gcc.dg/fold-minus-6.c: New test.

From-SVN: r225195
2015-06-30 16:35:16 +00:00
Tom de Vries
b451c27117 Run testsuite/libgomp.oacc-c++/c++.exp at -O2 by default
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c++/c++.exp: Set DEFAULT_CFLAGS to -O2 if not
	already set.  Use DEFAULT_CFLAGS in dg-runtest.
	* testsuite/libgomp.oacc-c-c++-common/collapse-3.c: Remove dg-options
	"-O2".

From-SVN: r225194
2015-06-30 15:43:55 +00:00
Jason Merrill
47297e51f5 re PR debug/66653 (ice in gen_type_die_with_usage, at dwarf2out.c:20876)
PR debug/66653
	* decl2.c (is_late_template_attribute): True for tls_model.

From-SVN: r225193
2015-06-30 11:40:38 -04:00
Jason Merrill
3048c0c746 re PR debug/66653 (ice in gen_type_die_with_usage, at dwarf2out.c:20876)
PR debug/66653
	* cp-tree.h (CP_DECL_THREAD_LOCAL_P): New.
	(DECL_GNU_TLS_P): Use DECL_LANG_SPECIFIC field.
	(SET_DECL_GNU_TLS_P): New.
	* call.c (make_temporary_var_for_ref_to_temp): Use
	CP_DECL_THREAD_LOCAL_P.
	(set_up_extended_ref_temp): Likewise.
	* decl.c (duplicate_decls, expand_static_init): Likewise.
	(redeclaration_error_message, grokvardecl): Likewise.
	(start_decl, register_dtor_fn, grokdeclarator): Likewise.
	* decl2.c (get_guard, var_needs_tls_wrapper): Likewise.
	(handle_tls_init): Likewise.
	* pt.c (tsubst_decl, tsubst_copy_and_build): Likewise.
	* semantics.c (finish_id_expression): Likewise.
	(handle_omp_array_sections_1, finish_omp_clauses): Likewise.
	(finish_omp_threadprivate): Likewise.
	* tree.c (decl_storage_duration): Likewise.
	* cp-gimplify.c (omp_var_to_track): Likewise.
	(cp_genericize_r): Check that it matches DECL_THREAD_LOCAL_P.
	* lex.c (retrofit_lang_decl): Return if DECL_LANG_SPECIFIC is
	already set.

From-SVN: r225192
2015-06-30 10:31:36 -04:00
Jonathan Wakely
5ea37bcaba Makefile.am (stamp-pdf-doxygen): Grep for LaTeX errors in log.
* doc/Makefile.am (stamp-pdf-doxygen): Grep for LaTeX errors in log.
	* doc/Makefile.in: Regenerate.

From-SVN: r225191
2015-06-30 15:22:14 +01:00
Jonathan Wakely
6f86467975 * include/bits/stl_pair.h: Replace class keyword with typename.
From-SVN: r225190
2015-06-30 14:35:36 +01:00
Ville Voutilainen
bf7818bfb0 Implement N4387, "Improving pair and tuple", and LWG 2367.
2015-06-30  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Implement N4387, "Improving pair and tuple", and LWG 2367.

	* include/bits/stl_pair.h (_ConstructiblePair,
	_ImplicitlyConvertiblePair, _MoveConstructiblePair,
	_ImplicitlyMoveConvertiblePair): New.
	(pair()): Constrain it.
	(pair(const _T1&, const _T2&), pair(const pair<_U1, _U2>&),
	pair(_U1&&, const _T2&), pair(const _T1&, _U2&&), pair(_U1&&, _U2&&),
	pair(pair<_U1, _U2>&&)): Make conditionally explicit.
	* include/std/tuple (_TC, tuple::_TC2, tuple::TCC, tuple::TMC): New.
	(tuple()): Constrain it.
	(tuple(const _UElements&...), tuple(_UElements&&...),
	tuple(const tuple<_UElements...>&), tuple(tuple<_UElements...>&&),
	tuple(allocator_arg_t, const _Alloc&, const _UElements&...),
	tuple(allocator_arg_t, const _Alloc&, _UElements&&...),
	tuple(allocator_arg_t, const _Alloc&, const tuple<_UElements...>&),
	tuple(allocator_arg_t, const _Alloc&, tuple<_UElements...>&&),
	tuple(const pair<_U1, _U2>&), tuple(pair<_U1, _U2>&&),
	tuple(allocator_arg_t, const _Alloc&, const pair<_U1, _U2>&),
	tuple(allocator_arg_t, const _Alloc&, pair<_U1, _U2>&&)): Make
	conditionally explicit.
	* include/experimental/functional (__boyer_moore_array_base): Name
	array type explicitly instead of using an empty braced-init-list.
	* testsuite/20_util/pair/cons/explicit_construct.cc: New.
	* testsuite/20_util/pair/piecewise.cc: Use piecewise_construct.
	* testsuite/20_util/pair/requirements/dr2367.cc: New.
	* testsuite/20_util/tuple/cons/explicit_construct.cc: New.
	* testsuite/20_util/tuple/requirements/dr2367.cc: New.

From-SVN: r225189
2015-06-30 14:26:49 +01:00
Edward Smith-Rowland
fe95b0366a Implement N4197 - Adding u8 character literals
libcpp:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* include/cpplib.h (UTF8CHAR, UTF8CHAR_USERDEF): New cpp tokens;
	(struct cpp_options): Add utf8_char_literals.
	* init.c (struct lang_flags): Add utf8_char_literals;
	(struct lang_flags lang_defaults): Add column for utf8_char_literals.
	* macro.c (stringify_arg()): Treat CPP_UTF8CHAR token; 
	* expr.c (cpp_userdef_char_remove_type(), cpp_userdef_char_add_type()):
	Treat CPP_UTF8CHAR_USERDEF, CPP_UTF8CHAR tokens;
	(cpp_userdef_char_p()): Treat CPP_UTF8CHAR_USERDEF token;
	(eval_token(), _cpp_parse_expr()): Treat CPP_UTF8CHAR token.
	* lex.c (lex_string(), _cpp_lex_direct()): Include CPP_UTF8CHAR tokens.
	* charset.c (converter_for_type(), cpp_interpret_charconst()):
	Treat CPP_UTF8CHAR token.


gcc/c-family:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* c-family/c-ada-spec.c (print_ada_macros()): Treat CPP_UTF8CHAR
	like CPP_CHAR.
	* c-family/c-common.c (c_parse_error()): print CPP_UTF8CHAR
	and CPP_UTF8CHAR_USERDEF tokens.
	* c-family/c-lex.c (c_lex_with_flags()): Treat CPP_UTF8CHAR_USERDEF
	and CPP_UTF8CHAR tokens; (lex_charconst()): Treat CPP_UTF8CHAR token.


gcc/cp:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* parser.c (cp_parser_primary_expression()): Treat CPP_UTF8CHAR
	and CPP_UTF8CHAR_USERDEF tokens;
	(cp_parser_parenthesized_expression_list()): Treat CPP_UTF8CHAR token.


gcc/testsuite:

2015-06-30  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement N4197 - Adding u8 character literals
	* g++.dg/cpp1z/utf8.C: New.
	* g++.dg/cpp1z/utf8-neg.C: New.
	* g++.dg/cpp1z/udlit-utf8char.C: New.

From-SVN: r225185
2015-06-30 12:58:48 +00:00
Richard Biener
5b00d92116 fold-const.c (fold_binary_loc): Move ~x & ~y -> ~(x | y) and ~x | ~y -> ~(x & y)...
2015-06-30  Richard Biener  <rguenther@suse.de>

	* fold-const.c (fold_binary_loc): Move ~x & ~y -> ~(x | y) and
	~x | ~y -> ~(x & y), (x & CST) ^ (x & CST2) -> (x & CST) | (x & CST2),
	(X | Y) ^ X -> Y & ~ X, ~X ^ ~Y to X ^ Y and ~X ^ C to X ^ ~C ...
	* match.pd: ... to patterns here.

From-SVN: r225184
2015-06-30 12:54:23 +00:00