Commit Graph

148319 Commits

Author SHA1 Message Date
Ian Lance Taylor
ac376b15df runtime: use alignof to check alignment of ucontext_t
Use alignof rather than assuming a 16 byte alignment.
    
    Reviewed-on: https://go-review.googlesource.com/28913

From-SVN: r240047
2016-09-09 16:39:44 +00:00
Ian Lance Taylor
a9ca0a9d02 runtime: remove remaining use of MAKECONTEXT_STACK_TOP macro
The definition and most uses of MAKECONTEXT_STACK_TOP were removed in
    https://golang.org/cl/88660043, which removed support for Solaris 8/9.
    One use of MAKECONTEXT_STACK_TOP was accidentally left in the source
    code.  Remove it now.
    
    Reviewed-on: https://go-review.googlesource.com/28911

From-SVN: r240045
2016-09-09 14:00:43 +00:00
Ian Lance Taylor
6f02c13813 runtime: align ucontext_t argument to 16 byte boundary
Some systems, such as ia64 and PPC, require that a ucontext_t pointer
    passed to getcontext and friends be aligned to a 16-byte boundary.
    Currently the ucontext_t fields in the g structure are defined in Go,
    and Go has no way to ensure a 16-byte alignment for a struct field.
    The fields are currently represented by an array of unsafe.Pointer.
    Enforce the alignment by making the array larger, and picking an offset
    into the array that is 16-byte aligned.
    
    Reviewed-on: https://go-review.googlesource.com/28910

From-SVN: r240044
2016-09-09 13:31:49 +00:00
James Greenhalgh
0abcd6cc73 [Patch libgcc] Enable HCmode multiply and divide (mulhc3/divhc3)
This patch arranges for half-precision complex multiply and divide
routines to be built if __LIBGCC_HAS_HF_MODE__.  This will be true
if the target supports the _Float16 type.

libgcc/

	PR target/63250
	*  Makefile.in (lib2funcs): Build _mulhc3 and _divhc3.
	* libgcc2.h (LIBGCC_HAS_HF_MODE): Conditionally define.
	(HFtype): Likewise.
	(HCtype): Likewise.
	(__divhc3): Likewise.
	(__mulhc3): Likewise.
	* libgcc2.c: Support _mulhc3 and _divhc3.

From-SVN: r240043
2016-09-09 09:40:22 +00:00
GCC Administrator
f67a81a5e2 Daily bump.
From-SVN: r240042
2016-09-09 00:16:17 +00:00
Steven G. Kargl
2cf0ff9806 re PR fortran/69514 (ICE with nested array constructor)
2016-09-08  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/69514
	* array.c (gfc_match_array_constructor):  If type-spec is present,
	walk the array constructor performing possible conversions for 
	numeric types.

2016-09-08  Steven G. Kargl  <kargl@gcc.gnu.org>
	    Louis Krupp      <lkrupp@gcc.gnu.org>

	PR fortran/69514
	* gfortran.dg/pr69514_1.f90: New test.
	* gfortran.dg/pr69514_2.f90: New test.

Co-Authored-By: Louis Krupp <lkrupp@gcc.gnu.org>

From-SVN: r240039
2016-09-08 22:33:10 +00:00
Jakub Jelinek
20b6cf0194 re PR fortran/77500 (ICE in gfc_trans_omp_atomic, at fortran/trans-openmp.c:2822)
PR fortran/77500
	* trans-openmp.c (gfc_trans_omp_atomic): For atomic write or
	swap, don't try to look through GFC_ISYM_CONVERSION.  In other cases,
	check that value.function.isym is non-NULL before dereferencing it.

	* gfortran.dg/gomp/pr77500.f90: New test.

From-SVN: r240038
2016-09-08 14:19:21 +02:00
Jakub Jelinek
8ebc1e0f8e re PR fortran/77516 (ICE in is_gimple_min_invariant, at gimple-expr.c:706)
PR fortran/77516
	* omp-low.c (lower_rec_simd_input_clauses): Use max_vf for non-positive
	OMP_CLAUSE_SAFELEN_EXPR.

	* gfortran.dg/gomp/pr77516.f90: New test.

