Commit Graph

160324 Commits

Author SHA1 Message Date
Jakub Jelinek ae6dca8c65 re PR target/84945 (UBSAN: gcc/config/i386/i386.c:33312:22: runtime error: shift exponent 32 is too large for 32-bit type 'int')
PR target/84945
	* config/i386/i386.c (fold_builtin_cpu): For features above 31
	use __cpu_features2 variable instead of __cpu_model.__cpu_features[0].
	Use 1U instead of 1.  Formatting fixes.

	* gcc.target/i386/pr84945.c: New test.

	* config/i386/cpuinfo.h (__cpu_features2): Declare.
	* config/i386/cpuinfo.c (__cpu_features2): New variable for
	ifndef SHARED only.
	(set_feature): Define.
	(get_available_features): Use set_feature macro.  Set __cpu_features2
	to the second word of features ifndef SHARED.

From-SVN: r258673
2018-03-20 09:14:42 +01:00
Christophe Lyon 18c5bc3f90 PR target/81647: Fix testcase.
2018-03-20  Christophe Lyon  <christophe.lyon@linaro.org>

	PR target/81647
	* gcc.target/aarch64/pr81647.c: Require fenv_exceptions.

From-SVN: r258672
2018-03-20 09:11:35 +01:00
Jakub Jelinek a8ed1cbd67 re PR c/84953 (misleading warning from strpbrk(x,""))
PR c/84953
	* builtins.c (fold_builtin_strpbrk): For strpbrk(x, "") use type
	instead of TREE_TYPE (s1) for the return value.

	* gcc.dg/pr84953.c: New test.

From-SVN: r258671
2018-03-20 08:55:41 +01:00
GCC Administrator d2a1b11e65 Daily bump.
From-SVN: r258670
2018-03-20 00:16:14 +00:00
Jakub Jelinek f87b4b2fbf re PR tree-optimization/84946 (UBSAN: in mem_valid_for_store_merging ../../gcc/gimple-ssa-store-merging.c:3951)
PR tree-optimization/84946
	* gimple-ssa-store-merging.c (mem_valid_for_store_merging): Compute
	bitsize + bitsize in poly_uint64 rather than poly_int64.

From-SVN: r258665
2018-03-19 21:49:57 +01:00
Jakub Jelinek 90841d4302 re PR sanitizer/78651 (Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active)
PR sanitizer/78651
	* dwarf2asm.c: Include fold-const.c.
	(dw2_output_indirect_constant_1): Set DECL_INITIAL (decl) to ADDR_EXPR
	of decl rather than decl itself.

From-SVN: r258664
2018-03-19 21:48:39 +01:00
Jakub Jelinek 359ea407e9 re PR sanitizer/84761 (AddressSanitizer is not compatible with glibc 2.27 on x86)
PR sanitizer/84761
	* sanitizer_common/sanitizer_linux_libcdep.cc (__GLIBC_PREREQ):
	Define if not defined.
	(DL_INTERNAL_FUNCTION): Don't define.
	(InitTlsSize): For __i386__ if not compiled against glibc 2.27+
	determine at runtime whether to use regparm(3), stdcall calling
	convention for older glibcs or normal calling convention for
	newer glibcs for call to _dl_get_tls_static_info.

From-SVN: r258663
2018-03-19 21:47:29 +01:00
Jakub Jelinek 42f8338d59 re PR rtl-optimization/84643 (gcc/optabs.c:6549:26: runtime error: load of value 131075, which is not a valid value for type 'memmodel')
PR rtl-optimization/84643
	* memmodel.h (enum memmodel): Add MEMMODEL_MAX enumerator.

From-SVN: r258662
2018-03-19 21:46:23 +01:00
Marek Polacek ac9ec1988a re PR c++/84927 (ICE with NSDMI and reference)
PR c++/84927
	* constexpr.c (cxx_eval_bare_aggregate): Update constructor's flags
	as we evaluate the elements.
	(cxx_eval_constant_expression): Verify constructor's flags
	unconditionally.

	* g++.dg/cpp1y/nsdmi-aggr9.C: New test.

From-SVN: r258661
2018-03-19 20:46:16 +00:00
Marek Polacek e5cc0d5453 re PR c++/84925 (ICE with segfault in __PRETTY_FUNCTION__)
PR c++/84925
	* pt.c (enclosing_instantiation_of): Check if fn is null.

	* g++.dg/cpp1z/lambda-__func__.C: New test.

From-SVN: r258660
2018-03-19 20:34:45 +00:00
Jason Merrill 809c28c8dd PR c++/71834 - template-id with too few arguments.
* pt.c (coerce_template_parms): Check fixed_parameter_pack_p.

