2019-10-03 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91497
* simplify.c (gfc_simplify_dble, simplify_intconv, gfc_simplify_real,
gfc_simplify_sngl): Disable -Wconversion and -Wconversion-extra
warnings for explicit conversion of literal constants.
2019-10-03 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91497
* gfortran.dg/pr91497.f90: New test.
From-SVN: r276532
For compatibility with xcrun and the behaviour of the clang driver, make use
of the setting of the SDKROOT environment variable when it is available.
This applies to both finding headers and libraries (i.e. it is also passed to
ld64).
Priority:
1. User's command-line specified --sysroot= or -isysroot.
2. The SDKROOT variable when set, and validated.
3. Any sysroot provided by --with-sysroot= configuration parameter.
SDKROOT is checked thus:
1. Presence.
2. That it starts with "/" (i.e. 'absolute').
3. That it is not "/" only (since that's the default).
4. That it is readable by the process executing the driver.
This is pretty much the same rule set as used by the clang driver.
NOTE: (3) might turn out to be overly restrictive in the case that we
have configured with --with-sysroot= and then we want to run on a system
with an installation of the headers/libraries in /. We can revisit this
if that turns out to be an important use-case.
So one can do:
xcrun --sdk macosx /path/to/gcc ....
and that provides the SDK path as the sysroot to GCC as expected.
CAVEAT: An unfortunate effect of the fact that "gcc" (and "g++") are
executables in the Xcode installation, which are found ahead of any such
named in the $PATH:
PATH=/path/to/gcc/install:$PATH
xcrun --sdk macosx gcc ....
does *not* work, instead that executes the clang from the xcode/commmand
line tools installation.
PATH=/path/to/gcc/install:$PATH
xcrun --sdk macosx x64_64-apple-darwinXX-gcc ...
does work as expected, however.
gcc/ChangeLog:
2019-10-03 Iain Sandoe <iain@sandoe.co.uk>
PR target/87243
* config/darwin-driver.c (maybe_get_sysroot_from_sdkroot): New.
(darwin_driver_init): Use the sysroot provided by SDKROOT when that
is available and the user has not set one on the command line.
From-SVN: r276530
Fix PR target/91769
This fixes the issue by checking that addr's base reg is not part of dest
multiword reg instead just checking the first reg of dest.
gcc/ChangeLog:
2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
PR target/91769
* config/mips/mips.c (mips_split_move): Use reg_overlap_mentioned_p
instead of REGNO equality check on addr.reg.
gcc/testsuite/ChangeLog:
2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
PR target/91769
* gcc.target/mips/pr91769.c: New test.
From-SVN: r276525
2019-10-02 Julian Brown <julian@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
libgomp/
* libgomp.h (OFFSET_INLINED, OFFSET_POINTER, OFFSET_STRUCT): Define.
* target.c (FIELD_TGT_EMPTY): Define.
(gomp_map_val): Use OFFSET_* macros instead of magic constants. Write
as switch instead of list of ifs.
(gomp_map_vars_internal): Use OFFSET_* and FIELD_TGT_EMPTY macros.
Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com>
From-SVN: r276519
Noticed while debugging the arm bootstrap failure.
2019-10-03 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* config/arm/arm.c (arm_print_value): Use real_to_decimal
to print CONST_DOUBLEs.
From-SVN: r276508
2019-10-03 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84487
* trans-decl.c (gfc_get_symbol_decl): For __def_init, set
DECL_ARTIFICAL and do not set TREE_READONLY.
2019-10-03 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84487
* gfortran.dg/typebound_call_22.f03: xfail.
From-SVN: r276506
Character type names now incorporate length, kind is only shown if
the default character is not being used.
Examples:
character(7) is reported as CHARACTER(7)
character(len=20,kind=4) is reported as CHARACTER(20,4)
dummy character variables with assumed length:
character(*) is reported as CHARACTER(*)
character(*,kind=4) is reported as CHARACTER(*,4)
From-SVN: r276505
2019-10-02 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/rs6000.c (mem_operand_gpr): Use
SIGNED_16BIT_OFFSET_EXTRA_P.
(mem_operand_ds_form): Use SIGNED_16BIT_OFFSET_EXTRA_P.
(rs6000_mode_dependent_address): Use SIGNED_16BIT_OFFSET_EXTRA_P.
From-SVN: r276498
As part of the integration of TS 18661-1 into C2x, many features
became unconditional features not depending on any feature test macro
being defined. This patch updates the conditionals on the *_WIDTH
macros in limits.h and stdint.h accordingly so that they are defined
for C2x. The macro CR_DECIMAL_DIG in float.h does still require
__STDC_WANT_IEC_60559_BFP_EXT__ to be defined, and a test for this is
added.
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc:
* ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Change
condition on WIDTH macros to [__STDC_WANT_IEC_60559_BFP_EXT__ ||
(__STDC_VERSION__ && __STDC_VERSION__ > 201710L)].
* glimits.h: Likewise.
gcc/testsuite:
* gcc.dg/cr-decimal-dig-2.c: New test.
* gcc.dg/limits-width-2.c: New test. Based on limits-width-1.c.
* gcc.dg/stdint-width-2.c: New test. Based on stdint-width-1.c.
From-SVN: r276497
PR rtl-optimization/91976
* expr.c (emit_block_move_hints): Don't call can_move_by_pieces if
size is not CONST_INT_P, set pieces_ok to false in that case. Simplify
CONST_INT_P (size) && pieces_ok to pieces_ok. Formatting fix.
From-SVN: r276495
* constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>: If
not skipping upon entry to body, run cleanup with the same *jump_target
as it started to run the cleanup even if the body returns, breaks or
continues.
(potential_constant_expression_1): Allow CLEANUP_STMT.
* g++.dg/ext/constexpr-attr-cleanup1.C: New test.
From-SVN: r276494
My change to the -fipa-ra bookkeeping used ALL_REGS as the supposedly
safe default assumption, but ALL_REGS isn't literally all registers,
just a close approximation.
This caused a bootstrap failure on arm-linux-gnu, where the condition
code register isn't in ALL_REGS and so was being masked out of some
call-clobbered sets.
2019-10-02 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* cgraph.c (cgraph_node::rtl_info): Use SET_HARD_REG_SET
instead of reg_class_contents[ALL_REGS].
From-SVN: r276489
The .note.GNU-stack section tells the linker that this object does not
require an executable stack.
The .note.GNU-split-stack section tells the linker that functions in
this object can be called directly by split-stack functions, without
require a large stack.
The .note.GNU-no-split-stack section tells the linker that functions
in this object do not have a split-stack prologue.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/198440
From-SVN: r276488
While looking at concepts caching I noticed that we were clearing the caches
unnecessarily for non-constant initialization, which shouldn't affect
folding.
* typeck2.c (store_init_value): Only clear_cv_and_fold_caches if the
value is constant.
From-SVN: r276487
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91784
* simplify.c (gfc_convert_constant): Simplify expression if the
expres ion type is EXPR_OP.
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91784
* gfortran.dg/pr91784.f90: New test.
From-SVN: r276474
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91785
* primary.c (gfc_match_varspec): Ensure an inquiry parameter has
it locus set.
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91785
* gfortran.dg/pr91785.f90: New test.
From-SVN: r276473
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91942
* io.c (match_vtag): Check for non-NULL result->symtree.
(match_out_tag): Check for invalid constant due to inquiry parameter.
(match_filepos): Instead of a syntax error, go to cleanup to get better
error messages.
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91942
* gfortran.dg/pr91587.f90: Update dg-error regex.
* gfortran.dg/pr91942.f90: New test.
From-SVN: r276472
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91943
* match.c (gfc_match_call): BOZ cannot be an actual argument in
a subroutine reference.
* resolve.c (resolve_function): BOZ cannot be an actual argument in
a function reference.
2019-10-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91943
gfortran.dg/pr91943.f90
From-SVN: r276471
The only symbols matched by std::e[a-q]* and std::e[s-z]* that are
supposed to be in the GLIBCXX_3.4 version are std::exception::* and
std::endl and std::ends. The latter two already have explicit patterns
matching them, so we just need to match std::exception::*.
This change ensures that any new symbols with a return type of
std::enable_if<...> are not added to the GLIBCXX_3.4 version.
* config/abi/pre/gnu.ver: Tighten up greedy wildcards.
From-SVN: r276468
* module.c (load_commons): Initialize flags to 0 to silecne
-Wmaybe-uninitialized warning.
(read_module): Likewise for n and comp_name.
From-SVN: r276464
* tree-eh.h (unsplit_eh_edges): Declare.
* tree-eh.c (maybe_remove_unreachable_handlers): Detect more cases.
(unsplit_eh_edges): New function wrapping unsplit_all_eh.
* gimple-ssa-store-merging.c: Include cfganal.h cfgcleanup.h except.h.
(struct store_immediate_info): Add lp_nr field.
(store_immediate_info::store_immediate_info): Add NR2 parameter and
initialize lp_nr with it.
(struct merged_store_group): Add lp_nr and only_constants fields.
(merged_store_group::merged_store_group): Initialize them.
(merged_store_group::can_be_merged_into): Deal with them.
(pass_store_merging): Rename terminate_and_release_chain into
terminate_and_process_chain.
(pass_store_merging::terminate_and_process_all_chains): Adjust to above
renaming and remove useless assertions.
(pass_store_merging::terminate_all_aliasing_chains): Small tweak.
(stmts_may_clobber_ref_p): Be prepared for different basic blocks.
(imm_store_chain_info::coalesce_immediate_stores): Use only_constants
instead of always recomputing it and compare lp_nr.
(imm_store_chain_info::output_merged_store): If the group is in an
active EH region, register new stores if they can throw. Moreover,
if the insertion has created new basic blocks, adjust the PHI nodes
of the post landing pad.
(imm_store_chain_info::output_merged_stores): If the original stores
are in an active EH region, deregister them.
(lhs_valid_for_store_merging_p): Prettify.
(adjust_bit_pos): New function extracted from...
(mem_valid_for_store_merging): ...here. Use it for the base address
and also for the offset if it is the addition of a constant.
(lp_nr_for_store): New function.
(pass_store_merging::process_store): Change return type to bool.
Call lp_nr_for_store to initialize the store info. Propagate the
return status of various called functions to the return value.
(store_valid_for_store_merging_p): New predicate.
(enum basic_block_status): New enumeration.
(get_status_for_store_merging): New function.
(pass_store_merging::execute): If the function can throw and catch
non-call exceptions, unsplit the EH edges on entry and clean up the
CFG on exit if something changed. Call get_status_for_store_merging
for every basic block and keep the chains open across basic blocks
when possible. Terminate and process open chains at the end, if any.
From-SVN: r276459
Jeff pointed out that gcc.target/mips/call-clobbered-4.c started
failing after the function-abi series. This is because IRA used
to treat partly call-clobbered registers as hard conflicts and
so wouldn't consider them for -fcaller-saves. Now that we treat
call clobbers the same way regardless of where they come from,
we can use $f21 as a caller-save register. This in turn means
that -Os is no longer a special case in call-clobbered-3.c.
(The new code is the same size as the old code.)
2019-10-02 Richard Sandiford <richard.sandiford@arm.com>
gcc/testsuite/
* gcc.target/mips/call-clobbered-3.c: Remove skip for -Os.
* gcc.target/mips/call-clobbered-4.c: Delete.
From-SVN: r276456