Commit Graph

143081 Commits

Author SHA1 Message Date
Bernd Edlinger
a20b66911f ipa-icf-gimple.c (func_checker::compare_gimple_asm): Add check for basic asm.
2015-12-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * ipa-icf-gimple.c (func_checker::compare_gimple_asm): Add check for
        basic asm.

From-SVN: r231369
2015-12-07 16:23:49 +00:00
Nathan Sidwell
51baf85ab6 nvptx.c (nvptx_output_call_insn): Emit trap after no return call.
gcc/
	* config/nvptx/nvptx.c (nvptx_output_call_insn): Emit trap after no
	return call.

	gcc/testsuite/
	* gcc.target/nvptx/abort.c: New.

From-SVN: r231368
2015-12-07 16:08:42 +00:00
David Malcolm
f79520bb11 Fix missing range information for "%q+D" format code
gcc/c-family/ChangeLog:
	* c-common.c (c_cpp_error): Update for change to
	rich_location::set_range.

gcc/fortran/ChangeLog:
	* error.c (gfc_format_decoder): Update for change of
	text_info::set_range to text_info::set_location.

gcc/ChangeLog:
	* pretty-print.c (text_info::set_range): Rename to...
	(text_info::set_location): ...this, converting 2nd param
	from source_range to a location_t.
	* pretty-print.h (text_info::set_location): Convert
	from inline function to external definition.
	(text_info::set_range): Delete.

gcc/testsuite/ChangeLog:
	* gcc.dg/diagnostic-ranges-1.c: New test file.
	* gcc.dg/plugin/diagnostic-test-show-locus-bw.c
	(test_percent_q_plus_d): New test function.
	* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
	(test_show_locus): Rewrite test code using
	rich_location::set_range.  Add code to unit-test the "%q+D"
	format code.

libcpp/ChangeLog:
	* include/line-map.h (rich_location::set_range): Add line_maps *
	param; convert param from source_range to source_location.  Drop
	"overwrite_loc_p" param.
	* line-map.c (rich_location::set_range): Likewise, acting as if
	"overwrite_loc_p" were true, and getting range from the location.

From-SVN: r231367
2015-12-07 16:07:00 +00:00
Martin Liska
4f6788a171 Fix changelog entry and add pr66896.C.
From-SVN: r231365
2015-12-07 15:35:25 +00:00
Dmitry Vyukov
f3d6b759e1 Fix new sancov tests
* gcc.dg/sancov/sancov.exp: Load asan-dg.exp.
	* gcc.dg/sancov/asan.c: Don't run when asan is not available.

From-SVN: r231364
2015-12-07 07:27:50 -08:00
Nathan Sidwell
fc0efeeab3 nvptx.c (nvptx_assemble_decl_begin): Look inside complex and vector types.
gcc/
	* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): Look inside
	complex and vector types.  Cope with packed structs.

	gcc/testsuite/
	* gcc.target/nvptx/decl-init.c: New.

From-SVN: r231362
2015-12-07 13:46:07 +00:00
Kirill Yukhin
09d4cbcde0 re PR target/68627 ([i386, AVX-512] Illegal insn generated while compiling spec2k6/437.leslie3d for KNL)
PR target/68627

gcc/
	* config/i386/sse.md: Make 'v' alternative work on 'avx512f' ISA only.
	Force destination to 512 bits register.
gcc/testsuite/
	* gfortran.dg/pr68627.f: New test.

From-SVN: r231361
2015-12-07 11:12:41 +00:00
Kirill Yukhin
7604791b48 Commit accidentally forgotten tests.
gcc/testsuite/
	* c-c++-common/attr-simd-4.c: New test.
	* c-c++-common/attr-simd-5.c: New test.

From-SVN: r231360
2015-12-07 11:06:44 +00:00
Kirill Yukhin
fc2e8e423f re PR target/68633 ([i386, AVX-512] Spec2006/434.zeus miscompares when executed on KNL)
PR target/68633

gcc/
	* config/i386/sse.md (define_insn "kunpckhi"): Fix operands order.
	(define_insn "kunpcksi"): Ditto.
	(define_insn "kunpckdi"): Ditto.
gcc/testsuite
	* gcc.target/i386/pr68633.c: New test.

From-SVN: r231359
2015-12-07 11:05:40 +00:00
Jason Merrill
1bf2ca0b75 Fix parse/no-type-defn1.C with -std=c++1z.
* parser.c (struct tentative_firewall): New.
	(cp_parser_template_id, cp_parser_decltype_expr): Use it.