From-SVN: r258659
2018-03-19 16:32:57 -04:00
Maxim Ostapenko 058494f991 re PR sanitizer/78651 (Incorrect exception handling when catch clause uses local class and PIC and sanitizer are active)
2018-03-19  Maxim Ostapenko  <m.ostapenko@samsung.com>

gcc/

	PR sanitizer/78651
	* dwarf2asm.c (dw2_output_indirect_constant_1): Disable ASan before
	calling assemble_variable.

gcc/testsuite/

	PR sanitizer/78651
	* g++.dg/asan/pr78651.C: New test.

From-SVN: r258658
2018-03-19 21:59:56 +02:00
Tom de Vries df1f46241d [testsuite] Add nvptx xfail to pr84512.c
2018-03-19  Tom de Vries  <tom@codesourcery.com>

	* gcc.dg/tree-ssa/pr84512.c: Don't require effective target
	vect_int_mult.  Add nvptx xfail for PR84958.

From-SVN: r258656
2018-03-19 19:12:53 +00:00
Nathan Sidwell 143f00e112 [PR c++/84835] ICE with generic lambda in extern "C"
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00890.html
	PR c++/84835
	* lambda.c (maybe_add_lambda_conv_op): Force C++ linkage.
	* pt.c (build_template_decl): Propagate language linkage.

	PR c++/84835
	* g++.dg/cpp1y/pr84835.C: New.

