Copy over the Go 1.7 runtime/internal/sys package, but instead of having
separate files for each GOARCH and GOOS value, set the values in
configure.ac and write them out in Makefile.am. Setting the values in
configure.ac should make it easier to add new processors.
Remove the automake GOARCH conditionals, which are no longer used.
Leave the GOOS conditionals for now, as they are used for the C runtime
package.
Reviewed-on: https://go-review.googlesource.com/29018
From-SVN: r240083
2016-09-10 Paul Thomas <pault@gcc.gnu.org>
Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77532
^ interface.c (check_dtio_arg_TKR_intent): Return after error.
(check_dtio_interface1): Remove asserts, test for NULL and return
if found.
gfortran.dg/dtio_11.f90: new test.
Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
From-SVN: r240074
Copy over the Go 1.7 runtime/internal/atomic package, but implement the
functions in C using __atomic functions rather than using the
processor-specific assembler code.
Reviewed-on: https://go-review.googlesource.com/29010
From-SVN: r240070
valgrind contains a copy of the libiberty demangler which gets compiled
with -Wshadow. That shows the following warning:
cp-demangle.c: In function ‘d_substitution’:
cp-demangle.c:3772:35: warning: declaration of ‘c’ shadows a previous local
struct demangle_component *c;
^
cp-demangle.c:3708:8: note: shadowed declaration is here
char c;
^
Fix that by renaming the struct demangle_component variable to dc.
libiberty/ChangeLog:
* cp-demangle.c (d_substitution): Change struct demangle_component
variable name from c to dc.
From-SVN: r240068
gcc/
PR rtl-optimization/77289
* lra-constraints.c (get_final_hard_regno): Add support for non hard
register numbers. Remove support for subregs.
(get_hard_regno): Use SUBREG_P. Don't call get_final_hard_regno().
(get_reg_class): Delete removed get_final_hard_regno() argument.
(uses_hard_regs_p): Call get_final_hard_regno().
gcc/testsuite/
PR rtl-optimization/77289
* gcc.target/powerpc/pr77289.c: New test.
From-SVN: r240065
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77420
* module.c (load_equiv): If the current namespace has a list of
equivalence statements, initialize duplicate to false and then
look for duplicates; otherwise, initialize it to true.
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77420
* gfortran.dg/pr77420.f90: New test.
From-SVN: r240063
GCC will soon get a new -Wformat-length option as described in
https://gcc.gnu.org/PR49905. This change makes a buffer larger to avoid
a warning.
Reviewed-on: https://go-review.googlesource.com/28915
Also revert ChangeLog entry in gcc/go/ChangeLog--changes to
gcc/go/gofrontend do not get ChangeLog entries.
From-SVN: r240054
Add new interface for the front end code to use when computing SHA1
checksums; the intent is to allow the different implementation in
different back ends.
No change in functionality for gccgo; this is an enabling change to
permit the front end to be used with other back ends (e.g. LLVM).
Reviewed-on: https://go-review.googlesource.com/28833
* go-sha1.cc: New file.
* Make-lang.in (GO_OBJS): Add go/go-sha1.o.
(CFLAGS-go/go-sha1.o): New variable.
From-SVN: r240053
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77506
* array.c (gfc_match_array_constructor): CHARACTER(len=*) cannot
appear in an array constructor.
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77506
* gfortran.dg/pr77506.f90: New test.
From-SVN: r240052
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77507
* intrinsic.c (add_functions): Use correct keyword.
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77507
* ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10,
IEEE_VALUE_16): Use correct keyword.
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77507
* gfortran.dg/pr77507.f90: New test.
From-SVN: r240050
Rework the lexical analyzer to eliminate the need to call
hex_value() in libiberty (added equivalent local functionality).
No change in functionality.
Reviewed-on: https://go-review.googlesource.com/28855
From-SVN: r240049
TS 18661-1 defines <limits.h> and <stdint.h> macros for widths of
standard integer types and the typedefs defined in, or whose limits
are defined in, <stdint.h>. (The connection to the main
floating-point subject matter of TS 18661-1 is that these are intended
to be used with the fromfp functions to convert from floating point to
integer types of any width in any rounding direction, though these
macros may be of more general use.)
This patch implements support for these macros in GCC's <limits.h> and
<stdint.h>. To avoid needing to implement fixincludes for system
headers where GCC wraps the system libc's <stdint.h> in hosted mode,
the test for the <stdint.h> macros uses -ffreestanding (I'll add the
macros to glibc's headers separately) - but as usual for new features
in these headers, platforms (primarily OpenBSD) that use USER_H to
avoid using GCC's headers at all will have failures until the system
headers have the feature added or appropriate fixincludes are
implemented.
The header macros are implemented using appropriate new predefined
macros, with the code avoiding defining more such macros than
necessary (so one predefined macro suffices for corresponding signed
and unsigned types, while no such predefined macros are needed for the
exact-width types such as int8_t).
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc:
* doc/cpp.texi (__SCHAR_WIDTH__, __SHRT_WIDTH__, __INT_WIDTH__)
(__LONG_WIDTH__, __LONG_LONG_WIDTH__, __PTRDIFF_WIDTH__)
(__SIG_ATOMIC_WIDTH__, __SIZE_WIDTH__, __WCHAR_WIDTH__)
(__WINT_WIDTH__, __INT_LEAST8_WIDTH__, __INT_LEAST16_WIDTH__)
(__INT_LEAST32_WIDTH__, __INT_LEAST64_WIDTH__)
(__INT_FAST8_WIDTH__, __INT_FAST16_WIDTH__, __INT_FAST32_WIDTH__)
(__INT_FAST64_WIDTH__, __INTPTR_WIDTH__, __INTMAX_WIDTH__):
Document.
* ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Define
width macros from TS 18661-1.
* glimits.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Likewise.
gcc/c-family:
* c-cppbuiltin.c (builtin_define_type_width): New function.
(builtin_define_stdint_macros, c_cpp_builtins): Define type width
macros.
gcc/testsuite:
* gcc.dg/limits-width-1.c, gcc.dg/stdint-width-1.c: New tests.
From-SVN: r240048
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
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
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-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
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
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
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
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-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