From-SVN: r231354
2015-12-06 23:35:14 -05:00
Jason Merrill
ca8e4b87ad Fix decltype-call1.C with -std=c++1z.
* parser.h (struct cp_token): Tell GTY that CPP_DECLTYPE uses
	tree_check_value.
	* parser.c (cp_parser_decltype): Use tree_check_value.
	(saved_checks_value): New.
	(cp_parser_nested_name_specifier_opt): Use it.
	(cp_parser_template_id): Use it.
	(cp_parser_simple_type_specifier): Use it.
	(cp_parser_pre_parsed_nested_name_specifier): Use it.

From-SVN: r231353
2015-12-06 23:35:08 -05:00
Jason Merrill
5ea106d85b Fix crash70.C with -std=c++1z.
* semantics.c (finish_qualified_id_expr): Handle
	UNBOUND_CLASS_TEMPLATE.

From-SVN: r231352
2015-12-06 23:35:02 -05:00
Jason Merrill
19dedccfc3 Fix template/ref1.C, nontype15.C, addr-builtin1.C with -std=c++1z.
* parser.c (cp_parser_template_argument): Handle references in
	C++1z mode.
	* constexpr.c (potential_constant_expression_1): Don't error about
	TREE_THIS_VOLATILE on declarations.
	[COMPONENT_REF]: Don't consider the object if we're dealing with an
	overloaded function.

From-SVN: r231351
2015-12-06 23:34:57 -05:00
Jason Merrill
aabdb83166 Fix memclass5.C, memfriend10.C, var-templ19.C with -std=c++1z.
* constraint.cc (strictly_subsumes): New.
	* cp-tree.h: Declare it.
	* pt.c (process_partial_specialization): Use it instead of
	subsumes_constraints.
	(maybe_new_partial_specialization): Do compare null constraints.
	* search.c (lookup_member): Handle currently_open_class returning null.

From-SVN: r231350
2015-12-06 23:34:51 -05:00
Jason Merrill
5dc5804917 PR c++/68597, fix auto9.C and auto-neg1.C with -std=c++1z.
* decl.c (check_tag_decl): Use ds_type_spec in auto diagnostic.
	* typeck.c (check_return_expr): Check for inconsistent deduction.
	* parser.c (class type_id_in_expr_sentinel): New.
	(cp_parser_primary_expression) [RID_VA_ARG]: Use it.
	(cp_parser_new_expression): Use it.
	(cp_parser_trait_expr): Use it.
	(cp_parser_type_id_1): Complain about auto if in_type_id_in_expr_p.
	(cp_parser_default_type_template_argument): Check for auto.
	(cp_parser_type_id_list): Likewise.
	(cp_parser_simple_type_specifier): Allow auto parms if flag_concepts.
	* pt.c (do_auto_deduction): Handle erroneous type.

From-SVN: r231349
2015-12-06 23:34:43 -05:00
Jason Merrill
adcef27430 static_assert8.C: Fix for -std=c++1z.
* g++.dg/cpp0x/static_assert8.C: Fix for -std=c++1z.
	* g++.dg/cpp0x/auto3.C: Fix for -std=c++1z.
	* g++.dg/cpp1y/feat-cxx14.C: Only run with -std=c++14.
	* g++.dg/cpp1y/feat-cxx14-neg.C: Only run with -std=c++14.
	* g++.dg/cpp1z/feat-cxx1z.C: Fill in from feat-cxx14.C.
	* g++.dg/cpp1z/fold5.C: Don't run with -std=c++1z.
	* g++.dg/template/function1.C: Don't run with -std=c++1z.
	* g++.dg/template/call4.C: Fix access.
	* g++.dg/parse/crash31.C: Remove expected error text.

From-SVN: r231348
2015-12-06 23:34:36 -05:00
GCC Administrator
c5d0746fad Daily bump.
From-SVN: r231347
2015-12-07 00:16:12 +00:00
Kaz Kojima
c37175df1c sh.md (rsqrtsf2): Adjust for the recent rsqrt_optab changes
* config/sh/sh.md (rsqrtsf2): Adjust for the recent rsqrt_optab changes

From-SVN: r231344
2015-12-07 00:02:14 +00:00
Piotr Trojanek
8b1cbdab73 re PR ada/60164 (Missing parenthesis in the documentation)
PR ada/60164
	* doc/gnat_ugn/gnat_and_program_execution.rst (gnatmem): Fix typo.

From-SVN: r231342
2015-12-06 18:53:37 +00:00
Eric Botcazou
e4b2093f3c re PR ada/50048 ("cc1: note: obsolete option -I- used, please use -iquote instead" during bootstrap)
gnattools/
	PR ada/50048
	* Makefile.in (ftop_srcdir): New variable.
	(INCLUDES_FOR_SUBDIR): Use -iquote and $(ftop_srcdir).
gcc/ada/
	PR ada/50048
	* gcc-interface/Makefile.in (INCLUDES): Use -iquote.