From-SVN: r240037
2016-09-08 14:18:16 +02:00
GCC Administrator
e124cd64ae Daily bump.
From-SVN: r240036
2016-09-08 00:16:15 +00:00
Joseph Myers
d758aeb5ff Correct libgcc complex multiply excess precision handling (PR libgcc/77519).
libgcc complex multiply is meant to eliminate excess
precision from certain internal values by forcing them to memory in
exactly those cases where the type has excess precision.  But in
https://gcc.gnu.org/ml/gcc-patches/2014-09/msg01894.html I
accidentally inverted the logic so that values get forced to memory in
exactly the cases where it's not needed.  (This is a pessimization in
the no-excess-precision case, in principle could lead to bad results
depending on code generation in the excess-precision case.  Note: I do
not have a test demonstrating bad results.)

Bootstrapped with no regressions on x86_64-pc-linux-gnu.  Code size
went down on x86_64 as expected; old sizes:

   text    data     bss     dec     hex filename
    887       0       0     887     377 _muldc3.o
    810       0       0     810     32a _mulsc3.o
   2032       0       0    2032     7f0 _multc3.o
    983       0       0     983     3d7 _mulxc3.o

New sizes:

    847       0       0     847     34f _muldc3.o
    770       0       0     770     302 _mulsc3.o
   2032       0       0    2032     7f0 _multc3.o
    951       0       0     951     3b7 _mulxc3.o

	PR libgcc/77519
	* libgcc2.c (NOTRUNC): Invert settings.

From-SVN: r240033
2016-09-08 00:02:56 +01:00
Jakub Jelinek
34718542cb PR middle-end/77475: Fix AArch64 testcases.
2016-09-07  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/77475
	* gcc.target/aarch64/arch-diagnostics-1.c: Expect error on line 0.
	* gcc.target/aarch64/arch-diagnostics-2.c: Likewise.
	* gcc.target/aarch64/cpu-diagnostics-1.c: Likewise.
	* gcc.target/aarch64/cpu-diagnostics-2.c: Likewise.
	* gcc.target/aarch64/cpu-diagnostics-3.c: Likewise.
	* gcc.target/aarch64/cpu-diagnostics-4.c: Likewise.

From-SVN: r240030
2016-09-07 22:18:17 +02:00
David Malcolm
e5106e27fe Move class substring_loc from c-family into gcc
gcc/ChangeLog:
	* Makefile.in (OBJS): Add substring-locations.o.
	* langhooks-def.h (class substring_loc): New forward decl.
	(lhd_get_substring_location): New decl.
	(LANG_HOOKS_GET_SUBSTRING_LOCATION): New macro.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_GET_SUBSTRING_LOCATION.
	* langhooks.c (lhd_get_substring_location): New function.
	* langhooks.h (class substring_loc): New forward decl.
	(struct lang_hooks): Add field get_substring_location.
	* substring-locations.c: New file, taking definition of
	format_warning_va and format_warning_at_substring from
	c-family/c-format.c, making them non-static.
	* substring-locations.h (class substring_loc): Move class here
	from c-family/c-common.h.  Add and rewrite comments.
	(format_warning_va): New decl.
	(format_warning_at_substring): New decl.
	(get_source_location_for_substring): Add comment.

gcc/c-family/ChangeLog:
	* c-common.c (get_cpp_ttype_from_string_type): Handle being passed
	a POINTER_TYPE.
	(substring_loc::get_location): Move to substring-locations.c,
	keeping implementation as...
	(c_get_substring_location): New function, from the above, reworked
	to use accessors rather than member lookup.
	* c-common.h (class substring_loc): Move to substring-locations.h,
	replacing with a forward decl.
	(c_get_substring_location): New decl.
	* c-format.c: Include "substring-locations.h".
	(format_warning_va): Move to substring-locations.c.
	(format_warning_at_substring): Likewise.

