gcc/ChangeLog:
* gimple-ssa-sprintf.c (target_strtol): Rename...
(target_strtohwi): ...to this. Handle values up to HOST_WIDE_INT_MAX.
(parse_directive): Adjust to name change. Use HOST_WIDE_INT_MAX to
check for range error.
From-SVN: r269166
When -march=native is passed to host_detect_local_cpu to the backend,
it overrides all command lines after it. That means
$ gcc -march=native -march=skylake-avx512
is the treated as
$ gcc -march=skylake-avx512 -march=native
Prune joined switches with Negative and RejectNegative to allow
-march=skylake-avx512 to override previous -march=native on command-line.
gcc/
PR driver/69471
* opts-common.c (prune_options): Also prune joined switches
with Negative and RejectNegative.
* config/i386/i386.opt (march=): Add Negative(march=).
(mtune=): Add Negative(mtune=).
* doc/options.texi: Document Negative used together with Joined
and RejectNegative.
gcc/testsuite/
PR driver/69471
* gcc.dg/pr69471-1.c: New test.
* gcc.dg/pr69471-2.c: Likewise.
* gcc.target/i386/pr69471-3.c: Likewise.
From-SVN: r269164
2019-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/84387
* trans-io.c (transfer_expr): Do not return if there are no
components to the derived type or class.
* gfortran.dg/dtio_34.f90: New test.
From-SVN: r269161
* pt.c (maybe_instantiate_noexcept): Set up the list of local
specializations. Set current_class_{ptr,ref}.
* g++.dg/cpp0x/noexcept34.C: New test.
* g++.dg/cpp0x/noexcept35.C: New test.
From-SVN: r269158
2019-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88117
* resolve.c (deferred_op_assign): Return if the lhs expression
has the pointer attribute.
* trans-expr.c (gfc_trans_assignment_1): Do not fix the string
length if the lhs expression has the pointer attribute.
2019-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88117
* gfortran.dg/deferred_character_32.f90 : New test
From-SVN: r269157
2019-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89385
PR fortran/89366
* decl.c (gfc_verify_c_interop_param): Restriction on string
length being one is lifted for F2018.
* trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): For scalar
characters with intent in, make a temporary and copy the result
of the expression evaluation into it.
(gfc_conv_procedure_call): Set a flag for character formal args
having a character length that is not unity. If the procedure
is bind C, call gfc_conv_gfc_desc_to_cfi_desc in this case.
Also, extend bind C calls to unconditionally convert both
pointers and allocatable expressions.
2019-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89385
* gfortran.dg/ISO_Fortran_binding_1.f90 : Correct test for
previously incorrect lbound for allocatable expressions. Also
correct stop values to avoid repetition.
* gfortran.dg/ISO_Fortran_binding_5.f90 : New test
* gfortran.dg/ISO_Fortran_binding_5.c : Support previous test.
PR fortran/89366
* gfortran.dg/ISO_Fortran_binding_6.f90 : New test
* gfortran.dg/ISO_Fortran_binding_6.c : Support previous test.
* gfortran.dg/pr32599.f03 : Set standard to F2008.
2019-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89385
PR fortran/89366
* runtime/ISO_Fortran_binding.c (cfi_desc_to_gfc_desc) : In the
interchange between character and derived, the character type
was being set incorrectly.
(gfc_desc_to_cfi_desc) : Eliminate the interchange of types in
this function. Do not add the kind and length information to
the type field of structures. Lbounds were incorrectly being
set to zero for allocatable and pointer descriptors. Should
have been non-pointer, non-allocatables that received this
treatment.
From-SVN: r269156
PR libstdc++/89446
* include/bits/char_traits.h (__constant_char_array): Check index is
in range before dereferencing.
(char_traits<char>::compare, char_traits<char>::find)
(char_traits<char8_t>::compare, char_traits<char8_t>::find): Return
immediately if n is zero.
(char_traits<wchar_t>::compare, char_traits<wchar_t>::find): Likewise.
Remove workarounds for PR 67026.
* testsuite/21_strings/basic_string_view/operators/char/89446.cc:
New test.
* testsuite/21_strings/basic_string_view/operators/wchar_t/89446.cc:
New test.
From-SVN: r269148
gcc/cp/ChangeLog:
PR c++/89390
* parser.c (cp_parser_unqualified_id): Capture and use locations
for destructors.
gcc/testsuite/ChangeLog:
PR c++/89390
* g++.dg/diagnostic/pr89390.C: Update expected location of error,
renaming to a multicharacter name, so that start != finish. Add
tests for dtor locations.
From-SVN: r269145
PR middle-end/88074
* simplify.c (norm2_do_sqrt, gfc_simplify_norm2): Use
mpfr_number_p && !mpfr_zero_p instead of mpfr_regular_p.
(norm2_add_squared): Likewise. Use mp_exp_t rather than mpfr_exp_t.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r269139
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/builtin-sprintf-10.c: Cast wchar_t to wint_t
to avoid a bogus -Wformat warning in ILP32 (bug 77970).
From-SVN: r269137
2019-02-22 Harald Anlauf <anlauf@gmx.de>
PR fortran/83057
* io.c (gfc_match_open): Fix logic in checks of OPEN statement
when NEWUNIT= is specified.
PR fortran/83057
* gfortran.dg/newunit_6.f90: New test.
From-SVN: r269134
* decl.c (build_explicit_specifier): Don't check
processing_template_decl. Call instantiation_dependent_expression_p
instead of value_dependent_expression_p. Call
instantiate_non_dependent_expr_sfinae before
build_converted_constant_expr instead of calling
instantiate_non_dependent_expr after it. Add
processing_template_decl_sentinel.
* g++.dg/cpp2a/explicit14.C: New test.
From-SVN: r269131
PR libstdc++/89402
* src/c++98/compatibility-ldbl.cc (_ZNKSt4hashIeEclEe): Change return
type to std::size_t and argument to type to long double.
From-SVN: r269130
PR rtl-optimization/87761
* config/mips/mips.md: Add new combiner pattern to recognize
a bitfield extraction using (ashiftrt (truncate (ashift (...)))).
From-SVN: r269123
In general the stack pointer was not handled for many SUBS/ADDS patterns in
aarch64.md.
Both the "extended register" and "immediate" forms allow the stack pointer to be
used as the source register, while no form allows the stack pointer for the
destination register.
The define_insn patterns generating ADDS/SUBS did not allow the stack pointer
for any operand, while the define_peephole2 patterns that generated RTX to be
matched by these patterns allowed the stack pointer for any operand.
The patterns are fixed by adding the 'k' constraint for the first source operand
to all define_insns that generate the ADDS/SUBS "extended register" and
"immediate" forms (but not the "shifted register" form).
In peephole optimizations, constraint strings are ignored (see "(gccint) C
Constraint Interface" info node in the documentation), so the decision to act or
not is based solely on the predicate and condition.
This patch introduces a new predicate "aarch64_general_reg" to be used in
define_peephole2 patterns where only GENERAL_REGS registers are acceptable and
uses that predicate in the peepholes that generate patterns for ADDS/SUBS.
Full bootstrap and regtest done on aarch64-none-linux-gnu.
Regression tests done on aarch64-none-linux-gnu and aarch64-none-elf cross
compiler.
OK for trunk?
gcc/ChangeLog:
2019-02-22 Matthew Malcomson <matthew.malcomson@arm.com>
PR target/89324
* config/aarch64/aarch64.md: Use aarch64_general_reg predicate on
destination register in peepholes generating patterns for ADDS/SUBS.
(add<mode>3_compare0,
*addsi3_compare0_uxtw, add<mode>3_compareC,
add<mode>3_compareV_imm, add<mode>3_compareV,
*adds_<optab><ALLX:mode>_<GPI:mode>,
*subs_<optab><ALLX:mode>_<GPI:mode>,
*adds_<optab><ALLX:mode>_shift_<GPI:mode>,
*subs_<optab><ALLX:mode>_shift_<GPI:mode>,
*adds_<optab><mode>_multp2, *subs_<optab><mode>_multp2,
*sub<mode>3_compare0, *subsi3_compare0_uxtw,
sub<mode>3_compare1): Allow stack pointer for source register.
* config/aarch64/predicates.md (aarch64_general_reg): New predicate.
gcc/testsuite/ChangeLog:
2019-02-22 Matthew Malcomson <matthew.malcomson@arm.com>
PR target/89324
* gcc.dg/rtl/aarch64/subs_adds_sp.c: New test.
* gfortran.fortran-torture/compile/pr89324.f90: New test.
From-SVN: r269122
2019-02-22 Richard Biener <rguenther@suse.de>
c-family/
* c-pch.c (no_checksum): Remove.
(pch_init): Remove assertion that executable_checksum is not
all zero.
(c_common_valid_pch): Likewise.
From-SVN: r269113
While doing more testing I found a couple of issues with my BTI patches.
This patch fixes them:
1) Remove a reference to return address key. The original patch was written
based on a different not yet committed patch ([PATCH 3/3][GCC][AARCH64] Add
support for pointer authentication B key) and I missed out on cleaning this
up. This is hidden behind the configuration option and thus went unnoticed.
2) Add a missed case for adding the BTI instruction in thunk functions.
*** gcc/ChangeLog ***
2019-02-22 Sudakshina Das <sudi.das@arm.com>
* config/aarch64/aarch64.c (aarch64_output_mi_thunk): Add bti
instruction if enabled.
(aarch64_override_options): Remove reference to return address key.
From-SVN: r269112
... to avoid compilation overhead, and to keep simple '-foffload=[...]'
handling in test cases.
libgomp/
* testsuite/libgomp.oacc-c++/c++.exp: Specify
"-foffload=$offload_target".
* testsuite/libgomp.oacc-c/c.exp: Likewise.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
* testsuite/lib/libgomp.exp
(check_effective_target_openacc_nvidia_accel_configured): Remove,
as (conceptually) merged into
check_effective_target_openacc_nvidia_accel_selected. Adjust all
users.
From-SVN: r269109
... instead of having an incomplete local implementation.
With these changes in place, we can then also revert the work-around r267213
"[nvptx] Unify C/Fortran routine handling in nvptx_goacc_validate_dims".
gcc/fortran/
PR fortran/72741
* gfortran.h (oacc_routine_lop): New enum.
(symbol_attribute): Use it.
* openmp.c (gfc_oacc_routine_dims): Replace with...
(gfc_oacc_routine_lop): ... this new function.
(gfc_match_oacc_routine): Adjust.
* trans-decl.c (add_attributes_to_decl): Likewise.
gcc/
PR fortran/72741
* omp-general.c (oacc_replace_fn_attrib): Mostly split out into...
(oacc_replace_fn_attrib_attr): ... this new function.
* omp-general.h (oacc_replace_fn_attrib_attr): New prototype.
* config/nvptx/nvptx.c (nvptx_goacc_validate_dims_1): Revert workaround.
gcc/testsuite/
PR fortran/72741
* gfortran.dg/goacc/classify-routine.f95: Adjust.
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r269105
..., which were committed as part of, but logically don't belong into r261813
"Update OpenACC data clause semantics to the 2.5 behavior", and which confuse
later changes.
gcc/fortran/
* openmp.c (gfc_match_oacc_declare): Revert earlier changes.
gcc/testsuite/
* c-c++-common/goacc/routine-5.c: Revert earlier changes.
* g++.dg/goacc/template.C: Likewise.
From-SVN: r269104
... which has been present (with HSA offloading configured) ever since this
test case got added.
gcc/testsuite/
PR fortran/78027
* gfortran.dg/goacc/pr78027.f90: Add 'dg-additional-options "-Wno-hsa"'.
From-SVN: r269103
gcc/c/
* c-parser.c (c_parser_oacc_shape_clause): Add loc formal
parameter. Adjust all users.
(c_parser_oacc_simple_clause): Replace parser with loc formal
parameter. Adjust all users.
gcc/cp/
* parser.c (cp_parser_oacc_simple_clause): Remove parser formal
parameter, move loc formal parameter to the front. Adjust all
users.
(cp_parser_oacc_shape_clause): Add loc formal parameter. Adjust
all users.
From-SVN: r269102
This patch adds support for the Neoverse N1 [1]. This CPU was previously supported through the Ares codename.
-mcpu=ares is retained as an alias of the new -mcpu=neoverse-n1.
Bootstrapped and tested on arm-none-linux-gnueabihf.
* config/arm/arm-cpus.in (ares): Rename to...
(neoverse-n1): ... This. Add ares as alias.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Likewise.
* doc/invoke.txt (ARM Options): Document neoverse-n1.
From-SVN: r269101
This patch adds -mcpu and -mtune support for the Neoverse E1 CPU [1].
The new option is -mcpu=neoverse-e1.
Bootstrapped and tested on aarch64-none-linux-gnu.
* config/aarch64/aarch64-cores.def (neoverse-e1): Define.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.texi (AArch64 Options): Document neoverse-e1 -mcpu option.
From-SVN: r269100
This patch adds support for the Neoverse N1 CPU [1]. This was supported in GCC earlier through the codename Ares,
which it now replaces. -mcpu=ares is still accepted as there's been a binutils release supporting it,
but the internal structures are renamed to use Neoverse N1-related identifiers.
Bootstrapped and tested on aarch64-none-linux-gnu.
* config/aarch64/aarch64.c (ares_tunings): Rename to...
(neoversen1_tunings): ... This.
* config/aarch64/aarch64-cores.def (ares): Change tuning to the above.
(neoverse-n1): New CPU.
* config/aarch64/aarch64-tune.md: Regenerate.
* doc/invoke.txt (AArch64 Options): Document neoverse-n1.
From-SVN: r269099
2019-02-22 Richard Biener <rguenther@suse.de>
PR middle-end/87609
* cfghooks.h (dependence_hash): New typedef.
(struct copy_bb_data): New type.
(cfg_hooks::duplicate_block): Adjust to take a copy_bb_data argument.
(duplicate_block): Likewise.
* cfghooks.c (duplicate_block): Pass down copy_bb_data.
(copy_bbs): Create and pass down copy_bb_data.
* cfgrtl.c (cfg_layout_duplicate_bb): Adjust.
(rtl_duplicate_bb): Likewise.
* tree-cfg.c (gimple_duplicate_bb): If the copy_bb_data arg is not NULL
remap dependence info.
* gcc.dg/torture/restrict-7.c: New testcase.
From-SVN: r269098
2019-02-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/87609
* tree-core.h (tree_base): Document special clique values.
* tree-inline.c (remap_dependence_clique): Do not use the
special clique value of one.
(maybe_set_dependence_info): Use clique one.
(clear_dependence_clique): New callback.
(compute_dependence_clique): Clear clique one from all refs
before assigning it (again).
From-SVN: r269097
* configure.host (abi_baseline_pair): Adjust for SPARC64/Linux.
* config/abi/post/sparc64-linux-gnu: New directory.
* config/abi/post/sparc64-linux-gnu/baseline_symbols.txt: New file.
* config/abi/post/sparc64-linux-gnu/32: New directory.
* config/abi/post/sparc64-linux-gnu/32/baseline_symbols.txt: New file.
From-SVN: r269096
The standard says that in a generic lambda we should speculatively capture
'this' if we see a call to an overload set that contains a non-static member
function, but it seems wrong to reject the program if we can't capture,
since it might not actually be needed.
* lambda.c (lambda_expr_this_capture): Change add_capture_p to int.
(maybe_generic_this_capture): Pass -1.
From-SVN: r269095
We mostly use is_normal_capture_proxy to decide whether or not to use
DECL_CAPTURED_VARIABLE; we could just check whether it's set. VLA capture
is still mostly broken, but this fixes this ICE.
* lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
From-SVN: r269094
The members of an explicit specialization of a class template don't have the
template parameters of that class template, so we shouldn't try to provide
arguments for them. Only set outer_args when the class is an instantiation.
* pt.c (do_class_deduction): Don't include explicit specialization
args in outer_args.
From-SVN: r269093