From-SVN: r231341
2015-12-06 18:44:56 +00:00
Victoria Stepanyan
62e56a0d65 support for AMD clzero isa.
gcc/ChangeLog
2015-12-06  Victoria Stepanyan  <victoria.stepanyan@amd.com>

        * common/config/i386/i386-common.c
        (OPTION_MASK_ISA_CLZERO_SET): New.
        (ix86_handle_option): Handle clzero.
        * config.gcc (i[34567]86-*-*): Add clzerointrin.h,
        (x86_64-*-*): Likewise.
        * config/i386/clzerointrin.h: New header.
        * config/i386/cpuid.h (bit_CLZERO):  Define.
        * config/i386/driver-i386.c (host_detect_local_cpu): Detect
        CLZERO support.
        * config/i386/i386.opt (clzero): New.
        * config/i386/i386-c.c: Define __CLZERO__ if needed.
        * config/i386/i386.c (ix86_target_string): Define -mclzero option.
        (PTA_CLZERO): New.
        (ix86_option_override_internal): Handle new option.
        (processor_alias_table): Added PTA_CLZERO.
        (ix86_valid_target_attribute_inner_p): Add OPT_mclzero.
        (ix86_builtins): Add IX86_BUILTIN_CLZERO, IX86_BUILTIN_CLZERO.
        (ix86_expand_builtin): Handle IX86_BUILTIN_CLZERO and
        IX86_BUILTIN_CLZERO  built-ins.
        * config/i386/i386.h (TARGET_CLZERO):  New.
        * config/i386/i386.md (unspecv): Add UNSPEC_CLZERO.
        (clzero):  New pattern.
        (clzero_<mode>): New pattern.
        * config/i386/x86intrin.h: Include clzerointrin.h.
        * doc/extend.texi: Document clzero builtins.
        * doc/invoke.texi: Document -mclzero option.

gcc/testsuite/ChangeLog
2015-12-06  Victoria Stepanyan  <victoria.stepanyan@amd.com>

        * gcc.target/i386/clzero.c: New.
        * gcc.target/i386/sse-12.c: Add -mclzero.
        * gcc.target/i386/sse-13.c: Ditto.
        * gcc.target/i386/sse-14.c: Ditto.
        * gcc.target/i386/sse-22.c: Ditto.
        * gcc.target/i386/sse-23.c: Ditto.
        * g++.dg/other/i386-2.C: Ditto.
        * g++.dg/other/i386-3.C: Ditto.

From-SVN: r231340
2015-12-06 17:02:48 +00:00
Eric Botcazou
2097a8906f re PR ada/56274 (libada bootstrap failure on kfreebsd ("pthread_rwlock_t" not declared in "OS_Interface"))
PR ada/56274
	* s-osinte-kfreebsd-gnu.ads (pthread_rwlock_t): New subtype.
	(pthread_rwlockattr_t): Likewise.