gcc/c/ChangeLog:
	* c-lang.c (LANG_HOOKS_GET_SUBSTRING_LOCATION): Use
	c_get_substring_location for this new langhook.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/diagnostic_plugin_test_string_literals.c: Include
	"substring-locations.h".

From-SVN: r240028
2016-09-07 16:56:23 +00:00
Eric Gallager
7100c1f253 i386.c: Add 'U' suffix to processor feature bits to avoid -Wnarrowing warning.
* config/i386/i386.c: Add 'U' suffix to processor feature bits
	to avoid -Wnarrowing warning.
	* config/i386/x86-tune.def: Likewise for DEF_TUNE selector bitmasks.
	* opts.c: Likewise for SANITIZER_OPT bitmasks.

From-SVN: r240027
2016-09-07 17:05:56 +02:00
Wilco Dijkstra
ff0f3f1cb5 Improve aarch64_legitimize_address - avoid splitting the offset if it is supported.
Improve aarch64_legitimize_address - avoid splitting the offset if it is
supported.  When we do split, take the mode size into account.  BLKmode
falls into the unaligned case but should be treated like LDP/STP.
This improves codesize slightly due to fewer base address calculations:

int f(int *p) { return p[5000] + p[7000]; }

Now generates:

f:
	add	x0, x0, 16384
	ldr	w1, [x0, 3616]
	ldr	w0, [x0, 11616]
	add	w0, w1, w0
	ret

instead of:

f:
	add	x1, x0, 16384
	add	x0, x0, 24576
	ldr	w1, [x1, 3616]
	ldr	w0, [x0, 3424]
	add	w0, w1, w0
	ret

    gcc/
	* config/aarch64/aarch64.c (aarch64_legitimize_address):
	Avoid use of base_offset if offset already in range.

From-SVN: r240026
2016-09-07 14:56:59 +00:00
Richard Biener
ca235a8500 re PR tree-optimization/77450 (ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors)
2016-09-07  Richard Biener  <rguenther@suse.de>

	PR c/77450
	* c-c++-common/vector-subscript-8.c: Move ..
	* gcc.dg/pr77450.c: ... here.

From-SVN: r240025
2016-09-07 08:22:01 +00:00
Kaz Kojima
9bed553532 [SH] Move definitions for atomic models to sh.h from sh-protos.h.
From-SVN: r240023
2016-09-07 04:44:40 +00:00
GCC Administrator
cdc65c28a6 Daily bump.
From-SVN: r240022
2016-09-07 00:16:14 +00:00
Jerry DeLisle
0076b5dc3b Fix dates on changelog
From-SVN: r240019
2016-09-06 23:22:36 +00:00
Jerry DeLisle
5dcf68f510 re PR libfortran/77393 (Revision r237735 changed the behavior of F0.0)
2016-09-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/77393
	* io/write_float.def (build_float_string): Recognize when the
	result will not fit in the user provided, star fill, and exit
	early.

	* gfortran.dg/fmt_f0_2.f90: Update test.
	* gfortran.dg/fmt_f0_3.f90: New test.

From-SVN: r240018
2016-09-06 23:22:26 +00:00
Dominique d'Humieres
6ac7322b3e re PR debug/77389 (FAIL: g++.dg/debug/dwarf2/template-params-12f.C -std=gnu++11 scan-assembler-times DIE \\\\([^\\n]*\\\\) DW_TAG_template_value_param ...)
2016-09-07  Dominique d'Humieres  <dominiq@lps.ens.fr>

	PR debug/77389
	* g++.dg/debug/dwarf2/template-params-12g.C: Pass -gno-strict-dwarf
	in dg-options.

	PR debug/57519
	* g++.dg/debug/dwarf2/imported-decl-2.C: Likewise.

From-SVN: r240015
2016-09-07 00:18:54 +02:00
Jakub Jelinek
8eb9e049af re PR target/69255 (ICE on x86_64-linux-gnu in "emit_move_insn")
PR target/69255
	* config/i386/i386.c (ix86_expand_builtin): For builtin with
	unsupported or unknown ISA, use expand_call.

	* gcc.target/i386/pr69255-1.c: New test.
	* gcc.target/i386/pr69255-2.c: New test.
	* gcc.target/i386/pr69255-3.c: New test.

