Commit Graph

122513 Commits

Author SHA1 Message Date
Jason Merrill b7df43cdb4 re PR c++/56481 (endless loop compiling a C++ file)
PR c++/56481
	* semantics.c (potential_constant_expression_1): Use of 'this' in
	a non-constexpr function makes the expression not potentially
	constant.

From-SVN: r196737
2013-03-16 22:37:21 -04:00
Jason Merrill 57fcd4f4e4 re PR c++/52748 ([C++11] N3276 changes to decltype)
N3276
	PR c++/52748
	* cp-tree.h (tsubst_flags): Add tf_decltype.
	* call.c (build_cxx_call): Don't build a temporary if it's set.
	(build_over_call): Make sure it's only passed to build_cxx_call.
	* parser.c (cp_parser_primary_expression): Add decltype_p parm.
	(cp_parser_unary_expression): Likewise.
	(cp_parser_cast_expression): Likewise.
	(cp_parser_binary_expression): Likewise.
	(cp_parser_assignment_expression): Likewise.
	(cp_parser_postfix_expression): Likewise.  Pass tf_decltype.
	(cp_parser_explicit_instantiation): Add decltype_p.  Force a
	temporary for a call on the LHS of a comma.
	(cp_parser_decltype): Pass true to decltype_p parms.
	* pt.c (tsubst) [DECLTYPE_TYPE]: Pass tf_decltype.
	(tsubst_copy_and_build): Pass tf_decltype down only for
	CALL_EXPR and the RHS of COMPOUND_EXPR.
	* tree.c (build_cplus_new): Call complete_type_or_maybe_complain.

From-SVN: r196736
2013-03-16 22:37:09 -04:00
Jason Merrill 2df663cced cp-tree.h (abstract_class_use): New enum.
* cp-tree.h (abstract_class_use): New enum.
	* typeck2.c (pending_abstract_type): Add use field.
	(abstract_virtuals_error_sfinae): Add overloads taking
	abstract_class_use instead of tree.
	* typeck.c (build_static_cast_1): Call it.
	* except.c (is_admissible_throw_operand_or_catch_parameter): Call it.
	* pt.c: Adjust calls.
	* decl.c (cp_finish_decl): Don't handle functions specially.
	(grokdeclarator): Always check return type.
	* init.c (build_new_1): Adjust call.

From-SVN: r196735
2013-03-16 22:36:55 -04:00
Jason Merrill 95ffad49d5 DR 337 PR c++/17232
DR 337
	PR c++/17232
	* pt.c (tsubst) [ARRAY_TYPE]: Use abstract_virtuals_error_sfinae.
	* typeck2.c (abstract_virtuals_error_sfinae): Call complete_type.

From-SVN: r196734
2013-03-16 22:36:40 -04:00
Jason Merrill 346928a2c9 DR 657
DR 657
	* pt.c (tsubst_function_type): Call abstract_virtuals_error_sfinae.
	(tsubst_arg_types): Likewise.

From-SVN: r196733
2013-03-16 22:36:26 -04:00
Jason Merrill 0cc5ae8d62 DR 1518 PR c++/54835
DR 1518
	PR c++/54835
	* call.c (convert_like_real): Check for explicit constructors
	even for value-initialization.

From-SVN: r196732
2013-03-16 22:36:08 -04:00
Jason Merrill cb3c050e51 re PR c++/54946 (ICE on template parameter from cast char-pointer in C++11 constexpr struct)
PR c++/54946
	* pt.c (convert_nontype_argument): Handle invalid pointer.