From-SVN: r231337
2015-12-06 15:28:16 +00:00
Ludovic Brenta
928b5b523b re PR ada/49944 (Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:856:10: "pthread_attr_setaffinity_np" is undefined (more references follow)")
PR ada/49944
	* s-osinte-freebsd.ads: Minor reformatting.
	(Stack_Base_Available): Correct comments.
	* s-osinte-kfreebsd-gnu.ads (Time_Slice_Supported, nanosleep,
	clock_id_t, clock_gettime, Stack_Base_Available, Get_Page_Size,
	mprotect, pthread_mutexattr_setprotocol,pthread_mutexattr_getprotocol
	pthread_mutexattr_setprioceiling, pthread_mutexattr_getprioceiling,
	pthread_attr_setscope, pthread_attr_getscope,
	pthread_attr_setinheritsched, pthread_attr_getinheritsched,
	Time_Slice_Supported): Copy from s-osinte-freebsd.ads.
	* gcc-interface/Makefile.in (x86/kfreebsd): Use the POSIX version of
	the System.Task_Primitives.Operations package.

From-SVN: r231333
2015-12-06 14:11:17 +00:00
Ludovic Brenta
f1b7620802 re PR ada/49940 (Bootstrapping on x86_64-pc-kfreebsd-gnu fails with "s-taprop.adb:717:32: "lwp_self" is undefined")
PR ada/49940
	* s-osinte-kfreebsd-gnu.ads (lwp_self): New imported function.

From-SVN: r231330
2015-12-06 14:00:16 +00:00
Tobias Burnus
f78590bb4c download_prerequisites: Download ISL 0.15 instead of 0.14.
2015-12-06  Tobias Burnus  <burnus@net-b.de>

        * download_prerequisites: Download ISL 0.15 instead of 0.14.

From-SVN: r231329
2015-12-06 11:42:49 +01:00
Jan Hubicka
e9e707983b * ipa-icf.c (sem_function::merge): Check that local_original exists.
From-SVN: r231328
2015-12-06 05:45:16 +00:00
GCC Administrator
c7eea75bf8 Daily bump.
From-SVN: r231326
2015-12-06 00:16:12 +00:00
Juoko Orava
9df47e83ee re PR fortran/50201 (gfortran with -static causes seg fault at runtime for writing double prec array with precision increased to kind=16)
2015-12-05  Juoko Orava <jouko.orava@iki.fi>

	PR fortran/50201
	* io/write_float.def: Avoid marking quadmath_snprintf as an untyped
	weak reference, which fixing linking with -static.

From-SVN: r231320
2015-12-05 18:12:26 +00:00
Paul Thomas
e9d9b48ddb re PR fortran/68676 (ICE in gfc_match_formal_arglist when compiling gfortran.dg/submodule_10.f08)
2015-12-05  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/68676
	* decl.c (gfc_match_formal_arglist): Correct error, where 'sym'
	was used instead of 'progname'.

From-SVN: r231319
2015-12-05 17:10:33 +00:00
David Edelsohn
a5bdd742c7 * gcc.target/powerpc/recip-sqrtf.c: New test.
From-SVN: r231318
2015-12-05 07:55:43 -05:00
David Edelsohn
4f0055bd4e re PR target/68609 (PowerPC reciprocal estimate missed opportunities)
PR target/68609
        * config/rs6000/rs6000-protos.h (rs6000_emit_swsqrt): Rename and add
        bool arguement.
        * config/rs6000/rs6000.c (rs6000_emit_swsqrt): Rename. Add
        non-reciporcal path.
        * config/rs6000/rs6000.md (rsqrt<mode>2): Call new function name.
        (sqrt<mode>2): Replace define_insn with define_expand that may call
        rs6000_emit_swsqrt.

From-SVN: r231317
2015-12-05 07:53:45 -05:00
GCC Administrator
5169d82c38 Daily bump.
From-SVN: r231314
2015-12-05 00:16:11 +00:00
Aditya Kumar
e7b9f15315 check that all the scev applied ops have are dominated by their defs
2015-12-02  Aditya Kumar  <aditya.k7@samsung.com>
	    Sebastian Pop  <s.pop@samsung.com>

        * gcc.dg/graphite/id-29.c: New test.

gcc/ChangeLog:

2015-12-02  Aditya Kumar  <aditya.k7@samsung.com>
	    Sebastian Pop  <s.pop@samsung.com>

        * graphite-isl-ast-to-gimple.c (translate_isl_ast_node_user): Improve debug.
        (get_rename_from_scev): Check that all the ops in an expression have their uses dominated by corresponding defs.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r231310
2015-12-04 21:38:56 +00:00
Aditya Kumar
15256e28a5 fix PR68693: Check for loop structure when extending the SCoP
The check for dominance while extending the scop assumed that
multiple successors meant a loop which is not true in case of
conditionals around the loop.

Improved pretty printers for better debugging.

	PR tree-optimization/68693
        * graphite-scop-detection.c (dot_all_sese): New
        (dot_all_scops_1): Renamed to dot_all_sese.
        (dot_all_scops): Removed.
        (dot_sese): New.
        (dot_cfg): New.
        (scop_detection::get_nearest_dom_with_single_entry): Check that preds are from different loop levels.
        (scop_detection::get_nearest_pdom_with_single_exit): Check that succs are from different loop levels.
        (scop_detection::print_sese): Inlined.
        (scop_detection::print_edge): New.
        (scop_detection::merge_sese): Added dumps.
        * graphite.h: Add declarations.

gcc/testsuite/ChangeLog:

        * gfortran.dg/graphite/pr68693.f90: New test.

Co-Authored-By: Sebastian Pop <s.pop@samsung.com>

From-SVN: r231309
2015-12-04 21:36:55 +00:00
James Greenhalgh
bdf5848047 [AArch64] Add register constraints to add<mode>3_pluslong
gcc/

2015-12-04  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/aarch64/aarch64.md (add<mode>3_pluslong): Add register
	constraints.

gcc/testsuite/

2015-12-04  James Greenhalgh  <james.greenhalgh@arm.com>

	* gcc.c-torture/compile/20151204.c: New.

From-SVN: r231304
2015-12-04 20:02:56 +00:00
Nathan Sidwell
2331aa0069 * gcc.dg/vla-24.c: Requires alloca.
From-SVN: r231303
2015-12-04 19:58:43 +00:00
Vladimir Makarov
18c8f1a812 re PR rtl-optimization/68349 (ice in decompose_normal_address with -O2 at rtlanal.c:6086)
2015-12-04  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/68349
	* lra-eliminations.c (move_plus_up): New function.
	(lra_eliminate_regs_1): Use the function.

2015-12-04  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/68349
	* gcc.target/i386/pr68349.c: New test.

From-SVN: r231300
2015-12-04 19:23:21 +00:00
Nathan Sidwell
4ff3145ae1 nvptx.c (nvptx_assemble_decl_begin): New, replacing ...
gcc/
	* config/nvptx/nvptx.c (nvptx_assemble_decl_begin): New,
	replacing ...
	(init_output_initializer): ... this.
	(nvptx_output_aligned_decl, nvptx_asm_declare_constant_name,
	nvptx_declare_object_name, nvptx_assemble_undefined_decl): Use
	nvptx_assemble_decl_begin.

	gcc/testsuite/
	* gcc.target/nvptx/ary-init.c: New.

From-SVN: r231298
2015-12-04 18:41:46 +00:00
Dmitry Vyukov
95e7bbb8d6 Add fuzzing coverage support
* sancov.c: New file.
	* Makefile.in (OBJS): Add sancov.o.
	* invoke.texi (-fsanitize-coverage=trace-pc): Describe.
	* passes.def (sancov_pass): Add.
	* tree-pass.h  (sancov_pass): Add.
	* common.opt (-fsanitize-coverage=trace-pc): Add.
	* sanitizer.def (BUILT_IN_SANITIZER_COV_TRACE_PC): Add.
	* builtins.def (DEF_SANITIZER_BUILTIN): Enable for
	flag_sanitize_coverage.

From-SVN: r231296
2015-12-04 10:27:54 -08:00
Eric Botcazou
f58101cf28 re PR middle-end/65958 (-fstack-check breaks alloca on architectures using generic stack checking)
PR middle-end/65958
	* config/arm/unspecs.md (unspec): Remove UNSPEC_PROBE_STACK_RANGE.
	(unspecv): Add VUNSPEC_PROBE_STACK_RANGE.
	* config/arm/arm.md (probe_stack_range): Adjust.
	* config/aarch64/aarch64.md (unspec): Remove UNSPEC_PROBE_STACK_RANGE.
	(unspecv): Add UNSPECV_PROBE_STACK_RANGE.
	(probe_stack_range_<PTR:mode>): Adjust.

From-SVN: r231295
2015-12-04 18:25:54 +00:00
Jason Merrill
f0a7c00bfe re PR c++/68645 (FAIL: c-c++-common/attr-simd-3.c -std=gnu++11 (test for excess errors))
PR c++/68645
	* parser.c (cp_parser_direct_declarator)
	(cp_parser_late_return_type_opt): Put Cilk+ attributes on
	declarator->attributes, not std_attributes.

From-SVN: r231294
2015-12-04 13:18:27 -05:00
David Malcolm
e87eed2a9c C++ FE: expression ranges
gcc/ChangeLog:
	* convert.c (convert_to_real_1): When converting from a
	REAL_TYPE, preserve the location of EXPR in the result.
	* tree.c (get_pure_location): Make non-static.
	(set_source_range): Return the resulting location_t.
	(make_location): New function.
	* tree.h (get_pure_location): New decl.
	(get_finish): New inline function.
	(set_source_range): Convert return type from void to location_t.
	(make_location): New decl.

gcc/cp/ChangeLog:
	* cp-tree.h (class cp_expr): New class.
	(finish_parenthesized_expr): Convert return type and param to
	cp_expr.
	(perform_koenig_lookup): Convert return type and param from tree
	to cp_expr.
	(finish_increment_expr): Likewise.
	(finish_unary_op_expr): Likewise.
	(finish_id_expression): Likewise for return type.
	(build_class_member_access_expr): Likewise for param.
	(finish_class_member_access_expr): Likewise.
	(build_x_unary_op): Likewise.
	(build_c_cast): New decl.
	(build_x_modify_expr): Convert return type from tree to cp_expr.
	* cvt.c (cp_convert_and_check): When warning about conversions,
	attempt to use the location of "expr" if available, otherwise
	falling back to the old behavior of using input_location.
	* name-lookup.c (lookup_arg_dependent_1): Convert return type from
	tree to cp_expr.
	(lookup_arg_dependent): Likewise; also for local "ret".
	* name-lookup.h (lookup_arg_dependent): Likewise for return type.
	* parser.c (cp_lexer_previous_token): Skip past purged tokens.
	(struct cp_parser_expression_stack_entry): Convert field "lhs" to
	cp_expr.
	(cp_parser_identifier): Likewise for return type.  Use cp_expr
	ctor to preserve the token's location.
	(cp_parser_string_literal): Likewise, building up a meaningful
	location for the case where a compound string literal is built by
	concatentation.
	(cp_parser_userdef_char_literal): Likewise for return type.
	(cp_parser_userdef_numeric_literal): Likewise.
	(cp_parser_statement_expr): Convert return type to cp_expr.
	Generate a suitable location for the expr and return it via the
	cp_expr ctor.
	(cp_parser_fold_expression): Convert return type to cp_expr.
	(cp_parser_primary_expression): Likewise, and for locals "expr",
	"lam", "id_expression", "decl".
	Use cp_expr ctor when parsing literals, to preserve the spelling
	location of the token.  Preserve the locations of parentheses.
	Preserve location when calling objc_lookup_ivar.
	Preserve the location for "this" tokens.  Generate suitable
	locations for "__builtin_va_arg" constructs and for
	Objective C 2.0 dot-syntax.  Set the location for the result of
	finish_id_expression.
	(cp_parser_primary_expression): Convert return type from tree to
	cp_expr.
	(cp_parser_id_expression): Likewise.
	(cp_parser_unqualified_id): Likewise.  Also for local "id".
	(cp_parser_postfix_expression): Likewise, also for local
	"postfix_expression".  Generate suitable locations for
	C++-style casts, "_Cilk_spawn" constructs.  Convert local
	"initializer" to cp_expr and use it to preserve the location of
	compound literals.  Capture the location of the closing
	parenthesis of a call site via
	cp_parser_parenthesized_expression_list, and use it to build
	a source range for a call.  Use cp_expr in ternary expression.
	(cp_parser_postfix_dot_deref_expression): Convert param from tree to
	cp_expr.  Generate and set a location.
	(cp_parser_parenthesized_expression_list): Add "close_paren_loc"
	out-param, and write back to it.
	(cp_parser_unary_expression): Convert return type from tree to
	cp_expr.  Also for locals "cast_expression" and "expression".
	Generate and use suitable locations for addresses of
	labels and for cast expressions.  Call cp_expr::set_location where
	necessary.  Preserve the locations of negated numeric literals.
	(cp_parser_new_expression): Generate meaningful locations/ranges.
	(cp_parser_cast_expression): Convert return type from tree to
	cp_expr; also for local "expr".  Use the paren location to generate a
	meaningful range for the expression.
	(cp_parser_binary_expression): Convert return type from tree to
	cp_expr; also for local "rhs".  Generate a meaningful location
	for the expression, and use it.  Replace call to
	protected_set_expr_location by converting a build2 to a build2_loc
	and using the location in the call to build_x_binary_op, adding a
	cp_expr::set_location to the latter case.
	(cp_parser_question_colon_clause): Convert param from tree to
	cp_expr; also for local "assignment_expr".  Set the spelling range
	of the expression.
	(cp_parser_assignment_expression): Likewise for return type and
	locals "expr" and "rhs".  Build a meaningful spelling range for
	the expression.  Remove saving of input_location in favor of a
	call to cp_expr::set_location.
	(cp_parser_expression): Convert return type and locals
	"expression" and "assignment_expression" to cp_expr.  Build a
	meaningful spelling range for assignment expressions.
	(cp_parser_constant_expression): Likewise for return type and
	local "expression".
	(cp_parser_builtin_offsetof): Convert return type and local "expr"
	to cp_expr.  Generate suitable locations.
	(cp_parser_lambda_expression): Convert return return type to
	cp_expr.
	(cp_parser_operator_function_id): Likewise.
	(cp_parser_operator): Likewise.  Generate a meaningful range,
	using cp_expr's ctor to return it.
	(cp_parser_template_id): When converting a token to
	CPP_TEMPLATE_ID, update the location.
	(cp_parser_initializer_clause): Convert return type and local
	"initializer" to cp_expr.
	(cp_parser_braced_list): Likewise for return type.  Generate
	suitable locations.
	(cp_parser_lookup_name): Likewise for return type.  Use cp_expr's
	ctor to preserve the location_t of the name.
	(cp_parser_simple_cast_expression): Likewise for return type.
	(cp_parser_functional_cast): Convert return type and local "cast"
	to cp_expr.  Generate suitable locations.
	(cp_parser_objc_expression): Convert return type to cp_expr.k  Generate
	(cp_parser_objc_message_expression): Generate suitable locations.
	(cp_parser_objc_encode_expression): Convert return type to
	cp_expr.  Generate suitable locations.
	(cp_parser_objc_protocol_expression): Generate suitable locations.
	(cp_parser_objc_selector_expression): Generate suitable locations.
	(cp_parser_omp_for_cond): Attempt to use the location
	of "cond" for the binary op.
	(cp_parser_transaction_expression): Issue the tm-not-enabled error
	at the location of the __transaction_foo token, rather than at
	input_location.
	* semantics.c (finish_parenthesized_expr): Convert return type and
	param to cp_expr.  Preserve location.
	(perform_koenig_lookup): Likewise for return type
	and param.
	(finish_increment_expr): Likewise.  Generate suitable locations.
	(finish_unary_op_expr): Likewise for return type and local "result".
	Generate suitable locations.
	(finish_id_expression): Convert return type to cp_expr and use
	cp_expr ctor to preserve location information.
	* typeck.c (build_class_member_access_expr): Convert param to
	cp_expr.
	(finish_class_member_access_expr): Likewise.
	(cp_build_binary_op): Convert a build2 to a build2_loc.
	(build_x_unary_op): Convert param from tree to cp_expr.
	(build_nop): Preserve the location of EXPR.
	(build_c_cast): Provide an overloaded variant that takes a cp_expr
	and returns a cp_expr.
	(build_x_modify_expr): Convert return type from tree to cp_expr.

gcc/testsuite/ChangeLog:
	* g++.dg/cpp0x/nsdmi-template14.C: Move dg-error directive.
	* g++.dg/gomp/loop-1.C: Update dg-error locations.
	* g++.dg/plugin/diagnostic-test-expressions-1.C: New file, adapted
	from gcc.dg/plugin/diagnostic-test-expressions-1.c.
	* g++.dg/plugin/plugin.exp (plugin_test_list): Add the above.
	* g++.dg/template/crash55.C: Update dg-error directives.
	* g++.dg/template/pseudodtor3.C: Update column numbers in dg-error
	directives.
	* g++.dg/template/pr64100.C: Update location of dg-error
	directive.
	* g++.dg/template/ref3.C: Add XFAIL (PR c++/68699).
	* g++.dg/ubsan/pr63956.C: Update dg directives to reflect
	improved location information.
	* g++.dg/warn/pr35635.C (func3): Update location of a
	dg-warning.
	* g++.dg/warn/Wconversion-real-integer2.C: Update location of
	dg-warning; add a dg-message.
	* obj-c++.dg/plugin/diagnostic-test-expressions-1.mm: New file,
	based on objc.dg/plugin/diagnostic-test-expressions-1.m.
	* obj-c++.dg/plugin/plugin.exp: New file, based on
	objc.dg/plugin/plugin.exp.

From-SVN: r231293
2015-12-04 18:09:54 +00:00
Jakub Jelinek
b3d5bc621f re PR middle-end/68656 (warning about disabled var-tracking uses odd location info)
PR c/68656
	* toplev.c (init_asm_output): Pass UNKNOWN_LOCATION instead of
	input_location to inform.
	(process_options): Use warning_at (UNKNOWN_LOCATION instead of
	warning ( and error_at (UNKNOWN_LOCATION instead of error (.
	Pass UNKNOWN_LOCATION instead of input_location to fatal_error.

	* gcc.target/i386/pr65044.c: Expect error on line 0 rather than
	line 1.
	* g++.dg/opt/pr34036.C: Expect warning on line 0 rather than line 1.
	* gcc.dg/tree-ssa/pr23109.c: Likewise.
	* gcc.dg/tree-ssa/recip-5.c: Likewise.
	* gcc.dg/pr33007.c: Likewise.

From-SVN: r231292
2015-12-04 19:04:06 +01:00
Jan Hubicka
88636b62bc * ipa-inline.c (can_inline_edge_p) Use merged_comdat.
* cgraphclones.c (cgraph_node::create_clone): Use merged_comdat.
	* cgraph.c (cgraph_node::dump): Dump merged_comdat.
	* ipa-icf.c (sem_function::merge): Drop merged_comdat when merging
	comdat and non-comdat.
	* cgraph.h (cgraph_node): Rename merged to merged_comdat.
	* ipa-inline-analysis.c (simple_edge_hints): Check both merged_comdat
	and icf_merged.

	* lto-symtab.c (lto_cgraph_replace_node): Update code computing
	merged_comdat.

From-SVN: r231291
2015-12-04 18:02:26 +00:00
Paolo Bonzini
c5404f1c2f c-common.c (maybe_warn_shift_overflow): Warn on all overflows if shifting 1 out of the sign bit.
gcc:
2015-12-04  Paolo Bonzini  <bonzini@gnu.org>

	* c-family/c-common.c (maybe_warn_shift_overflow): Warn on all
	overflows if shifting 1 out of the sign bit.

gcc/testsuite:
2015-12-04  Paolo Bonzini  <bonzini@gnu.org>

	* c-c++-common/Wshift-overflow-1.c: Test shifting 1 out of the sign bit.
	* c-c++-common/Wshift-overflow-2.c: Test shifting 1 out of the sign bit.
	* c-c++-common/Wshift-overflow-3.c: Test shifting 1 out of the sign bit.
	* c-c++-common/Wshift-overflow-4.c: Test shifting 1 out of the sign bit.
	* c-c++-common/Wshift-overflow-6.c: Test shifting 1 out of the sign bit.
	* c-c++-common/Wshift-overflow-7.c: Test shifting 1 out of the sign bit.

From-SVN: r231290
2015-12-04 17:43:53 +00:00
Jonathan Wakely
755be51d02 PR libstdc++/57060 cope with invalid thread IDs
PR libstdc++/57060
	* include/std/thread (operator==(thread::id, thread::id)): Do not use
	__gthread_equal.
	(operator<(thread::id, thread::id)): Add comment.
	(this_thread::get_id()): Do not use __gthread_self for single-threaded
	programs using glibc.
	* testsuite/30_threads/this_thread/57060.cc: New.

From-SVN: r231289
2015-12-04 17:32:40 +00:00
Segher Boessenkool
586cdac8e5 rs6000: Clean up the cstore code a bit
"register_operand" was a bit confusing.  Also some other minor cleanups.


	* (cstore<mode>4_unsigned): Use gpc_reg_operand instead of
	register_operand.  Remove empty constraints.  Use std::swap.
	(cstore_si_as_di, cstore<mode>4_signed_imm,
	cstore<mode>4_unsigned_imm, cstore<mode>4 for GPR): Use
	gpc_reg_operand instead of register_operand.
	(cstore<mode>4 for FP): Use gpc_reg_operand instead of
	register_operand.  Remove empty constraints.

From-SVN: r231287
2015-12-04 18:28:54 +01:00
Nick Clifton
04a9ae287f gcc * config.gcc (extra_gcc_objs): Define for MSP430.
* common/config/msp430/msp430-common.c (msp430_handle_option):
	Pass both -mmcu and -mcpu on to the back end if they are both
	defined.
	* config/msp430/msp430.c (hwmult_name): New function.
        (msp430_option_override): If an unrecognised MCU name is
	detected only warn if the user has not provided suitable
        -mhwmult and -mcpu options.  Use msp430_warn_mcu to control
	warning messages.  Generate warnings about conflicts between
	-mmcu and -mcpu and -mhwmult options. 
	If neither -mcpu nor -mmcu have been specified but -mhwmult=
	f5series has the select the 430X isa.
	(msp430_no_hwmult): If -mmcu has not been specified and
	msp430_hwmult_type is AUTO then return true.
	* config/msp430/msp430.h (EXTRA_SPEC_FUNCTIONS): Define.
	(LIB_SPEC): Add hardware multiply library selection.
	* config/msp430/t-msp430: Delete hardware multiply multilibs.
	Add rule to build driver-msp430.o
	* config/msp430/driver-msp430.c: New file.
	* config/msp430/msp430.opt (warn-mcu): New option.
	* doc/invoke.texi: Update description of -mhwmult=auto.
        Document -mwarn-mcu option.

tests	* gcc.target/msp430/msp_abi_div_funcs.c: New test.
	* gcc.target/msp430/mul_main.h: New test support file.
	* gcc.target/msp430/mul_none.c: New test.
	* gcc.target/msp430/mul_16bit.c: New test.
	* gcc.target/msp430/mul_32bit.c: New test.
	* gcc.target/msp430/mul_f5.c: New test.

libgcc	* config/msp430/mpy.c (__mulhi3): Use a faster algorithm.
	Allow for the second argument being negative.
	* config.host (extra_parts): Define for MSP430.  Create separate
	libraries for each of the hardware multiply formats.
	* config/msp430/lib2hw_mul.S: Build only the multiply routines
	that are needed.
	* config/msp430/lib2mul.c: Likewise.
	* config/msp430/t-msp430 (LIB2ADD): Remove lib2hw_mul.S.
	Add rules to build hardware multiply libraries.
	* config/msp430/lib2divSI.c: (__mspabi_divlu): Alias for
	__mspabi_divul function.
	(__mspabi_divllu): New stub function.

From-SVN: r231286
2015-12-04 17:24:30 +00:00
Segher Boessenkool
4b5d538ba7 I really do hate this keyboard.
From-SVN: r231285
2015-12-04 18:22:38 +01:00
Segher Boessenkool
2f74c72b13 rs6000: Implement cstore for signed Pmode register compares
This implements cstore for the last case we do not yet handle, using
the superopt algo from the venerable CWG.  The only integer cases we
do still not handle after this are for -m32 -mpowerpc64.


	* (cstore<mode>4_signed): New expander.
	(cstore<mode>4): Call it.

From-SVN: r231284
2015-12-04 18:21:49 +01:00