From-SVN: r258655
2018-03-19 18:56:22 +00:00
Sudakshina Das f7d884d45b [PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md
This patch fixes the inconsistent behavior observed at -O3 for the unordered
comparisons. According to the online docs (https://gcc.gnu.org/onlinedocs
/gcc-7.2.0/gccint/Unary-and-Binary-Expressions.html), all of the following
should not raise an FP exception:
- UNGE_EXPR
- UNGT_EXPR
- UNLE_EXPR
- UNLT_EXPR
- UNEQ_EXPR
Also ORDERED_EXPR and UNORDERED_EXPR should only return zero or one.

The aarch64-simd.md handling of these were generating exception raising
instructions such as fcmgt. This patch changes the instructions that are
emitted in order to not give out the exceptions. We first check each
operand for NaNs and force any elements containing NaN to zero before using
them in the compare.

Example: UN<cc> (a, b) -> UNORDERED (a, b)
			  | (cm<cc> (isnan (a) ? 0.0 : a, isnan (b) ? 0.0 : b))


The ORDERED_EXPR is now handled as (cmeq (a, a) & cmeq (b, b)) and
UNORDERED_EXPR as ~ORDERED_EXPR and UNEQ as (~ORDERED_EXPR | cmeq (a,b)).

ChangeLog Entries:

*** gcc/ChangeLog ***

2018-03-19  Sudakshina Das  <sudi.das@arm.com>

	PR target/81647
	* config/aarch64/aarch64-simd.md (vec_cmp<mode><v_int_equiv>): Modify
	instructions for UNLT, UNLE, UNGT, UNGE, UNEQ, UNORDERED and ORDERED.

*** gcc/testsuite/ChangeLog ***

2018-03-19  Sudakshina Das  <sudi.das@arm.com>

	PR target/81647
	* gcc.target/aarch64/pr81647.c: New.

From-SVN: r258653
2018-03-19 18:50:32 +00:00
Joseph Myers a84677b84d * es.po, sv.po: Update.
From-SVN: r258651
2018-03-19 18:29:34 +00:00
Jim Wilson c0d3d1b681 RISC-V: Fix bootstrap failure.
gcc/
	PR bootstrap/84856
	* config/riscv/riscv.c (riscv_function_arg_boundary): Use
	PREFERRED_STACK_BOUNDARY instead of STACK_BOUNDARY.
	(riscv_first_stack_step): Likewise.
	(riscv_option_override): Use STACK_BOUNDARY instead of
	MIN_STACK_BOUNDARY.
	* config/riscv/riscv.h (STACK_BOUNDARY): Renamed from
	MIN_STACK_BOUNDARY.
	(BIGGEST_ALIGNMENT): Set to 128.
	(PREFERRED_STACK_BOUNDARY): Renamed from STACK_BOUNDARY.
	(RISCV_STACK_ALIGN): Use PREFERRED_STACK_BOUNDARY instead of
	STACK_BOUNDARY.

From-SVN: r258650
2018-03-19 11:08:24 -07:00
Richard Biener be742eb4d4 re PR tree-optimization/84933 (ICE in set_value_range, at tree-vrp.c:288 since r257852)
2018-03-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84933
	* tree-vrp.c (set_and_canonicalize_value_range): Treat out-of-bound
	values as -INF/INF when canonicalizing an ANTI_RANGE to a RANGE.

	* g++.dg/pr84933.C: New testcase.

From-SVN: r258646
2018-03-19 14:11:05 +00:00
Richard Biener 68d93a19c4 re PR tree-optimization/84859 (bogus -Warray-bounds on a memcpy in a loop)
2018-03-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84859
	* tree-ssa-phiopt.c (single_trailing_store_in_bb): New function.
	(cond_if_else_store_replacement): Perform sinking operation on
	single-store BBs regardless of MAX_STORES_TO_SINK setting.
	Generalize what a BB with a single eligible store is.

	* gcc.dg/tree-ssa/pr84859.c: New testcase.
	* gcc.dg/tree-ssa/pr35286.c: Disable cselim.
	* gcc.dg/tree-ssa/split-path-6.c: Likewise.
	* gcc.dg/tree-ssa/split-path-7.c: Likewise.

From-SVN: r258645
2018-03-19 14:08:58 +00:00
Nathan Sidwell 8f3284a486 [C++/84812] ICE with local fn decl
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00872.html
	PR c++/84812
	* name-lookup.c (set_local_extern_decl_linkage): Defend against
	ambiguous lookups.

	PR c++/84812
	* g++.dg/lookup/pr84812.C: New.

From-SVN: r258644
2018-03-19 14:07:07 +00:00
Richard Biener 25f91fda52 re PR tree-optimization/84929 (ICE at -O3 on valid code on x86_64-linux-gnu: tree check: expected polynomial_chrec, have nop_expr in analyze_siv_subscript_cst_affine, at tree-data-ref.c:3018)
2018-03-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84929
	* tree-data-ref.c (analyze_siv_subscript_cst_affine): Guard
	chrec_is_positive against non-chrec arg.

	* gcc.dg/torture/pr84929.c: New testcase.

From-SVN: r258643
2018-03-19 12:49:30 +00:00
Tamar Christina 8455b50ecc re PR target/84711 (AArch32 big-endian fails when taking subreg of a vector mode to a scalar mode.)
gcc/
2018-03-19  Tamar Christina  <tamar.christina@arm.com>

	PR target/84711
	* config/arm/arm.c (arm_can_change_mode_class): revert r258554.
       
gcc/testsuite/
2018-03-19  Tamar Christina  <tamar.christina@arm.com>

	PR target/84711
	* gcc.target/arm/big-endian-subreg.c: Delete.

From-SVN: r258642
2018-03-19 09:14:25 +00:00
Thomas Koenig 949d0060b4 re PR fortran/84931 (Expansion of array constructor with constant implied-do-object goes sideways)
2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/84931
	* simplify.c (gfc_convert_constant): Correctly handle iterators
	for type conversion.

2018-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/84931
	* gfortran.dg/array_constructor_52.f90: New test.

From-SVN: r258641
2018-03-19 07:04:35 +00:00
GCC Administrator 43bb589d9b Daily bump.
From-SVN: r258640
2018-03-19 00:16:19 +00:00
Gerald Pfeifer 8c00b6a4e8 api.xml: www.fsf.org has moved to https.
* doc/xml/api.xml: www.fsf.org has moved to https. Also omit
	trailing slash for domain level link.
	* doc/xml/faq.xml: Ditto.
	* doc/xml/manual/appendix_free.xml (software): Ditto.
	* doc/xml/manual/intro.xml: Ditto.
	* doc/xml/manual/spine.xml: Ditto.
	* doc/xml/spine.xml: Ditto.

From-SVN: r258637
2018-03-18 23:52:00 +00:00
Gerald Pfeifer 1de51fbc6f documentation_hacking.xml: Adjust link to docbook.org.
* doc/xml/manual/documentation_hacking.xml: Adjust link to
	docbook.org.

From-SVN: r258636
2018-03-18 23:38:23 +00:00
Martin Liska f7dbf8e564 Fix UBSAN in regrename.c (PR rtl-optimization/84635).
2018-03-18  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/84635
	* regrename.c (build_def_use): Use matches_mode only when
	matches >= 0.

From-SVN: r258634
2018-03-18 20:17:10 +00:00
Steven G. Kargl 96c8b2534d re PR fortran/77414 (ICE in create_function_arglist, at fortran/trans-decl.c:2410)
2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77414
	* decl.c (get_proc_name):  Check for a subroutine re-defined in
	the contain portion of a subroutine.  Change language of existing
	error message to better describe the issue. While here fix whitespace
	issues.

2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77414
	* gfortran.dg/pr77414.f90: New test.
	* gfortran.dg/internal_references_1.f90: Adjust error message.

From-SVN: r258633
2018-03-18 17:51:57 +00:00
Steven G. Kargl 81ea7c11e1 re PR fortran/65453 (ICE in build_function_decl, at fortran/trans-decl.c:2001)
2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65453
	* decl.c (get_proc_name): Catch clash between a procedure statement
	and a contained subprogram

2018-03-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/65453
	* gfortran.dg/pr65453.f90: New test.

From-SVN: r258632
2018-03-18 16:33:55 +00:00
Richard Sandiford 928b965f29 Don't try to vectorise COND_EXPR reduction chains (PR 84913)
The testcase ICEd for both SVE and AVX512 because we were trying
to vectorise a chain of COND_EXPRs as a reduction and getting
confused by reduc_index == -1.

2018-03-18  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	PR tree-optimization/84913
	* tree-vect-loop.c (vectorizable_reduction): Don't try to
	vectorize chains of COND_EXPRs.

gcc/testsuite/
	PR tree-optimization/84913
	* gfortran.dg/vect/pr84913.f90: New test.

From-SVN: r258631
2018-03-18 10:25:29 +00:00
Thomas Koenig 4a8298b46d re PR fortran/79929 (Bogus Warning: '__builtin_memset': specified size 4294967291 exceeds maximum object size 2147483647)
2018-03-18  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/79929
	* gfortran.dg/warn_concat.f90: New test.

From-SVN: r258630
2018-03-18 09:20:37 +00:00
Chung-Ju Wu 566f31a42e [NDS32] Fix wrong MAX_REGS_PER_ADDRESS value.
gcc/
	* config/nds32/nds32.h (MAX_REGS_PER_ADDRESS): Fix the value.

From-SVN: r258629
2018-03-18 06:44:31 +00:00
Chung-Ju Wu 08ed6d2955 [NDS32] Define LOGICAL_OP_NON_SHORT_CIRCUIT.
gcc/
	* config/nds32/nds32.h (LOGICAL_OP_NON_SHORT_CIRCUIT): Define.

From-SVN: r258628
2018-03-18 06:18:18 +00:00
Chung-Ju Wu 24a711668b [NDS32] Define CLZ_DEFINED_VALUE_AT_ZERO.
gcc/
	* config/nds32/nds32.h (CLZ_DEFINED_VALUE_AT_ZERO): Define.

From-SVN: r258627
2018-03-18 04:47:10 +00:00
GCC Administrator 369c3be428 Daily bump.
From-SVN: r258626
2018-03-18 00:16:25 +00:00
Jonathan Wakely 0fb9dc36d2 Fix new test that fails in C++98 mode
* testsuite/20_util/function_objects/comparisons_pointer.cc: Adjust
	to compile as C++98.

From-SVN: r258623
2018-03-17 13:44:16 +00:00
Chung-Ju Wu 5e6ae0ccbb [NDS32] Implment ADJUST_REG_ALLOC_ORDER for performance requirement.
gcc/
	* config/nds32/nds32-protos.h (nds32_adjust_reg_alloc_order): Declare.
	* config/nds32/nds32.c (nds32_reg_alloc_order_for_speed): New array.
	(nds32_adjust_reg_alloc_order): New function.
	* config/nds32/nds32.h (ADJUST_REG_ALLOC_ORDER): Define.

Co-Authored-By: Kito Cheng <kito.cheng@gmail.com>

From-SVN: r258621
2018-03-17 13:06:12 +00:00
Kito Cheng 5af5015907 [NDS32] Use HOST_WIDE_INT_PRINT_DEC instead of %ld or %d.
gcc/
	* config/nds32/nds32.c (nds32_asm_output_mi_thunk,
	nds32_print_operand, nds32_print_operand_address): Use
	HOST_WIDE_INT_PRINT_DEC instead.

From-SVN: r258620
2018-03-17 12:11:22 +00:00
Chung-Ju Wu 6a5a7ee306 [NDS32] Optimize nds32_register_priority.
gcc/
	* config/nds32/nds32.c (nds32_register_priority): Modify cost.

From-SVN: r258619
2018-03-17 11:51:46 +00:00
Jakub Jelinek 677956e82f re PR target/84902 (549.fotonik3d_r from SPEC2017 fails verification with -Ofast -march=native on Zen since r258518)
PR target/84902
	* config/i386/i386.c (initial_ix86_tune_features,
	initial_ix86_arch_features): Use unsigned HOST_WIDE_INT rather than
	unsigned long long.
	(set_ix86_tune_features): Change ix86_tune_mask from unsigned int
	to unsigned HOST_WIDE_INT, initialize to HOST_WIDE_INT_1U << ix86_tune
	rather than 1u << ix86_tune.  Formatting fix.
	(ix86_option_override_internal): Change ix86_arch_mask from
	unsigned int to unsigned HOST_WIDE_INT, initialize to
	HOST_WIDE_INT_1U << ix86_arch rather than 1u << ix86_arch.
	(ix86_function_specific_restore): Likewise.

From-SVN: r258618
2018-03-17 12:12:00 +01:00
GCC Administrator a3d6f9bab7 Daily bump.
From-SVN: r258617
2018-03-17 00:16:13 +00:00
Joseph Myers 20f78869d9 * de.po: Update.
From-SVN: r258614
2018-03-16 23:50:29 +00:00
Jakub Jelinek 927fb0bc9b re PR target/84899 (ICE: in final_scan_insn_1, at final.c:3139 (error: could not split insn))
PR target/84899
	* postreload.c (reload_combine_recognize_pattern): Perform
	INTVAL addition in unsigned HOST_WIDE_INT type to avoid UB and
	truncate_int_for_mode the result for the destination's mode.

	* gcc.dg/pr84899.c: New test.

From-SVN: r258610
2018-03-16 22:01:16 +01:00
Jakub Jelinek ce811fc49b re PR c/84909 (typo: conversion from %qT to to %qT)
PR c/84909
	* c-warn.c (conversion_warning): Replace "to to" with "to" in
	diagnostics.

	* hsa-gen.c (mem_type_for_type): Fix comment typo.
	* tree-vect-loop-manip.c (vect_create_cond_for_niters_checks):
	Likewise.
	* gimple-ssa-warn-restrict.c (builtin_memref::set_base_and_offset):
	Likewise.

From-SVN: r258609
2018-03-16 21:12:27 +01:00
Jakub Jelinek 63ecb626d6 re PR c/84910 (typo: "%qs follows inline declaration ")
PR c/84910
	* c-warn.c (diagnose_mismatched_attributes): Remove trailing space from
	diagnostics.

	* parser.c (cp_parser_lambda_introducer): Remove trailing space from
	diagnostics.
	* method.c (synthesize_method): Likewise.
	* pt.c (convert_nontype_argument): Likewise.

From-SVN: r258608
2018-03-16 21:11:40 +01:00
Steven G. Kargl 299ab1b2a1 re PR fortran/69395 (ICE on declaring array with more than 7 dimensions+codimensions)
2018-03-16  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69395
	* decl.c (merge_array_spec): Correct the error condition.

2018-03-16  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69395
	* gfortran.dg/pr69395.f90: Add test for max dimensions

From-SVN: r258607
2018-03-16 19:20:15 +00:00
Ian Lance Taylor 534d990b35 libgo: add runtime/pprof/internal/profile.gox to noinst_DATA
Also add noinst_DATA to CHECK_DEPS; it's not needed in practice since
    `make` will build noinst_DATA, but it's logically required and will
    make a difference if any of the noinst_DATA sources change between
    `make` and `make check`.
    
    Tony Reix figured out why omitting packages from noinst_DATA didn't
    seem to matter: because if gccgo can't find foo.gox, it will fall back
    to reading the export data in foo.o, and foo.o will exist because
    these packages go into libgo.a.
    
    Reviewed-on: https://go-review.googlesource.com/101077

From-SVN: r258606
2018-03-16 19:01:40 +00:00
Jason Merrill 83484be8b8 PR c++/84720 - ICE with rvalue ref non-type argument.
* pt.c (invalid_nontype_parm_type_p): Prohibit rvalue reference.
	(convert_nontype_argument): Revert earlier change.

From-SVN: r258605
2018-03-16 14:56:06 -04:00
Jason Merrill 80fdaad1c7 PR c++/80227 - SFINAE and negative array size.
* decl.c (compute_array_index_type): Use
	build_converted_constant_expr and valid_constant_size_p.

From-SVN: r258604
2018-03-16 14:56:01 -04:00
Jason Merrill 929a012293 PR c++/84906 - silent wrong code with ambiguous conversion.
* call.c (build_user_type_conversion_1): Set need_temporary_p on
	ambiguous conversion.
	(convert_like_real): Check it.

From-SVN: r258603
2018-03-16 14:55:54 -04:00