From-SVN: r240014
2016-09-06 22:30:57 +02:00
Martin Sebor
a42e7952b0 PR c/77336 - -Wsuggest-attribute=format warning overly simplistic
gcc/c-family/ChangeLog:

	PR c/77336
	* c-format.c (check_function_format): Avoid issuing warnings for
	functions unless they call format functions with non-constant
	format strings.

gcc/testsuite/ChangeLog:

	PR c/77336
	* gcc.dg/format/miss-7.c: New test.

From-SVN: r240013
2016-09-06 13:23:25 -06:00
Uros Bizjak
e6cb85d435 c_by_val_1.f: Correct the call to c_to_c and c_to_c8.
* gfortran.dg/c_by_val_1.f: Correct the call to c_to_c and c_to_c8.

From-SVN: r240009
2016-09-06 17:13:06 +02:00
Martin Liska
7fe76f6ae8 Detect whether target can use -fprofile-update=atomic
PR gcov-profile/77378
	PR gcov-profile/77466
	* libgcov-profiler.c: Use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_{4,8} to
	conditionaly enable/disable *_atomic functions.
	PR gcov-profile/77378
	PR gcov-profile/77466
	* tree-profile.c (tree_profiling): Detect whether target can use
	-fprofile-update=atomic.
	PR gcov-profile/77378
	PR gcov-profile/77466
	* gcc.dg/profile-update-warning.c: New test.

From-SVN: r240008
2016-09-06 14:13:21 +00:00
Richard Biener
209b636edd re PR tree-optimization/77479 (Compile time hog w/ -O2 (-Os))
2016-09-06  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77479
	* tree-vrp.c (update_value_range): Extend overflow handling to
	VARYING.

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

From-SVN: r240007
2016-09-06 12:51:01 +00:00
Richard Biener
b772a56562 re PR tree-optimization/77450 (ICE: in verify_ssa, at tree-ssa.c:1016 on very simple code with vectors)
2016-09-06  Richard Biener  <rguenther@suse.de>

	PR c/77450
	c-family/
	* c-common.c (c_common_mark_addressable_vec): Handle
	COMPOUND_LITERAL_EXPR.

	* c-c++-common/vector-subscript-7.c: Adjust.
	* c-c++-common/vector-subscript-8.c: New testcase.

From-SVN: r240006
2016-09-06 12:49:53 +00:00
Senthil Kumar Selvaraj
a8c0703767 Skip Wno-frame-address test for avr
The avr backend supports __builtin_return_address only for the current 
stack frame. The test expects it to work for caller frames as well and 
therefore fails for avr.

Add avr to the list of targets already excluded with dg-skip-if.

gcc/testsuite/ChangeLog:

2016-09-06  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>

	* gcc.dg/Wno-frame-address.c: Skip for avr-*-*.

From-SVN: r240005
2016-09-06 12:02:23 +00:00
GCC Administrator
ea04c34988 Daily bump.
From-SVN: r240004
2016-09-06 00:16:17 +00:00
Tim Shen
f75d599982 variant: include bits/move.h for std::addressof.
2016-09-05  Tim Shen  <timshen@google.com>

	* include/std/variant: include bits/move.h for std::addressof.

From-SVN: r240001
2016-09-05 19:52:11 +00:00
Jakub Jelinek
de9188e004 re PR target/77476 ([AVX-512] illegal kmovb instruction on KNL)
PR target/77476
	* config/i386/i386.md (isa): Add x64_avx512bw.
	(*zero_extendsidi2): For alternative 11 use x64_avx512bw isa.
	(kmov_isa): New mode attr.
	(zero_extend<mode>di2): Use <kmov_isa> isa for the last alternative.
	(*zero_extend<mode>si2): Likewise.
	(*zero_extendqihi2): Use avx512dq isa for the last alternative.

	* gcc.target/i386/avx512f-pr77476.c: New test.
	* gcc.target/i386/avx512bw-pr77476.c: New test.
	* gcc.target/i386/avx512dq-pr77476.c: New test.