From-SVN: r196731
2013-03-16 22:35:50 -04:00
Jason Merrill e9f3968bbe * parser.c (cp_parser_lambda_expression): Use nreverse.
From-SVN: r196730
2013-03-16 22:35:36 -04:00
Jason Merrill e2adfdad84 re PR c++/56447 ([C++11] Lambda in template has conversion op it shouldn't have)
PR c++/56447
	PR c++/55532
	* pt.c (instantiate_class_template_1): Instantiate lambda capture
	list here.
	(tsubst_copy_and_build): Not here.

From-SVN: r196729
2013-03-16 22:35:18 -04:00
Jason Merrill 5275b2c7d7 re PR c++/55017 ([DR 1051] [C++11] Rvalue-reference member should cause copy constructor to be deleted, but still declared)
PR c++/55017
	* method.c (walk_field_subobs): Disallow copy of rvalue ref.

From-SVN: r196728
2013-03-16 22:35:01 -04:00
Jason Merrill cdf47df08a re PR c++/55240 ([c++0x] ICE on non-static data member initialization using 'auto' variable from containing function)
PR c++/55240
	* parser.c (parsing_nsdmi): New.
	* semantics.c (outer_automatic_var_p): Check it.
	(finish_id_expression): Likewise.
	* cp-tree.h: Declare it.

From-SVN: r196727
2013-03-16 22:34:45 -04:00
Jason Merrill a1e03bc5bc re PR c++/55241 ([C++11] diagnostics show sizeof...(T) as sizeof(T...))
PR c++/55241
	* error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly.

From-SVN: r196726
2013-03-16 22:34:31 -04:00
Jason Merrill d09b76f153 parser.c (lookup_literal_operator): Correct parm/arg naming mixup.
* parser.c (lookup_literal_operator): Correct parm/arg naming
	mixup.

From-SVN: r196725
2013-03-16 22:34:20 -04:00
Jason Merrill 011ce3f3c2 re PR c++/56238 (ICE in tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_conversions, at cp/search.c:2515)
PR c++/56238
	* pt.c (fold_non_dependent_expr_sfinae): Check
	instantiation_dependent_expression_p.

From-SVN: r196724
2013-03-16 22:34:03 -04:00
Jason Merrill 98e8112376 re PR debug/49090 (provide a way to recognize defaulted template parameters)
PR debug/49090
	* dwarf2out.c (gen_generic_params_dies): Indicate default arguments
	with DW_AT_default_value.

From-SVN: r196723
2013-03-16 22:33:50 -04:00
Jason Merrill 6721db5d15 re PR c++/56095 (Crash casting function pointer as non-type template argument)
PR c++/56095
	* class.c (resolve_address_of_overloaded_function): Accept a
	reference to function for target_type.
	(instantiate_type): Likewise.
	* pt.c (convert_nontype_argument): Pass it to
	convert_nontype_argument_function.

From-SVN: r196722
2013-03-16 22:33:38 -04:00
GCC Administrator 720f3cb82d Daily bump.
From-SVN: r196721
2013-03-17 00:21:11 +00:00
Jonathan Wakely c49cec9348 re PR libstdc++/56468 (Clang exposes bug with unexpected forward-declaration of type_info)
PR libstdc++/56468
	* libsupc++/exception_ptr.h (type_info): Declare.

From-SVN: r196709
2013-03-16 20:01:16 +00:00
Jonathan Wakely 3442f18d26 re PR libstdc++/56002 ([C++11] allow generic locks to be used without requiring plattform support for threads)
PR libstdc++/56002
	* include/std/mutex (lock_guard, unique_lock, lock): Define without
	depending on _GLIBCXX_HAS_GTHREADS.
	* testsuite/30_threads/lock_guard/cons/1.cc: Run on all targets.

From-SVN: r196706
2013-03-16 19:45:53 +00:00
Jakub Jelinek b722c9a2a2 * tree.c (cp_tree_equal): Fix a pasto.
From-SVN: r196705
2013-03-16 20:36:41 +01:00
Jakub Jelinek 87eb16a1bc re PR c++/56607 (GCC fails to warn on division by zero)
PR c++/56607
	* typeck.c (cp_build_binary_op): When calling warn_for_div_by_zero,
	pass op1 through maybe_constant_value first.

	* g++.dg/warn/Wdiv-by-zero-2.C: New test.
	* c-c++-common/pr56607.c: New test.

From-SVN: r196704
2013-03-16 20:35:41 +01:00
Paolo Carlini 9a54d96aab re PR c++/56582 (ICE on negative array index in C++11 constant expression evaluation)
/cp
2013-03-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/56582
	* semantics.c (cxx_eval_array_reference): Check for negative index.

/testsuite
2013-03-16  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/56582
	* g++.dg/cpp0x/constexpr-array5.C: New.

From-SVN: r196701
2013-03-16 10:02:11 +00:00
Eric Botcazou 179c5970e6 * gnatvsn.ads (Library_Version): Bump to 4.9.
From-SVN: r196700
2013-03-16 09:16:49 +00:00
Jakub Jelinek 2fa73fc02e * crontab: Enable snapshots from gcc-4_8-branch.
From-SVN: r196698
2013-03-16 08:22:35 +01:00
Jakub Jelinek 8a298c045d * BASE-VER: Set to 4.9.0.
From-SVN: r196697
2013-03-16 08:09:59 +01:00
Jonathan Wakely aaad548e18 re PR libstdc++/56492 (std::packaged_task requires CopyConstructible stored task)
PR libstdc++/56492
	* include/std/future (__future_base::_Result): Add result_type
	typedef.
	(__future_base::_S_allocate_result): Overload for std::allocator.
	(__future_base::_Task_setter): Use _Result::result_type instead of
	deducing the type from the task.
	(__future_base::_Task_state): Store allocator to allow shared state
	to be reset.  Replace std::function with member of target object type
	accessed via ...
	(__future_base::_Task_state_base): New abstract base class.
	(__future_base::_Task_state_base::_M_run): New virtual function to
	invoke type-erased target object.
	(__future_base::_Task_state_base::_M_reset): New virtual function to
	create new shared_state using same target object and allocator.
	(__future_base::__create_task_state): Allocate a new _Task_state.
	(packaged_task::packaged_task): Use __create_task_state.
	(packaged_task::reset): Use _Task_state_base::_M_reset.
	* testsuite/30_threads/packaged_task/cons/56492.cc: New.

From-SVN: r196695
2013-03-16 02:48:06 +00:00
GCC Administrator b5e1443a65 Daily bump.
From-SVN: r196694
2013-03-16 00:18:04 +00:00
Joseph Myers 5241ba1e2b * gcc.pot: Regenerate.
From-SVN: r196683
2013-03-15 17:44:12 +00:00
Joseph Myers 80f2e67ea5 * cpplib.pot: Regenerate.
From-SVN: r196682
2013-03-15 17:43:27 +00:00
Tobias Burnus 4b4a1012fb re PR fortran/56615 (Wrong code with TRANSFER of arrays of character with stride -1)
2013-03-15  Tobias Burnus  <burnus@net-b.de>

        PR fortran/56615
        * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Pack arrays
        if they are not simply contiguous.

2013-03-15  Tobias Burnus  <burnus@net-b.de>

        PR fortran/56615                                                                                                                
        * gfortran.dg/transfer_intrinsic_5.f90: New.

From-SVN: r196675
2013-03-15 11:09:39 +01:00
Tom Tromey 83c214a835 unwind-cxx.h: Include sys/sdt.h if detected.
* libsupc++/unwind-cxx.h: Include sys/sdt.h if detected.
	(PROBE2): New macro.
	* libsupc++/eh_throw.cc (__cxa_throw, __cxa_rethrow): Add probe.
	* libsupc++/eh_catch.cc (__cxa_begin_catch): Add probe.
	* configure.ac: Check for sys/sdt.h.
	* configure, config.h.in: Rebuild.

From-SVN: r196674
2013-03-15 09:55:07 +01:00
Kai Tietz d0a7de7055 movti.c: Don't test for x64 mingw.
* gcc.target/i386/movti.c: Don't test for x64 mingw.
	* gcc.target/i386/pr20020-1.c: Likewise.
	* gcc.target/i386/pr20020-2.c: Likewise.
	* gcc.target/i386/pr20020-3.c: Likewise.
	* gcc.target/i386/pr53425-1.c: Likewise.
	* gcc.target/i386/pr53425-2.c: Likewise.
	* gcc.target/i386/pr55093.c: Likewise.
	* gcc.target/i386/pr53907.c: Adjust test for LLP64 targets.

From-SVN: r196673
2013-03-15 08:15:37 +01:00
Jakub Jelinek 52b5769d2b re PR debug/56307 (FAIL: gcc.dg/tree-ssa/pr55579.c scan-tree-dump esra "Created a debug-only replacement for s")
PR debug/56307
	* gcc.dg/tree-ssa/pr55579.c: Add -fvar-tracking-assignments to
	dg-options.  Remove 32-bit hppa*-*-hpux* xfail.

From-SVN: r196672
2013-03-15 08:06:49 +01:00
Andi Kleen 4323afa019 Document HLE / RTM intrinsics
The TSX HLE/RTM intrinsics were missing documentation. Add this to the
manual.

gcc/:
2013-03-14  Andi Kleen  <ak@linux.intel.com>

	PR target/56619
	* doc/extend.texi: Document __ATOMIC_HLE_ACQUIRE,
	__ATOMIC_HLE_RELEASE. Document __builtin_ia32 TSX intrincs.
	Document _x* TSX intrinsics.

From-SVN: r196671
2013-03-15 04:31:43 +00:00
GCC Administrator afe1b4a290 Daily bump.
From-SVN: r196669
2013-03-15 00:19:11 +00:00
Jonathan Wakely 1f069142c7 re PR libstdc++/56613 (map::operator[](key_type&&) fails with custom allocator)
PR libstdc++/56613
	* include/bits/stl_tree.h (_Rb_tree::_M_create_node): Use
	allocator_traits instead of calling construct directly.
	* testsuite/23_containers/map/56613.cc: New.

From-SVN: r196666
2013-03-14 23:28:11 +00:00
Edgar E. Iglesias 8cc9a5a584 Add support for TLS in MicroBlaze
* configure.ac: Add MicroBlaze TLS support detection.
 * configure: Regenerate.
 * config/microblaze/microblaze-protos.h: (microblaze_cannot_force_const_mem,
   microblaze_tls_referenced_p, symbol_mentioned_p,
   label_mentioned_p): Add prototypes.
 * config/microblaze/microblaze.c (microblaze_address_type): Add ADDRESS_TLS
   and tls_reloc address types.
   (microblaze_address_info): Add tls_reloc.
   (TARGET_HAVE_TLS): Define.
   (get_tls_get_addr, microblaze_tls_symbol_p, microblaze_tls_operand_p_1,
    microblaze_tls_referenced_p, microblaze_cannot_force_const_mem,
    symbol_mentioned_p, label_mentioned_p, tls_mentioned_p, load_tls_operand,
    microblaze_call_tls_get_addr, microblaze_legitimize_tls_address): New functions.
   (microblaze_classify_unspec): Handle UNSPEC_TLS.
   (get_base_reg): Use microblaze_tls_symbol_p.
   (microblaze_classify_address): Handle TLS.
   (microblaze_legitimate_pic_operand): Use symbol_mentioned_p, label_mentioned_p
    and microblaze_tls_referenced_p.
   (microblaze_legitimize_address): Handle TLS.
   (microblaze_address_insns): Handle ADDRESS_TLS.
   (pic_address_needs_scratch): Handle TLS.
   (print_operand_address): Handle TLS.
   (microblaze_expand_prologue): Check TLS_NEEDS_GOT.
   (microblaze_expand_move): Handle TLS.
   (microblaze_legitimate_constant_p): Check microblaze_cannot_force_const_mem
    and microblaze_tls_symbol_p.
   (TARGET_CANNOT_FORCE_CONST_MEM): Define.
 * config/microblaze/microblaze.h (TLS_NEEDS_GOT): Define
   (PIC_OFFSET_TABLE_REGNUM): Set.
 * config/microblaze/linux.h (TLS_NEEDS_GOT): Define.
 * config/microblaze/microblaze.md (UNSPEC_TLS): Define.
   (addsi3, movsi_internal2, movdf_internal): Update constraints
 * config/microblaze/predicates.md (arith_plus_operand): Define
   (move_operand): Redefine as move_src_operand, check microblaze_tls_referenced_p.



Co-Authored-By: David Holsgrove <david.holsgrove@xilinx.com>

From-SVN: r196659
2013-03-14 15:43:23 +00:00
Jason Merrill a7137ee176 re PR c++/56614 (error: default argument 'std::vector<E>(std::initializer_list<E>{((const E*)(& ._0)), 1u}, (*(const std::allocator<E>*)(& std::allocator<E>())))' uses local variable '._0')
PR c++/56614
	* decl.c (local_variable_p_walkfn): Check DECL_ARTIFICIAL again.

From-SVN: r196658
2013-03-14 09:09:11 -04:00
Jason Merrill e9d5a271e5 re PR c++/56346 (FAIL: g++.dg/tls/thread_local3.C -std=gnu++11 (test for excess errors))
PR c++/56346
	* decl.c (register_dtor_fn): Pass null to __cxa_thread_atexit
	dso_handle parm on targets without __cxa_atexit.

From-SVN: r196657
2013-03-14 09:08:36 -04:00
Ian Bolton d803a4912e AArch64 should return CC_NZ for AND operation (part 2)
From-SVN: r196656
2013-03-14 12:04:26 +00:00
Jakub Jelinek 430b9e22a7 re PR tree-optimization/53265 (Warn when undefined behavior implies smaller iteration count)
PR tree-optimization/53265
	* gcc.dg/graphite/scop-3.c (toto): Increase array size to avoid
	undefined behavior.
	* gcc.dg/graphite/id-6.c (test): Likewise.
	* gcc.dg/graphite/pr35356-2.c: Adjust regexp patterns to only look for
	MIN_EXPR and MAX_EXPR in GIMPLE stmts.

From-SVN: r196655
2013-03-14 11:54:38 +01:00
Ian Bolton a8504f223d AArch64 should return CC_NZ for AND operation.
From-SVN: r196654
2013-03-14 10:48:51 +00:00
Jakub Jelinek fbd28bc3b2 re PR tree-optimization/53265 (Warn when undefined behavior implies smaller iteration count)
PR tree-optimization/53265
	* common.opt (Waggressive-loop-optimizations): New option.
	* tree-ssa-loop-niter.c: Include tree-pass.h.
	(do_warn_aggressive_loop_optimizations): New function.
	(record_estimate): Call it.  Don't add !is_exit bounds to loop->bounds
	if number_of_latch_executions returned constant.
	(estimate_numbers_of_iterations_loop): Call number_of_latch_executions
	early.  If number_of_latch_executions returned constant, set
	nb_iterations_upper_bound back to it.
	* cfgloop.h (struct loop): Add warned_aggressive_loop_optimizations
	field.
	* Makefile.in (tree-ssa-loop-niter.o): Depend on $(TREE_PASS_H).
	* doc/invoke.texi (-Wno-aggressive-loop-optimizations): Document.

	* gcc.dg/pr53265.c: New test.
	* gcc.dg/torture/pr49518.c: Add -Wno-aggressive-loop-optimizations
	to dg-options.
	* g++.dg/opt/longbranch2.C (EBCOTLut): Double sizes of a2 and a3
	arrays.
	* gcc.dg/tree-ssa/cunroll-10.c (main): Rename to foo.  Add argument
	n, use it as high bound instead of 4.

	* unwind-dw2.c (execute_cfa_program): Avoid
	-Waggressive-array-optimizations warnings for DW_CFA_GNU_window_save
	on targets with DWARF_FRAME_REGISTERS < 32.

	* testsuite/libmudflap.c/fail37-frag.c: Add optimization barrier.

From-SVN: r196650
2013-03-14 10:13:36 +01:00
Jakub Jelinek df2dfaea4e t-aarch64-linux (MULTARCH_DIRNAME): Remove.
* config/aarch64/t-aarch64-linux (MULTARCH_DIRNAME): Remove.
	(MULTILIB_OSDIRNAMES): Set.
	* genmultilib: If defaultosdirname doesn't start with :: , set
	defaultosdirname2 instead, clear it and emit two . multilib_raw
	entries instead of just one.

From-SVN: r196649
2013-03-14 09:52:13 +01:00
Benjamin Kosnik 10ace8a0cf *: Regenerate.
2013-03-13  Benjamin Kosnik  <bkoz@redhat.com>

	* doc/html/*: Regenerate.

From-SVN: r196647
2013-03-14 03:13:14 +00:00
Kaz Kojima ee0d2b6893 linux.h (TARGET_DEFAULT): Remove MASK_USERMODE.
* config/sh/linux.h (TARGET_DEFAULT): Remove MASK_USERMODE.
	(SUBTARGET_OVERRIDE_OPTIONS): Set TARGET_USERMODE as default.
	* config/sh/netbsd-elf.h (TARGET_DEFAULT): Remove MASK_USERMODE.
	(SUBTARGET_OVERRIDE_OPTIONS): New.

From-SVN: r196646
2013-03-14 03:01:53 +00:00
GCC Administrator 2d9aba16b3 Daily bump.
From-SVN: r196645
2013-03-14 00:17:54 +00:00
Andrew John Hughes cf7583edf2 Use pthread_equal rather than != to compare thread IDs.
2013-03-12  Andrew John Hughes  <gnu.andrew@redhat.com>

	* include/posix-threads.h:
	(_Jv_MutexCheckMonitor(_Jv_Mutex_t)): Use
	pthread_equal rather than !=.

From-SVN: r196639
2013-03-13 21:21:27 +00:00
Oleg Endo decc676eb5 re PR target/49880 (SuperH: ICE when -m4 is used with -mdiv=call-div1)
PR target/49880
	* config/sh/sh.opt (FPU_SINGLE_ONLY): New mask.
	(musermode): Convert to Var(TARGET_USERMODE).
	* config/sh/sh.h (SELECT_SH2A_SINGLE_ONLY, SELECT_SH4_SINGLE_ONLY,
	MASK_ARCH): Add MASK_FPU_SINGLE_ONLY.
	* config/sh/sh.c (sh_option_override): Use
	TARGET_FPU_DOUBLE || TARGET_FPU_SINGLE_ONLY for call-fp case.
	* config/sh/sh.md (udivsi3_i1, divsi3_i1): Remove ! TARGET_SH4
	condition.
	(udivsi3_i4, divsi3_i4): Use TARGET_FPU_DOUBLE condition instead of
	TARGET_SH4.
	(udivsi3_i4_single, divsi3_i4_single): Use
	TARGET_FPU_SINGLE_ONLY || TARGET_FPU_DOUBLE instead of TARGET_HARD_SH4.

	PR target/49880
	* config/sh/lib1funcs.S (sdivsi3_i4, udivsi3_i4): Enable for SH2A.
	(sdivsi3, udivsi3): Remove SH4 check and always compile these functions.

	PR target/49880
	* gcc.target/sh/pr49880-1.c: New.
	* gcc.target/sh/pr49880-2.c: New.
	* gcc.target/sh/pr49880-3.c: New.
	* gcc.target/sh/pr49880-4.c: New.
	* gcc.target/sh/pr49880-5.c: New.

From-SVN: r196636
2013-03-13 18:09:10 +00:00
Dave Korn f4b719c718 cygwin.h (SHARED_LIBGCC_SPEC): Make shared libgcc the default setting.
* config/i386/cygwin.h (SHARED_LIBGCC_SPEC): Make shared libgcc the
	default setting.

From-SVN: r196634
2013-03-13 15:17:54 +00:00