From-SVN: r240000
2016-09-05 21:45:21 +02:00
Jakub Jelinek
c76f780985 target-supports.exp (check_effective_target_vect_simd_clones): Update comment to mention also avx512f.
* lib/target-supports.exp (check_effective_target_vect_simd_clones):
	Update comment to mention also avx512f.

From-SVN: r239999
2016-09-05 21:44:26 +02:00
Jakub Jelinek
0ce483917f re PR sanitizer/77396 (address sanitizer crashes if all static global variables are optimized)
PR sanitizer/77396
	* asan/asan_globals.cc: Cherry-pick upstream r280657.

	* g++.dg/asan/pr77396-2.C: New test.

From-SVN: r239998
2016-09-05 21:43:57 +02:00
Jakub Jelinek
3f8257db2e ChangeLog formatting fixes.
From-SVN: r239997
2016-09-05 21:42:42 +02:00
Mikhail Strelnikov
eddca7bd73 variant (_Variant_storage::_M_storage()): Use std::addressof instead of operator& to take address.
2016-09-05  Mikhail Strelnikov  <mikhail.strelnikov@gmail.com>

	* include/std/variant (_Variant_storage::_M_storage()): Use std::addressof
	instead of operator& to take address.

From-SVN: r239996
2016-09-05 19:40:44 +00:00
Gerald Pfeifer
2ba1f597c2 invoke.texi (SPU Options): nops -> NOPs.
* doc/invoke.texi (SPU Options): nops -> NOPs.
	(x86 Options): Ditto.

From-SVN: r239995
2016-09-05 18:39:31 +00:00
Jakub Jelinek
b3c3ce0ac6 re PR middle-end/77475 (unnecessary or misleading context in reporting command line problems)
PR middle-end/77475
	* toplev.c (process_options): Temporarily set input_location
	to UNKNOWN_LOCATION around targetm.target_option.override () call.

From-SVN: r239994
2016-09-05 20:14:25 +02:00
Joseph Myers
4b13952a33 * sv.po: Update.
From-SVN: r239992
2016-09-05 17:35:56 +01:00
Uros Bizjak
8a27cf73aa re PR target/77452 (ICE: in plus_constant, at explow.c:87 with -fno-split-wide-types -mavx512f --param=max-combine-insns=2)
PR rtl-optimization/77452
	* explow.c (plus_constant) <case MEM>: Extract scalar constant from
	inner-mode reference to a CONST_VECTOR constant in the constant pool.

testsuite/ChangeLog:

	PR rtl-optimization/77452
	* gcc.target/i386/pr77452.c: New test.

From-SVN: r239989
2016-09-05 16:44:19 +02:00
Marek Polacek
25ff5dd354 re PR c/77423 (-Wlogical-not-parentheses false positive for bitwise expression with _Bool operands)
PR c/77423
	* doc/invoke.texi: Update -Wlogical-not-parentheses documentation.

	* c-common.c (bool_promoted_to_int_p): New function.
	(expr_has_boolean_operands_p): New function.
	(warn_logical_not_parentheses): Return if expr_has_boolean_operands_p.
	(maybe_warn_bool_compare): Use bool_promoted_to_int_p.

	* c-c++-common/Wlogical-not-parentheses-3.c: New test.

From-SVN: r239988
2016-09-05 12:17:09 +00:00
Jakub Jelinek
c5cb79681d re PR other/77421 (Bugs found in GCC with the help of PVS-Studio)
PR other/77421
	* gensupport.c (alter_output_for_subst_insn): Remove redundant
	*insn_out == '*' test.  Don't copy unnecessary to yet another
	memory buffer, and don't leak it.

From-SVN: r239987
2016-09-05 10:50:29 +02:00
Jakub Jelinek
61f46d0e6d re PR rtl-optimization/77425 (Pointer test follows dereference in sched-int.h)
PR rtl-optimization/77425
	* ipa-devirt.c (get_odr_type): Set val->id unconditionally.

From-SVN: r239986
2016-09-05 10:49:41 +02:00
GCC Administrator
6f1eb99962 Daily bump.
From-SVN: r239985
2016-09-05 00:16:15 +00:00
Steven G. Kargl
f2bc4e4800 re PR fortran/77391 (gfortran allows CHARACTER(LEN=:),PARAMETER:: STRING='constant' buts does not report it as an extension)
2016-09-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77391
	* resolve.c (deferred_requirements): New function to check F2008:C402.
	(resolve_fl_variable,resolve_fl_parameter): Use it.
 
2016-09-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77391
	* gfortran.dg/pr77391.f90: New test.

From-SVN: r239982
2016-09-04 20:00:48 +00:00
Gerald Pfeifer
aa9cdb9755 re PR web/50642 (onlinedocs formated text too small to read)
PR documentation/50642 
	* update_web_docs_svn (CSS): Introduce.
	Have generated files refer to it.

From-SVN: r239981
2016-09-04 19:38:05 +00:00
Gerald Pfeifer
b8c0f3c164 update_web_docs_svn (CSS): Introduce.
* update_web_docs_svn (CSS): Introduce.
	Have generated files refer to it.

From-SVN: r239980
2016-09-04 18:44:30 +00:00
Steven G. Kargl
e85921ee9f re PR fortran/77460 (ICE when summing an overflowing array)
2016-09-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77460
	* simplify.c (simplify_transformation_to_scalar):  On error, result
	may be NULL, simply return.

2016-09-04  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/77460
	* gfortran.dg/pr77460.f90: New test.

From-SVN: r239979
2016-09-04 18:43:40 +00:00
John David Anglin
5961d13d27 ffi.c (ffi_struct_type): Put type declaration on separate line.
* src/pa/ffi.c (ffi_struct_type): Put type declaration on separate line.
	(ffi_prep_args_pa32): Likewise.
	(ffi_size_stack_pa32): Likewise.
	(ffi_prep_cif_machdep): Likewise.
	(ffi_call): Likewise.  Rename to ffi_call_int.  Add closure argument
	and update call to ffi_call_pa32.
	(ffi_call, ffi_call_go, ffi_prep_go_closure): New.
	(ffi_closure_inner_pa32): Update to handle go closures.
	* src/pa/ffitarget.h (FFI_GO_CLOSURES): Define.
	* src/pa/hpux32.S (ffi_call_pa32): Pass go closure argument in static
	chain register (%ret1).
	(ffi_closure_pa32): Set closure type argument to zero.
	(ffi_go_closure_pa32): New function.  Add unwind data for it.
	* src/pa/linux.S: Likewise.  Use cfi directives for unwind data.
	* testsuite/libffi.go/static-chain.h (STATIC_CHAIN_REG): Define for
	hppa.

From-SVN: r239978
2016-09-04 17:39:05 +00:00
Thomas Koenig
d6598cf719 re PR fortran/71902 (Unneeded temporary on reallocatable character assignment)
2016-09-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71902
	* frontend-passes.c (realloc_string_callback): Also check for the
	lhs being deferred.  Name temporary variable "realloc_string".

2016-09-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/71902
	* gfortran.dg/dependency_47.f90:  New test.
	* gfortran.dg/dependency_49.f90:  New test.

From-SVN: r239977
2016-09-04 16:17:55 +00:00
John David Anglin
abb62d32a1 inclhack.def (hpux_longjmp): Adjust select regular expression.
* inclhack.def (hpux_longjmp): Adjust select regular expression.
	* fixincl.x: Regenerate.

From-SVN: r239976
2016-09-04 16:17:10 +00:00
Tom de Vries
21234eb5e8 Revert "Replace error_at with assert in build_va_arg"
2016-09-04  Tom de Vries  <tom@codesourcery.com>

	revert:
	2016-08-29  Tom de Vries  <tom@codesourcery.com>

	* c-common.c (build_va_arg): Replace first argument type error
	with assert.

From-SVN: r239975
2016-09-04 09:07:52 +00:00