gcc.git
5 years ago[Fortran] Fix column of %C diagnostic location
Tobias Burnus [Fri, 4 Oct 2019 09:29:31 +0000 (11:29 +0200)]
[Fortran] Fix column of %C diagnostic location

        gcc/fortran/
        * error (error_print, gfc_format_decoder): Fix off-by one issue with %C.

        gcc/testsuite/
        * gfortran.dg/use_without_only_1.f90: Update column num in dg-warning.

From-SVN: r276567

5 years agore PR target/91982 (gcc.target/aarch64/sve/clastb_*.c tests failing with segfault)
Richard Biener [Fri, 4 Oct 2019 09:18:26 +0000 (09:18 +0000)]
re PR target/91982 (gcc.target/aarch64/sve/clastb_*.c tests failing with segfault)

2019-10-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/91982
* tree-vect-loop.c (vectorizable_live_operation): Also guard
against EXTRACT_LAST_REDUCTION.
* tree-vect-stmts.c (vect_transform_stmt): Likewise.

From-SVN: r276566

5 years agoAdjust various comments and rename some functions in range-op.cc to
Aldy Hernandez [Fri, 4 Oct 2019 07:08:56 +0000 (07:08 +0000)]
Adjust various comments and rename some functions in range-op.cc to
improve readability.

From-SVN: r276564

5 years agore PR c++/71504 ([C++11] constexpr fails with multidimensional arrays)
Jakub Jelinek [Fri, 4 Oct 2019 06:56:02 +0000 (08:56 +0200)]
re PR c++/71504 ([C++11] constexpr fails with multidimensional arrays)

PR c++/71504
* constexpr.c (cxx_fold_indirect_ref_1): New function.
(cxx_fold_indirect_ref): Use it.

* g++.dg/cpp0x/constexpr-array21.C: New test.
* g++.dg/cpp1y/constexpr-array7.C: New test.
* g++.dg/cpp1z/constexpr-array1.C: New test.

2019-10-04  Jason Merrill  <jason@redhat.com>

PR c++/71504
* g++.dg/cpp0x/constexpr-array20.C: New test.

From-SVN: r276563

5 years agore PR c++/91974 (function not sequenced before function argument)
Jakub Jelinek [Fri, 4 Oct 2019 06:54:05 +0000 (08:54 +0200)]
re PR c++/91974 (function not sequenced before function argument)

PR c++/91974
* cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For
-fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated
before any arguments.  Additionally, ensure CALL_EXPR_FN that isn't
invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary.

* g++.dg/cpp1z/eval-order5.C: New test.

From-SVN: r276562

5 years agoinvoke.texi (-Wshadow=global, [...]): Fix description.
Bernd Edlinger [Fri, 4 Oct 2019 05:42:08 +0000 (05:42 +0000)]
invoke.texi (-Wshadow=global, [...]): Fix description.

2019-10-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * doc/invoke.texi (-Wshadow=global, -Wshadow=local,
        -Wshadow=compatible-local): Fix description.
        Add an example where -Wshadow=compatible-local does not
        warn.

From-SVN: r276561

5 years agoDaily bump.
GCC Administrator [Fri, 4 Oct 2019 00:16:26 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r276560

5 years agofptr.c: Disable -Warray-bounds warning.
John David Anglin [Thu, 3 Oct 2019 23:51:42 +0000 (23:51 +0000)]
fptr.c: Disable -Warray-bounds warning.

* config/pa/fptr.c: Disable -Warray-bounds warning.

From-SVN: r276556

5 years agopa.h (MAX_PCREL17F_OFFSET): Adjust.
John David Anglin [Thu, 3 Oct 2019 23:32:53 +0000 (23:32 +0000)]
pa.h (MAX_PCREL17F_OFFSET): Adjust.

* config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust.

From-SVN: r276555

5 years agopa.c (pa_output_call): Remove 64-bit sibcall sequence.
John David Anglin [Thu, 3 Oct 2019 22:39:49 +0000 (22:39 +0000)]
pa.c (pa_output_call): Remove 64-bit sibcall sequence.

* config/pa/pa.c (pa_output_call): Remove 64-bit sibcall sequence.
(pa_attr_length_call): Adjust length for 64-bit plabel sequence.

From-SVN: r276543

5 years agoexpr.c (emit_block_move_hints): Slightly cleaner fix to can_move_by_pieces issue.
Aaron Sawdey [Thu, 3 Oct 2019 22:19:14 +0000 (22:19 +0000)]
expr.c (emit_block_move_hints): Slightly cleaner fix to can_move_by_pieces issue.

2019-10-03  Aaron Sawdey <acsawdey@linux.ibm.com>

* expr.c (emit_block_move_hints): Slightly cleaner fix to
can_move_by_pieces issue.

From-SVN: r276542

5 years agorust-demangle.c (looks_like_rust): Remove.
Eduard-Mihai Burtescu [Thu, 3 Oct 2019 21:54:47 +0000 (23:54 +0200)]
rust-demangle.c (looks_like_rust): Remove.

* rust-demangle.c (looks_like_rust): Remove.
(rust_is_mangled): Don't check escapes.
(is_prefixed_hash): Allow 0-9a-f permutations.
(rust_demangle_sym): Don't bail on unknown escapes.
* testsuite/rust-demangle-expected: Update 'main::$99$' test.

From-SVN: r276539

5 years agore PR fortran/91497 (-Wconversion warns when doing explicit type conversion)
Steven G. Kargl [Thu, 3 Oct 2019 20:46:26 +0000 (20:46 +0000)]
re PR fortran/91497 (-Wconversion warns when doing explicit type conversion)

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

5 years ago[Darwin] Pick up SDKROOT as the sysroot fallback.
Iain Sandoe [Thu, 3 Oct 2019 20:19:18 +0000 (20:19 +0000)]
[Darwin] Pick up SDKROOT as the sysroot fallback.

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

5 years ago* g++.dg/tree-ssa/pr61034.C: Add --param max-inline-insns-single-O2=200.
Jan Hubicka [Thu, 3 Oct 2019 19:45:23 +0000 (21:45 +0200)]
* g++.dg/tree-ssa/pr61034.C: Add --param max-inline-insns-single-O2=200.

From-SVN: r276527

5 years agore PR target/91769 (wrong code with -O2 on MIPS)
Dragan Mladjenovic [Thu, 3 Oct 2019 19:17:20 +0000 (19:17 +0000)]
re PR target/91769 (wrong code with -O2 on MIPS)

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

5 years agoLibgomp magic offset value self-documentation
Julian Brown [Thu, 3 Oct 2019 17:48:36 +0000 (17:48 +0000)]
Libgomp magic offset value self-documentation

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

5 years agoprimary.c (match_real_constant): Remove shadowing local vars.
Bernd Edlinger [Thu, 3 Oct 2019 17:03:43 +0000 (17:03 +0000)]
primary.c (match_real_constant): Remove shadowing local vars.

2019-10-03  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * primary.c (match_real_constant): Remove shadowing local vars.
        Rename local vars.  Fix undefined behavior in loop termination.
        (gfc_convert_to_structure_constructor): Rename local var.

From-SVN: r276518

5 years agoparams.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT, [...]): New.
Jan Hubicka [Thu, 3 Oct 2019 15:08:21 +0000 (17:08 +0200)]
params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT, [...]): New.

* params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT,
PARAM_INLINE_HEURISTICS_HINT_PERCENT_O2): New.
* doc/invoke.texi (inline-heuristics-hint-percent,
inline-heuristics-hint-percent-O2): Document.
* tree-inline.c (inline_insns_single, inline_insns_auto): Add new
hint attribute.
(can_inline_edge_by_limits_p): Use it.

From-SVN: r276516

5 years agoAvoid reserved identifier in include/parallel/multiway_merge.h
Rainer Orth [Thu, 3 Oct 2019 14:35:35 +0000 (14:35 +0000)]
Avoid reserved identifier in include/parallel/multiway_merge.h

* include/parallel/multiway_merge.h (_RAIter3): Replace _C by _Cp.

From-SVN: r276515

5 years agoCheck init_priority in g++.dg/cpp0x/gen-attrs-67.C
Rainer Orth [Thu, 3 Oct 2019 13:23:52 +0000 (13:23 +0000)]
Check init_priority in g++.dg/cpp0x/gen-attrs-67.C

gcc/testsuite:
* g++.dg/cpp0x/gen-attrs-67.C: Expect constructor priorities error
on any !init_priority target.

From-SVN: r276510

5 years ago[arm] Fix rtl-checking failure in arm_print_value
Richard Sandiford [Thu, 3 Oct 2019 13:05:31 +0000 (13:05 +0000)]
[arm] Fix rtl-checking failure in arm_print_value

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

5 years agore PR jit/91928 (libgccjit fails on subsequent compilations in ipa-cp)
Andrea Corallo [Thu, 3 Oct 2019 12:39:55 +0000 (12:39 +0000)]
re PR jit/91928 (libgccjit fails on subsequent compilations in ipa-cp)

PR jit/91928

* ipa-cp.c (ipa_cp_c_finalize): Release ipcp_transformation_sum.
* ipa-prop.c (ipcp_free_transformation_sum): New function.
* ipa-prop.h (ipcp_free_transformation_sum): Add declaration.

From-SVN: r276507

5 years agore PR fortran/84487 (Large rodate section increase in 465.tonto with r254427)
Thomas Koenig [Thu, 3 Oct 2019 12:39:42 +0000 (12:39 +0000)]
re PR fortran/84487 (Large rodate section increase in 465.tonto with r254427)

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

5 years agoCharacter typenames in errors and warnings
Mark Eggleston [Thu, 3 Oct 2019 09:40:23 +0000 (09:40 +0000)]
Character typenames in errors and warnings

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

5 years agoMakefile.in (OBJS): Add range.o and range-op.o.
Aldy Hernandez [Thu, 3 Oct 2019 08:08:50 +0000 (08:08 +0000)]
Makefile.in (OBJS): Add range.o and range-op.o.

* Makefile.in (OBJS): Add range.o and range-op.o.
Remove wide-int-range.o.
* function-tests.c (test_ranges): New.
(function_tests_c_tests): Call test_ranges.
* ipa-cp.c (ipa_vr_operation_and_type_effects): Call
range_fold_unary_expr instead of extract_range_from_unary_expr.
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Same.
* range-op.cc: New file.
* range-op.h: New file.
* range.cc: New file.
* range.h: New file.
* selftest.h (range_tests): New prototype.
* ssa.h: Include range.h.
* tree-vrp.c (value_range_base::value_range_base): New
constructors.
(value_range_base::singleton_p): Do not call
ranges_from_anti_range until sure we will need to.
(value_range_base::type): Rename gcc_assert to
gcc_checking_assert.
(vrp_val_is_max): New argument.
(vrp_val_is_min): Same.
(wide_int_range_set_zero_nonzero_bits): Move from
wide-int-range.cc.
(extract_range_into_wide_ints): Remove.
(extract_range_from_multiplicative_op): Remove.
(extract_range_from_pointer_plus_expr): Abstract POINTER_PLUS code
from extract_range_from_binary_expr.
(extract_range_from_plus_minus_expr): Abstract PLUS/MINUS code
from extract_range_from_binary_expr.
(extract_range_from_binary_expr): Remove.
(normalize_for_range_ops): New.
(range_fold_binary_expr): New.
(range_fold_unary_expr): New.
(value_range_base::num_pairs): New.
(value_range_base::lower_bound): New.
(value_range_base::upper_bound): New.
(value_range_base::upper_bound): New.
(value_range_base::contains_p): New.
(value_range_base::invert): New.
(value_range_base::union_): New.
(value_range_base::intersect): New.
(range_compatible_p): New.
(value_range_base::operator==): New.
(determine_value_range_1): Call range_fold_*expr instead of
extract_range_from_*expr.
* tree-vrp.h (class value_range_base): Add new constructors.
Add methods for union_, intersect, operator==, contains_p,
num_pairs, lower_bound, upper_bound, invert.
(vrp_val_is_min): Add handle_pointers argument.
(vrp_val_is_max): Same.
(extract_range_from_unary_expr): Remove.
(extract_range_from_binary_expr): Remove.
(range_fold_unary_expr): New.
(range_fold_binary_expr): New.
* vr-values.c (vr_values::extract_range_from_binary_expr): Call
range_fold_binary_expr instead of extract_range_from_binary_expr.
(vr_values::extract_range_basic): Same.
(vr_values::extract_range_from_unary_expr): Call
range_fold_unary_expr instead of extract_range_from_unary_expr.
* wide-int-range.cc: Remove.
* wide-int-range.h: Remove.

From-SVN: r276504

5 years agoUndo unintended change to predicates.md in subversion id 276498
Michael Meissner [Thu, 3 Oct 2019 00:17:56 +0000 (00:17 +0000)]
Undo unintended change to predicates.md in subversion id 276498

From-SVN: r276503

5 years agoDaily bump.
GCC Administrator [Thu, 3 Oct 2019 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r276502

5 years agoUse the SIGNED_16BIT_OFFSET_EXTRA_P macro for 16-bit signed tests.
Michael Meissner [Thu, 3 Oct 2019 00:13:40 +0000 (00:13 +0000)]
Use the SIGNED_16BIT_OFFSET_EXTRA_P macro for 16-bit signed tests.

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

5 years agoDefine WIDTH macros for C2x.
Joseph Myers [Wed, 2 Oct 2019 23:50:58 +0000 (00:50 +0100)]
Define WIDTH macros for C2x.

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

5 years agoinit.c (build_new): Use cp_expr_loc_or_input_loc in two places.
Paolo Carlini [Wed, 2 Oct 2019 23:23:51 +0000 (23:23 +0000)]
init.c (build_new): Use cp_expr_loc_or_input_loc in two places.

/cp
2019-10-03  Paolo Carlini  <paolo.carlini@oracle.com>

* init.c (build_new): Use cp_expr_loc_or_input_loc in two places.
* name-lookup.c (do_pushdecl): Use DECL_SOURCE_LOCATION.
(push_class_level_binding_1): Likewise.
(set_decl_namespace): Likewise.

/testsuite
2019-10-03  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/integral-array-size-1.C: New.
* g++.dg/cpp0x/alias-decl-1.C: Test location(s) too.
* g++.dg/init/new43.C: Likewise.
* g++.dg/lookup/friend12.C: Likewise.
* g++.dg/lookup/pr79766.C: Likewise.
* g++.dg/lookup/pr84375.C: Likewise.
* g++.dg/other/new-size-type.C: Likewise.

From-SVN: r276496

5 years agore PR rtl-optimization/91976 (RTL check: expected code 'const_int', have 'reg' in...
Jakub Jelinek [Wed, 2 Oct 2019 22:33:39 +0000 (00:33 +0200)]
re PR rtl-optimization/91976 (RTL check: expected code 'const_int', have 'reg' in emit_block_move_hints, at expr.c:1627)

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

5 years agoconstexpr.c (cxx_eval_constant_expression): If not skipping upon entry to body...
Jakub Jelinek [Wed, 2 Oct 2019 22:32:56 +0000 (00:32 +0200)]
constexpr.c (cxx_eval_constant_expression): If not skipping upon entry to body...

* 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

5 years agoconstexpr.c (cxx_eval_store_expression): Formatting fix.
Jakub Jelinek [Wed, 2 Oct 2019 22:31:58 +0000 (00:31 +0200)]
constexpr.c (cxx_eval_store_expression): Formatting fix.

* constexpr.c (cxx_eval_store_expression): Formatting fix.  Handle
const_object_being_modified with array type.

From-SVN: r276493

5 years agoAdd changelog entries for r276491.
Martin Sebor [Wed, 2 Oct 2019 22:04:00 +0000 (16:04 -0600)]
Add changelog entries for r276491.

From-SVN: r276492

5 years agoPR tree-optimization/80936 - bcmp, bcopy, and bzero not declared nonnull
Martin Sebor [Wed, 2 Oct 2019 22:00:42 +0000 (16:00 -0600)]
PR tree-optimization/80936 - bcmp, bcopy, and bzero not declared nonnull

gcc/testsuite/ChangeLog:

PR tree-optimization/80936
* gcc.dg/Wnonnull-2.c: New test.
* gcc.dg/Wnonnull-3.c: New test.
* gcc.dg/nonnull-3.c: Expect more warnings.

gcc/ChangeLog:

PR tree-optimization/80936
* builtins.def (bcmp, bcopy, bzero): Declare nonnull.

From-SVN: r276491

5 years agoFix ALL_REGS thinko in initialisation of function_used_regs
Richard Sandiford [Wed, 2 Oct 2019 21:19:35 +0000 (21:19 +0000)]
Fix ALL_REGS thinko in initialisation of function_used_regs

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

5 years agoruntime: mark go-context.S as no-executable-stack and split-stack supported
Ian Lance Taylor [Wed, 2 Oct 2019 20:11:35 +0000 (20:11 +0000)]
runtime: mark go-context.S as no-executable-stack and split-stack supported

    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

5 years agoImprove C++ fold caching efficiency.
Jason Merrill [Wed, 2 Oct 2019 20:01:42 +0000 (16:01 -0400)]
Improve C++ fold caching efficiency.

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

5 years agoAdd some hash_map_safe_* functions like vec_safe_*.
Jason Merrill [Wed, 2 Oct 2019 19:26:47 +0000 (15:26 -0400)]
Add some hash_map_safe_* functions like vec_safe_*.

gcc/
* hash-map.h (default_hash_map_size): New variable.
(create_ggc): Use it as default argument.
(hash_map_maybe_create, hash_map_safe_get)
(hash_map_safe_get_or_insert, hash_map_safe_put): New fns.
gcc/cp/
* constexpr.c (maybe_initialize_fundef_copies_table): Remove.
(get_fundef_copy): Use hash_map_safe_get_or_insert.
* cp-objcp-common.c (cp_get_debug_type): Use hash_map_safe_*.
* decl.c (store_decomp_type): Remove.
(cp_finish_decomp): Use hash_map_safe_put.
* init.c (get_nsdmi): Use hash_map_safe_*.
* pt.c (store_defaulted_ttp, lookup_defaulted_ttp): Remove.
(add_defaults_to_ttp): Use hash_map_safe_*.

From-SVN: r276484

5 years agoTestsuite, remove alloca header
Andreas Tobler [Wed, 2 Oct 2019 19:05:35 +0000 (21:05 +0200)]
Testsuite, remove alloca header

2019-10-02  Andreas Tobler  <andreast@gcc.gnu.org>

* testsuite/libgomp.oacc-c-c++-common/loop-default.h: Remove alloca.h
include. Replace alloca () with __builtin_alloca ().
* testsuite/libgomp.oacc-c-c++-common/loop-dim-default.c: Likewise.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r276479

5 years agore PR fortran/91784 (ICE in gfc_real2complex, at fortran/arith.c:2208)
Steven G. Kargl [Wed, 2 Oct 2019 17:17:55 +0000 (17:17 +0000)]
re PR fortran/91784 (ICE in gfc_real2complex, at fortran/arith.c:2208)

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

5 years agore PR fortran/91785 (ICE in check_assumed_size_reference, at fortran/resolve.c:1601)
Steven G. Kargl [Wed, 2 Oct 2019 17:09:45 +0000 (17:09 +0000)]
re PR fortran/91785 (ICE in check_assumed_size_reference, at fortran/resolve.c:1601)

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

5 years agore PR fortran/91942 (ICE in match_vtag, at fortran/io.c:1485)
Steven G. Kargl [Wed, 2 Oct 2019 17:04:57 +0000 (17:04 +0000)]
re PR fortran/91942 (ICE in match_vtag, at fortran/io.c:1485)

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

5 years agore PR fortran/91943 (ICE in gfc_conv_constant_to_tree, at fortran/trans-const.c:370)
Steven G. Kargl [Wed, 2 Oct 2019 17:01:30 +0000 (17:01 +0000)]
re PR fortran/91943 (ICE in gfc_conv_constant_to_tree, at fortran/trans-const.c:370)

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

5 years agocif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, [...]): New.
Jan Hubicka [Wed, 2 Oct 2019 16:02:16 +0000 (16:02 +0000)]
cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, [...]): New.

* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT,
MAX_INLINE_INSNS_AUTO_O2_LIMIT): New.
* ipa-inline.c (inline_insns_single, inline_insns_auto): New functions.
(can_inline_edge_by_limits_p): Use it.
(big_speedup_p): Use PARAM_INLINE_MIN_SPEEDUP_O2.
(want_inline_small_function_p): Use O2 bounds.
(edge_badness): LIkewise.
* opts.c (default_options): Add OPT_finline_functions.
* params.def (PARAM_INLINE_MIN_SPEEDUP_O2,
PARAM_MAX_INLINE_INSNS_SINGLE_O2, PARAM_MAX_INLINE_INSNS_AUTO_O2):
New parameters.

* g++.dg/tree-ssa/pr53844.C: Add -fno-inline-functions --param
max-inline-insns-single-O2=200.
* gcc.c-torture/execute/builtins/builtins.exp: Add
-fno-inline-functions to additional_flags.
* gcc.dg/ipa/inline-7.c: Add -fno-inline-functions.
* gcc.dg/optimize-bswapsi-5.c: Add -fno-inline-functions.
* gcc.dg/tree-ssa/ssa-thread-12.c: Add --param
early-inlining-insns-O2=14 -fno-inline-functions; revert previous
change.
* gcc.dg/winline-3.c: Use --param max-inline-insns-single-O2=1
--param inline-min-speedup-O2=100
instead of --param max-inline-insns-single=1 --param
inline-min-speedup=100

* invoke.texi (-finline-functions): Update documentation.
(max-inline-insns-single-O2, max-inline-insns-auto-O2,
inline-min-speedup-O2): Document.
(early-inlining-insns-O2): Simplify docs.

From-SVN: r276470

5 years agocif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, [...]): New.
Jan Hubicka [Wed, 2 Oct 2019 16:01:47 +0000 (16:01 +0000)]
cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT, [...]): New.

* cif-code.def (MAX_INLINE_INSNS_SINGLE_O2_LIMIT,
MAX_INLINE_INSNS_AUTO_O2_LIMIT): New.
* ipa-inline.c (inline_insns_single, inline_insns_auto): New functions.
(can_inline_edge_by_limits_p): Use it.
(big_speedup_p): Use PARAM_INLINE_MIN_SPEEDUP_O2.
(want_inline_small_function_p): Use O2 bounds.
(edge_badness): LIkewise.
* opts.c (default_options): Add OPT_finline_functions.
* params.def (PARAM_INLINE_MIN_SPEEDUP_O2,
PARAM_MAX_INLINE_INSNS_SINGLE_O2, PARAM_MAX_INLINE_INSNS_AUTO_O2):
New parameters.

* g++.dg/tree-ssa/pr53844.C: Add -fno-inline-functions --param
max-inline-insns-single-O2=200.
* gcc.c-torture/execute/builtins/builtins.exp: Add
-fno-inline-functions to additional_flags.
* gcc.dg/ipa/inline-7.c: Add -fno-inline-functions.
* gcc.dg/optimize-bswapsi-5.c: Add -fno-inline-functions.
* gcc.dg/tree-ssa/ssa-thread-12.c: Add --param
early-inlining-insns-O2=14 -fno-inline-functions; revert previous
change.
* gcc.dg/winline-3.c: Use --param max-inline-insns-single-O2=1
--param inline-min-speedup-O2=100
instead of --param max-inline-insns-single=1 --param
inline-min-speedup=100

* invoke.texi (-finline-functions): Update documentation.
(max-inline-insns-single-O2, max-inline-insns-auto-O2,
inline-min-speedup-O2): Document.
(early-inlining-insns-O2): Simplify docs.

From-SVN: r276469

5 years agoRemove greedy wildcards from libstdc++ linker script
Jonathan Wakely [Wed, 2 Oct 2019 15:52:41 +0000 (16:52 +0100)]
Remove greedy wildcards from libstdc++ linker script

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

5 years agoifcvt: improve cost estimation (PR 87047)
Alexander Monakov [Wed, 2 Oct 2019 15:37:12 +0000 (18:37 +0300)]
ifcvt: improve cost estimation (PR 87047)

PR rtl-optimization/87047
* ifcvt.c (average_cost): New static function.  Use it...
(noce_process_if_block): ... here.

testsuite/
* gcc.dg/pr87047.c: New test.

From-SVN: r276466

5 years ago[PR testsuite/91842] Skip gcc.dg/ipa/ipa-sra-19.c on power
Martin Jambor [Wed, 2 Oct 2019 15:09:37 +0000 (17:09 +0200)]
[PR testsuite/91842] Skip gcc.dg/ipa/ipa-sra-19.c on power

2019-10-02  Martin Jambor  <mjambor@suse.cz>

PR testsuite/91842
* gcc.dg/ipa/ipa-sra-19.c: Skip on powerpc.

From-SVN: r276465

5 years agomodule.c (load_commons): Initialize flags to 0 to silecne -Wmaybe-uninitialized warning.
Jan Hubicka [Wed, 2 Oct 2019 15:07:52 +0000 (15:07 +0000)]
module.c (load_commons): Initialize flags to 0 to silecne -Wmaybe-uninitialized warning.

* module.c (load_commons): Initialize flags to 0 to silecne
-Wmaybe-uninitialized warning.
(read_module): Likewise for n and comp_name.

From-SVN: r276464

5 years agoDocument non-conformance of parallel mode to recent C++ standards
Jonathan Wakely [Wed, 2 Oct 2019 14:56:57 +0000 (15:56 +0100)]
Document non-conformance of parallel mode to recent C++ standards

* doc/xml/manual/parallel_mode.xml: Add caveat about support for
recent standards.
* doc/html/*: Regenerate.

From-SVN: r276463

5 years agors6000-protos.h (expand_block_move): Change prototype.
Aaron Sawdey [Wed, 2 Oct 2019 14:26:09 +0000 (14:26 +0000)]
rs6000-protos.h (expand_block_move): Change prototype.

2019-10-02  Aaron Sawdey <acsawdey@linux.ibm.com>

* config/rs6000/rs6000-protos.h (expand_block_move): Change prototype.
* config/rs6000/rs6000-string.c (expand_block_move): Add
might_overlap parm.
* config/rs6000/rs6000.md (movmemsi): Add new pattern.
(cpymemsi): Add might_overlap parm to expand_block_move() call.

From-SVN: r276462

5 years agobuiltins.c (expand_builtin_memory_copy_args): Add might_overlap parm.
Aaron Sawdey [Wed, 2 Oct 2019 14:23:51 +0000 (14:23 +0000)]
builtins.c (expand_builtin_memory_copy_args): Add might_overlap parm.

2019-10-02  Aaron Sawdey <acsawdey@linux.ibm.com>

* builtins.c (expand_builtin_memory_copy_args): Add might_overlap parm.
(expand_builtin_memcpy): Use might_overlap parm.
(expand_builtin_mempcpy_args): Use might_overlap parm.
(expand_builtin_memmove): Call expand_builtin_memory_copy_args.
(expand_builtin_memory_copy_args): Add might_overlap parm.
* expr.c (emit_block_move_via_cpymem): Rename to
emit_block_move_via_pattern, add might_overlap parm, use cpymem
or movmem optab as appropriate.
(emit_block_move_hints): Add might_overlap parm, do the right
thing for might_overlap==true.
* expr.h (emit_block_move_hints): Update prototype.

From-SVN: r276461

5 years agotree-eh.h (unsplit_eh_edges): Declare.
Eric Botcazou [Wed, 2 Oct 2019 13:35:40 +0000 (13:35 +0000)]
tree-eh.h (unsplit_eh_edges): Declare.

* 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

5 years agoFix shadowing in globalize_reg
Richard Sandiford [Wed, 2 Oct 2019 13:12:37 +0000 (13:12 +0000)]
Fix shadowing in globalize_reg

2019-10-02  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* reginfo.c (globalize_reg): Fix shadowed variable in
function_abis walk.

From-SVN: r276457

5 years agoFix MIPS call-clobbered-*.c tests
Richard Sandiford [Wed, 2 Oct 2019 13:11:45 +0000 (13:11 +0000)]
Fix MIPS call-clobbered-*.c tests

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

5 years ago[PATCH] Do not check call type compatibility when cloning cgraph-edges
Martin Jambor [Wed, 2 Oct 2019 12:44:35 +0000 (14:44 +0200)]
[PATCH] Do not check call type compatibility when cloning cgraph-edges

2019-10-02  Martin Jambor  <mjambor@suse.cz>

* cgraph.c (symbol_table::create_edge): New parameter cloning_p,
do not compute some stuff when set.
(cgraph_node::create_edge): Likewise.
(cgraph_node::create_indirect_edge): Renamed last parameter to
coning_p and flipped its meaning, don't even calculate
inline_failed when set.
* cgraph.h (cgraph_node::create_edge): Add new parameter.
(symbol_table::::create_edge): Likewise.
(cgraph_node::create_indirect_edge): Rename last parameter, flip
the default value.
* cgraphclones.c (cgraph_edge::clone): Pass true cloning_p to all
call graph edge creating functions.

From-SVN: r276455

5 years agore PR c++/91222 (507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt...
Jan Hubicka [Wed, 2 Oct 2019 12:41:36 +0000 (14:41 +0200)]
re PR c++/91222 (507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt.c:1006 since r273571)

PR c++/91222
* ipa-devirt.c (warn_types_mismatch): Fix conditional on anonymous
namespace types.

From-SVN: r276454

5 years ago[ARC] Pass along "-mcode-density" flag to "as"
Shahab Vahedi [Wed, 2 Oct 2019 11:26:15 +0000 (11:26 +0000)]
[ARC] Pass along "-mcode-density" flag to "as"

This change makes sure that if the driver is invoked with
"-mcode-density" flag, then the assembler will receive it
too.

gcc/
xxxx-xx-xx  Shahab Vahedi  <shahab@synopsys.com>

        * config/arc/arc.h (ASM_SPEC): pass -mcode-density

From-SVN: r276453

5 years agotree-vectorizer.h (vect_transform_reduction): Declare.
Richard Biener [Wed, 2 Oct 2019 11:24:27 +0000 (11:24 +0000)]
tree-vectorizer.h (vect_transform_reduction): Declare.

2019-10-02  Richard Biener  <rguenther@suse.de>

* tree-vectorizer.h (vect_transform_reduction): Declare.
* tree-vect-stmts.c (vect_transform_stmt): Use it.
* tree-vect-loop.c (vectorizable_reduction): Split out reduction
stmt transform to ...
(vect_transform_reduction): ... this.

From-SVN: r276452

5 years agoSupport OpenMP's use_device_addr in Fortran
Tobias Burnus [Wed, 2 Oct 2019 10:57:54 +0000 (10:57 +0000)]
Support OpenMP's use_device_addr in Fortran

        gcc/fortran/
* dump-parse-tree.c (show_omp_clauses): Handle OMP_LIST_USE_DEVICE_ADDR.
* gfortran.h (enum): Add OMP_LIST_USE_DEVICE_ADDR.
* openmp.c (omp_mask1): Likewise.
(gfc_match_omp_clauses): Match 'use_device_addr'.
(OMP_TARGET_DATA_CLAUSES): Add OMP_LIST_USE_DEVICE_ADDR.
(resolve_omp_clauses): Add it; add is_device_ptr checks.

        gcc/testsuite/
* gfortran.dg/gomp/is_device_ptr-1.f90: New.

From-SVN: r276449

5 years agore PR c++/91606 (Optimization leads to invalid code)
Richard Biener [Wed, 2 Oct 2019 10:54:10 +0000 (10:54 +0000)]
re PR c++/91606 (Optimization leads to invalid code)

2019-10-02  Richard Biener  <rguenther@suse.de>

PR c++/91606
* decl.c (build_ptrmemfunc_type): Mark pointer-to-member
fat pointer structure members as DECL_NONADDRESSABLE_P.

* g++.dg/torture/pr91606.C: New testcase.

From-SVN: r276448

5 years agoImprove OMP/ACC error diagnostic in Fortran
Tobias Burnus [Wed, 2 Oct 2019 10:50:23 +0000 (10:50 +0000)]
Improve OMP/ACC error diagnostic in Fortran

gcc/fortran/
* openmp.c (gfc_match_omp_clauses): Show a clause-parsing
error if none was rised before.
* parse.c (matcha, matcho): If error occurred after
OpenMP/OpenACC directive matched, do not try other directives.

gcc/testsuite/
* gfortran.dg/goacc/asyncwait-1.f95: Handle new error message.
* gfortran.dg/goacc/asyncwait-2.f95: Likewise
* gfortran.dg/goacc/asyncwait-3.f95: Likewise
* gfortran.dg/goacc/asyncwait-4.f95: Likewise
* gfortran.dg/goacc/default-2.f: Likewise
* gfortran.dg/goacc/enter-exit-data.f95: Likewise
* gfortran.dg/goacc/if.f95: Likewise
* gfortran.dg/goacc/list.f95: Likewise
* gfortran.dg/goacc/literal.f95: Likewise
* gfortran.dg/goacc/loop-2-kernels-tile.f: Likewise95
* gfortran.dg/goacc/loop-2-parallel-tile.f95: Likewise
* gfortran.dg/goacc/loop-7.f95: Likewise
* gfortran.dg/goacc/parallel-kernels-cla: Likewiseuses.f95
* gfortran.dg/goacc/routine-6.f90: Likewise
* gfortran.dg/goacc/several-directives.f95: Likewise
* gfortran.dg/goacc/sie.f95: Likewise
* gfortran.dg/goacc/tile-1.f90: Likewise
* gfortran.dg/goacc/update-if_present-2.: Likewisef90
* gfortran.dg/gomp/declare-simd-1.f90: Likewise
* gfortran.dg/gomp/pr29759.f90: Likewise

From-SVN: r276447

5 years agoFix coding style comment, missed in last commit
Tobias Burnus [Wed, 2 Oct 2019 10:41:59 +0000 (10:41 +0000)]
Fix coding style comment, missed in last commit

        * trans-openmp.c (gfc_omp_is_optional_argument): Fix coding
        style.

From-SVN: r276446

5 years agoFix omp target issue with Fortran optional arguments
Tobias Burnus [Wed, 2 Oct 2019 10:33:42 +0000 (10:33 +0000)]
Fix omp target issue with Fortran optional arguments

        gcc/
        * omp-low.c (lower_omp_target): Dereference optional argument
        to work with the right pointer.

        gcc/testsuite/
        * libgomp/testsuite/libgomp.fortran/use_device_ptr-optional-1.f90: New.

From-SVN: r276445

5 years agof95-lang.c (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Define to gfc_omp_is_optional_argument.
Kwok Cheung Yeung [Wed, 2 Oct 2019 10:31:02 +0000 (10:31 +0000)]
f95-lang.c (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Define to gfc_omp_is_optional_argument.

2019-10-02  Kwok Cheung Yeung  <kcy@codesourcery.com>

        gcc/fortran/
        * f95-lang.c (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Define to
        gfc_omp_is_optional_argument.
        * trans-decl.c (create_function_arglist): Set
        GFC_DECL_OPTIONAL_ARGUMENT in the generated decl if the parameter is
        optional.
        * trans-openmp.c (gfc_omp_is_optional_argument): New.
        (gfc_omp_privatize_by_reference): Return true if the decl is an
        optional pass-by-reference argument.
        * trans.h (gfc_omp_is_optional_argument): New declaration.
        (lang_decl): Add new optional_arg field.
        (GFC_DECL_OPTIONAL_ARGUMENT): New macro.

        gcc/
        * langhooks-def.h (LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT): Default to
        false.
        (LANG_HOOKS_DECLS): Add LANG_HOOKS_OMP_IS_OPTIONAL_ARGUMENT.
        * langhooks.h (omp_is_optional_argument): New hook.
        * omp-general.c (omp_is_optional_argument): New.
        * omp-general.h (omp_is_optional_argument): New declaration.
        * omp-low.c (lower_omp_target): Create temporary for received value
        and take the address for new_var if the original variable was a
        DECL_BY_REFERENCE.  Use size of referenced object when a
        pass-by-reference optional argument used as argument to firstprivate.

From-SVN: r276444

5 years agointernal.h (enum include_type): Remove trailing comma.
Richard Biener [Wed, 2 Oct 2019 10:22:05 +0000 (10:22 +0000)]
internal.h (enum include_type): Remove trailing comma.

2019-10-02  Richard Biener  <rguenther@suse.de>

* internal.h (enum include_type): Remove trailing comma.

From-SVN: r276443

5 years agore PR tree-optimization/91940 (__builtin_bswap16 loop optimization)
Jakub Jelinek [Wed, 2 Oct 2019 10:18:50 +0000 (12:18 +0200)]
re PR tree-optimization/91940 (__builtin_bswap16 loop optimization)

PR tree-optimization/91940
* tree-vect-patterns.c: Include tree-vector-builder.h and
vec-perm-indices.h.
(vect_recog_rotate_pattern): Also handle __builtin_bswap16, either by
unpromoting the argument back to uint16_t, or by converting into a
rotate, or into shifts plus ior.

* gcc.dg/vect/vect-bswap16.c: Add -msse4 on x86, run on all targets,
expect vectorized 1 loops message on both vect_bswap and sse4_runtime
targets.
* gcc.dg/vect/vect-bswap16a.c: New test.

From-SVN: r276442

5 years agotree-vectorizer.h (stmt_vec_info_type::cycle_phi_info_type): New.
Richard Biener [Wed, 2 Oct 2019 09:21:57 +0000 (09:21 +0000)]
tree-vectorizer.h (stmt_vec_info_type::cycle_phi_info_type): New.

2019-10-02  Richard Biener  <rguenther@suse.de>

* tree-vectorizer.h (stmt_vec_info_type::cycle_phi_info_type):
New.
(vect_transform_cycle_phi): Declare.
* tree-vect-stmts.c (vect_transform_stmt): Call
vect_transform_cycle_phi.
* tree-vect-loop.c (vectorizable_reduction): Split out
PHI transformation stage to ...
(vect_transform_cycle_phi): ... here.

From-SVN: r276441

5 years ago[LRA] Don't make eliminable registers live (PR91957)
Richard Sandiford [Wed, 2 Oct 2019 07:37:10 +0000 (07:37 +0000)]
[LRA] Don't make eliminable registers live (PR91957)

One effect of https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00802.html
was to strengthen the sanity check in lra_assigns so that it checks
whether reg_renumber is consistent with the whole conflict set.
This duly tripped on csky for a pseudo that had been allocated
to the eliminated frame pointer.  (csky doesn't have a separate
hard frame pointer.)

lra-lives uses:

/* Set of hard regs (except eliminable ones) currently live.  */
static HARD_REG_SET hard_regs_live;

to track the set of live directly-referenced hard registers, and it
correctly implements the exclusion when setting up the initial set:

  hard_regs_live &= ~eliminable_regset;

But later calls to make_hard_regno_live and make_hard_regno_dead
would process eliminable registers like other registers, recording
conflicts for them and potentially making them live.  (Note that
after r266086, make_hard_regno_dead adds conflicts for registers
that are already marked dead.)  I think this would have had the
effect of pessimising targets without a separate hard frame pointer.

2019-10-02  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR middle-end/91957
* lra-lives.c (make_hard_regno_dead): Don't record conflicts for
eliminable registers.
(make_hard_regno_live): Likewise, and don't make them live.

From-SVN: r276440

5 years agore PR libfortran/91593 (Implicit enum conversions in libgfortran/io/transfer.c)
Jerry DeLisle [Wed, 2 Oct 2019 02:35:14 +0000 (02:35 +0000)]
re PR libfortran/91593 (Implicit enum conversions in libgfortran/io/transfer.c)

2019-10-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libfortran/91593
* io/read.c (read_decimal): Cast constant to size_t to turn off
a bogus warning.
* io/write.c (btoa_big): Use memset in lieu of setting the null
byte in a string buffer to turn off a bogus warning.

From-SVN: r276439

5 years agoDaily bump.
GCC Administrator [Wed, 2 Oct 2019 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r276438

5 years agoHandle :: tokens in C for C2x.
Joseph Myers [Wed, 2 Oct 2019 00:08:40 +0000 (01:08 +0100)]
Handle :: tokens in C for C2x.

As part of adding [[]]-style attributes, C2x adds the token :: for use
in scoped attribute names.

This patch adds corresponding support for that token in C to GCC.  The
token is supported both for C2x and for older gnu* standards (on the
basis that extensions are normally supported in older gnu* versions;
people will expect to be able to use [[]] attributes, before C2x is
the default, without needing to use -std=gnu2x).

There are no cases in older C standards where the token : can be
followed by a token starting with : in syntactically valid sources;
the only cases the :: token could break in older standard C thus are
ones involving concatenation of pp-tokens where the result does not
end up as tokens (e.g., gets stringized).  In GNU C extensions, the
main case where :: might appear in existing sources is in asm
statements, and the C parser is thus made to handle it like two
consecutive : tokens, which the C++ parser already does.  A limited
test of various positionings of :: in asm statements is added to the
testsuite (in particular, to cover the syntax error when :: means too
many colons but a single : would be OK), but existing tests cover a
variety of styles there anyway.

Technically there are cases in Objective-C and OpenMP for which this
also changes how previously valid code is lexed: the objc-selector-arg
syntax allows multiple consecutive : tokens (although I don't think
they are particularly useful there), while OpenMP syntax includes
array section syntax such as [:] which, before :: was a token, could
also be written as [::> (there might be other OpenMP cases potentially
affected, I didn't check all the OpenMP syntax in detail).  I don't
think either of those cases affects the basis for supporting the ::
token in all -std=gnu* modes, or that there is any obvious need to
special-case handling of CPP_SCOPE tokens for those constructs the way
there is for asm statements.

cpp_avoid_paste, which determines when spaces need adding between
tokens in preprocessed output where there wouldn't otherwise be
whitespace between them (e.g. if stringized), already inserts space
between : and : unconditionally, rather than only for C++, so no
change is needed there (but a C2x test is added that such space is
indeed inserted).

Bootstrapped with no regressions on x86-64-pc-linux-gnu.

gcc/c:
* c-parser.c (c_parser_asm_statement): Handle CPP_SCOPE like two
CPP_COLON tokens.

gcc/testsuite:
* gcc.dg/asm-scope-1.c, gcc.dg/cpp/c11-scope-1.c,
gcc.dg/cpp/c17-scope-1.c, gcc.dg/cpp/c2x-scope-1.c,
gcc.dg/cpp/c2x-scope-2.c, gcc.dg/cpp/c90-scope-1.c,
gcc.dg/cpp/c94-scope-1.c, gcc.dg/cpp/c99-scope-1.c,
gcc.dg/cpp/gnu11-scope-1.c, gcc.dg/cpp/gnu17-scope-1.c,
gcc.dg/cpp/gnu89-scope-1.c, gcc.dg/cpp/gnu99-scope-1.c: New tests.

libcpp:
* include/cpplib.h (struct cpp_options): Add member scope.
* init.c (struct lang_flags, lang_defaults): Likewise.
(cpp_set_lang): Set scope member of pfile.
* lex.c (_cpp_lex_direct): Test CPP_OPTION (pfile, scope) not
CPP_OPTION (pfile, cplusplus) for creating CPP_SCOPE tokens.

From-SVN: r276434

5 years agoSupport prefixes in diagnostic_show_locus
David Malcolm [Tue, 1 Oct 2019 21:58:17 +0000 (21:58 +0000)]
Support prefixes in diagnostic_show_locus

Previously, diagnostic_show_locus saved and restored the pretty_printer's
prefix, clearing it for the duration of the call.

I have a patch kit in development that can benefit from applying a prefix
to the output of d_s_l, so this patch adds support to d_s_l for printing
such prefixes.

It moves the save and restore of the pp's prefix from d_s_l to all of its
callers, and updates diagnostic-show-locus.c to properly handle prefixes.

gcc/c-family/ChangeLog:
* c-opts.c (c_diagnostic_finalizer): Temporarily clear prefix when
calling diagnostic_show_locus, rather than destroying it afterwards.

gcc/ChangeLog:
* diagnostic-show-locus.c (layout::print_gap_in_line_numbering):
Call pp_emit_prefix.
(layout::print_source_line): Likewise.
(layout::start_annotation_line): Likewise.
(diagnostic_show_locus): Remove call to temporarily clear the
prefix.
(selftest::test_one_liner_fixit_remove): Add test coverage for the
interaction of pp_set_prefix with rulers and fix-it hints.
* diagnostic.c (default_diagnostic_finalizer): Temporarily clear
prefix when calling diagnostic_show_locus, rather than destroying
it afterwards.
(print_parseable_fixits): Temporarily clear prefix.
* pretty-print.c (pp_format): Save and restore line_length, rather
than assuming it is zero.
(pp_output_formatted_text): Remove assertion that line_length is
zero.

gcc/fortran/ChangeLog:
* error.c (gfc_diagnostic_starter): Clear the prefix before
calling diagnostic_show_locus.

gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic_group_plugin.c (test_begin_group_cb):
Clear the prefix before emitting the "END GROUP" line.
* gcc.dg/plugin/diagnostic_plugin_test_show_locus.c
(custom_diagnostic_finalizer): Temporarily clear prefix when
calling diagnostic_show_locus, rather than destroying it
afterwards.

From-SVN: r276433

5 years agoMake some new algorithms work in parallel mode
Jonathan Wakely [Tue, 1 Oct 2019 21:02:27 +0000 (22:02 +0100)]
Make some new algorithms work in parallel mode

* include/experimental/algorithm (experimental::sample): Qualify call
to __sample correctly.
* include/parallel/algo.h (sample, for_each_n): Add using-declarations
for algorithms that don't have parallel implementations.

From-SVN: r276432

5 years agoMake some parallel mode algorithms usable in constexpr contexts
Jonathan Wakely [Tue, 1 Oct 2019 21:02:22 +0000 (22:02 +0100)]
Make some parallel mode algorithms usable in constexpr contexts

This makes the __parallel::equal and __parallel:lexicographical_compare
algorithms usable in constant expressions, by dispatching to the
sequential algorithm when calling during constant evaluation.

* include/parallel/algobase.h (equal, lexicographical_compare): Add
_GLIBCXX20_CONSTEXPR and dispatch to sequential algorithm when being
constant evaluated.
* include/parallel/algorithmfwd.h (equal, lexicographical_compare):
Add _GLIBCXX20_CONSTEXPR.

From-SVN: r276431

5 years agoDisable tests that aren't valid in parallel mode
Jonathan Wakely [Tue, 1 Oct 2019 21:02:17 +0000 (22:02 +0100)]
Disable tests that aren't valid in parallel mode

Tests that depend on debug mode can't be tested in parallel mode.

* testsuite/17_intro/using_namespace_std_tr1_neg.cc: Skip test for
parallel mode.
* testsuite/20_util/hash/84998.cc: Likewise.
* testsuite/23_containers/deque/types/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/forward_list/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/list/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/map/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/multimap/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/multiset/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/set/pmr_typedefs_debug.cc: Likewise.
* testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc:
Likewise.
* testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
Likewise.
* testsuite/23_containers/vector/types/pmr_typedefs_debug.cc: Likewise.
* testsuite/25_algorithms/binary_search/partitioned.cc: Likewise.
* testsuite/25_algorithms/copy/86658.cc: Likewise.
* testsuite/25_algorithms/equal_range/partitioned.cc: Likewise.
* testsuite/25_algorithms/lexicographical_compare/71545.cc: Likewise.
* testsuite/25_algorithms/lower_bound/partitioned.cc: Likewise.
* testsuite/25_algorithms/upper_bound/partitioned.cc: Likewise.

From-SVN: r276430

5 years agoFix non-reserved names in Parallel Mode headers
Jonathan Wakely [Tue, 1 Oct 2019 21:02:01 +0000 (22:02 +0100)]
Fix non-reserved names in Parallel Mode headers

* include/parallel/algo.h: Replace non-reserved names.
* include/parallel/multiway_merge.h: Likewise.
* include/parallel/multiway_mergesort.h: Likewise.
* include/parallel/numericfwd.h: Likewise.
* testsuite/17_intro/names.cc: Add RAI to test macros.

From-SVN: r276429

5 years agoRegenerate `liboffloadmic/plugin/configure' for r275564 ("[ARM/FDPIC v6 02/24] [ARM...
Maciej W. Rozycki [Tue, 1 Oct 2019 19:57:44 +0000 (19:57 +0000)]
Regenerate `liboffloadmic/plugin/configure' for r275564 ("[ARM/FDPIC v6 02/24] [ARM] FDPIC...

Regenerate `liboffloadmic/plugin/configure' for r275564 ("[ARM/FDPIC v6
02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure
scripts") too.

liboffloadmic/
* plugin/configure: Regenerate.

From-SVN: r276428

5 years agotree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): Rename to ...
Jan Hubicka [Tue, 1 Oct 2019 19:46:09 +0000 (21:46 +0200)]
tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): Rename to ...

* tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p):
Rename to ...
(nonoverlapping_refs_since_match_p): ... this; handle also
ARRAY_REFs.
(alias_stats): Update stats.
(dump_alias_stats): Likewise.
(cheap_array_ref_low_bound): New function.
(aliasing_matching_component_refs_p): Add partial_overlap
argument;
pass it to nonoverlapping_refs_since_match_p.
(aliasing_component_refs_walk): Update call of
aliasing_matching_component_refs_p
(nonoverlapping_array_refs_p): New function.
(decl_refs_may_alias_p, indirect_ref_may_alias_decl_p,
indirect_refs_may_alias_p): Update calls of
nonoverlapping_refs_since_match_p.

* gcc.dg/tree-ssa/alias-access-path-10.c: New testcase.
* gcc.dg/tree-ssa/alias-access-path-11.c: New testcase.

From-SVN: r276427

5 years agore PR target/85401 (segfault building code for VAX)
Maya Rashish [Tue, 1 Oct 2019 19:25:31 +0000 (19:25 +0000)]
re PR target/85401 (segfault building code for VAX)

PR target/85401
* ira-color.c (allocno_copy_cost_saving): Call
ira_init_register_move_cost_if_necessary.

From-SVN: r276426

5 years agolibada: Respect `--enable-version-specific-runtime-libs'
Maciej W. Rozycki [Tue, 1 Oct 2019 19:14:11 +0000 (19:14 +0000)]
libada: Respect `--enable-version-specific-runtime-libs'

Respect the `--enable-version-specific-runtime-libs' configuration
option in libada/, so that shared gnatlib libraries will be installed
in non-version-specific $(toolexeclibdir) if requested.  In a
cross-compilation environment this helps setting up a consistent
sysroot, which can then be shared between the host and the target
system.

This lets one have `libgnarl-10.so' and `libgnat-10.so' installed in say
/usr/lib and /usr/$(target_alias)/lib for a native and a cross-build
respectively, rather than in /usr/lib/gcc/$(target_alias)/10.0.0/adalib.

Update the settings of $(toolexecdir) and $(toolexeclibdir), unused till
now, to keep the current arrangement in the version-specific case and
make the new option to be enabled by default, unlike with the other
target libraries, so as to keep existing people's build infrastructure
unaffected.

Of course if someone does use `--disable-version-specific-runtime-libs'
already, then the installation location of shared gnatlib libraries will
change, but presumably this is what they do want anyway as the current
situation where the option is ignored in libada/ only is an anomaly
really rather than one that is expected or desired.

gcc/ada/
* gcc-interface/Makefile.in (ADA_RTL_DSO_DIR): New variable.
(install-gnatlib): Use it in place of ADA_RTL_OBJ_DIR for shared
library installation.

libada/
* Makefile.in (toolexecdir, toolexeclibdir): New variables.
(LIBADA_FLAGS_TO_PASS): Add `toolexeclibdir'.
* configure.ac: Add `--enable-version-specific-runtime-libs'.
Update version-specific `toolexecdir' and `toolexeclibdir' from
ADA_RTL_OBJ_DIR from gcc/ada/gcc-interface/Makefile.in.
* configure: Regenerate.

From-SVN: r276424

5 years agolibada: Remove racy duplicate gnatlib installation
Maciej W. Rozycki [Tue, 1 Oct 2019 18:38:58 +0000 (18:38 +0000)]
libada: Remove racy duplicate gnatlib installation

For some reason, presumably historical, the `install-gnatlib' target for
the default multilib is invoked twice, once via the `ada.install-common'
target in `gcc/ada/gcc-interface/Make-lang.in' invoked from gcc/ and
again via the `install-libada' target in libada/.

Apart from doing the same twice this is actually harmful in sufficiently
parallelized `make' invocation, as the removal of old files performed
within the `install-gnatlib' recipe in the former case actually races
with the installation of new files done in the latter case, causing the
recipe to fail and abort, however non-fatally, having not completed the
installation of all the built files needed for the newly-built compiler
to work correctly.

This can be observed with a native `x86_64-linux-gnu' bootstrap:

make[4]: Entering directory '.../gcc/ada'
rm -rf .../lib/gcc/x86_64-linux-gnu/10.0.0/adalib
rm: cannot remove '.../lib/gcc/x86_64-linux-gnu/10.0.0/adalib': Directory not empty
make[4]: *** [gcc-interface/Makefile:512: install-gnatlib] Error 1
make[4]: Leaving directory '.../gcc/ada'
make[3]: *** [.../gcc/ada/gcc-interface/Make-lang.in:853: install-gnatlib] Error 2
make[2]: [.../gcc/ada/gcc-interface/Make-lang.in:829: ada.install-common] Error 2 (ignored)

which then causes missing files to be reported when an attempt is made
to use the newly-installed non-functional compiler to build a
`riscv-linux-gnu' cross-compiler:

(cd ada/bldtools/sinfo; gnatmake -q xsinfo ; ./xsinfo sinfo.h )
error: "ada.ali" not found, "ada.ads" must be compiled
error: "s-memory.ali" not found, "s-memory.adb" must be compiled
gnatmake: *** bind failed.
/bin/sh: ./xsinfo: No such file or directory
make[2]: *** [.../gcc/ada/Make-generated.in:45: ada/sinfo.h] Error 127
make[2]: Leaving directory '.../gcc'
make[1]: *** [Makefile:4369: all-gcc] Error 2
make[1]: Leaving directory '...'
make: *** [Makefile:965: all] Error 2

Depending on timing `.../lib/gcc/x86_64-linux-gnu/10.0.0/adainclude' may
cause an installation failure instead and the resulting compiler may be
non-functional in a different way.

Only invoke `install-gnatlib' from within gcc/ then if a legacy build
process is being used with libada disabled and gnatlib built manually
with `make -C gcc gnatlib'.

gcc/
* Makefile.in (gnat_install_lib): New variable.
* configure.ac: Substitute it.
* configure: Regenerate.

gcc/ada/
* gcc-interface/Make-lang.in (ada.install-common): Split into...
(gnat-install-tools, gnat-install-lib): ... these.

From-SVN: r276422

5 years agore PR c++/91222 (507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt...
Jan Hubicka [Tue, 1 Oct 2019 18:21:31 +0000 (20:21 +0200)]
re PR c++/91222 (507.cactuBSSN_r build fails in warn_types_mismatch at ipa-devirt.c:1006 since r273571)

PR lto/91222
* ipa-devirt.c (warn_types_mismatch): Do not ICE when anonymous type
is matched with non-C++ type
* g++.dg/lto/odr-6_0.C: New testcase.
* g++.dg/lto/odr-6_1.c: New testcase.

From-SVN: r276420

5 years agossa-thread-12.c: Fix warning introduced by my previous change.
Jan Hubicka [Tue, 1 Oct 2019 18:03:13 +0000 (20:03 +0200)]
ssa-thread-12.c: Fix warning introduced by my previous change.

* gcc.dg/tree-ssa/ssa-thread-12.c: Fix warning introduced by my
previous change.

From-SVN: r276418

5 years agotree-if-conv.c (tree_if_conversion): Move call to ifcvt_local_dce after local CSE.
Prathamesh Kulkarni [Tue, 1 Oct 2019 17:10:01 +0000 (17:10 +0000)]
tree-if-conv.c (tree_if_conversion): Move call to ifcvt_local_dce after local CSE.

2019-10-01  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>

* tree-if-conv.c (tree_if_conversion): Move call to ifcvt_local_dce
after local CSE.

From-SVN: r276417

5 years agoinvoke.texi (early-inlining-insns-O2): Document.
Jan Hubicka [Tue, 1 Oct 2019 16:58:35 +0000 (18:58 +0200)]
invoke.texi (early-inlining-insns-O2): Document.

* doc/invoke.texi (early-inlining-insns-O2): Document.
(early-inlining-insns): Update.
* params.def (early-inlining-insns-O2): New bound.
(early-inlining-insns): Update docs.
* ipa-inline.c (want_early_inline_function_p): Use new bound.

* g++.dg/tree-ssa/pr61034.C: Set early-inlining-insns-O2=14.
* g++.dg/tree-ssa/pr8781.C: Likewise.
* g++.dg/warn/Wstringop-truncation-1.C: Likewise.
* gcc.dg/ipa/pr63416.c: likewise.
* gcc.dg/vect/pr66142.c: Likewise.
* gcc.dg/tree-ssa/ssa-thread-12.c: Mark compure_idf inline.

From-SVN: r276416

5 years agore PR c++/91925 (-fpack-struct causes a decltype with template to ICE)
Jakub Jelinek [Tue, 1 Oct 2019 16:19:04 +0000 (18:19 +0200)]
re PR c++/91925 (-fpack-struct causes a decltype with template to ICE)

PR c++/91925
* c-warn.c (check_alignment_of_packed_member): Ignore FIELD_DECLs
with NULL DECL_FIELD_OFFSET.

* g++.dg/conversion/packed2.C: New test.

From-SVN: r276415

5 years agore PR c++/88562 (Incorrect pointer incrementing on SH4)
Oleg Endo [Tue, 1 Oct 2019 14:55:34 +0000 (14:55 +0000)]
re PR c++/88562 (Incorrect pointer incrementing on SH4)

gcc/
2019-10-01  Oleg Endo  <olegendo@gcc.gnu.org>

PR target/88562
* config/sh/sh.c (sh_extending_set_of_reg::use_as_extended_reg): Use
sh_check_add_incdec_notes to preserve REG_INC notes when replacing
a memory access insn.

From-SVN: r276411

5 years agors6000-p8swap.c (rtx_is_swappable_p): Don't swap vpmsumd.
William Schmidt [Tue, 1 Oct 2019 14:27:44 +0000 (14:27 +0000)]
rs6000-p8swap.c (rtx_is_swappable_p): Don't swap vpmsumd.

[gcc]

2019-10-01  Bill Schmidt  <wschmidt@linux.ibm.com>

* config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Don't swap
vpmsumd.

[gcc/testsuite]

2019-10-01  Bill Schmidt  <wschmdit@linux.ibm.com>

* gcc.target/powerpc/pr91275.c: New.

From-SVN: r276410

5 years agoS/390: Remove code duplication in vec_* comparison expanders
Ilya Leoshkevich [Tue, 1 Oct 2019 14:04:08 +0000 (14:04 +0000)]
S/390: Remove code duplication in vec_* comparison expanders

s390.md uses a lot of near-identical expanders that perform dispatching
to other expanders based on operand types. Since the following patch
would require even more of these, avoid copy-pasting the code by
generating these expanders using an iterator.

gcc/ChangeLog:

2019-10-01  Ilya Leoshkevich  <iii@linux.ibm.com>

PR target/77918
* config/s390/s390.c (s390_expand_vec_compare): Use
gen_vec_cmpordered and gen_vec_cmpunordered.
* config/s390/vector.md (vec_cmpuneq, vec_cmpltgt, vec_ordered,
vec_unordered): Delete.
(vec_ordered<mode>): Rename to vec_cmpordered<mode>.
(vec_unordered<mode>): Rename to vec_cmpunordered<mode>.
(VEC_CMP_EXPAND): New iterator for the generic dispatcher.
(vec_cmp<code>): Generic dispatcher.

From-SVN: r276409

5 years agoS/390: Implement vcond expander for V1TI,V1TF
Ilya Leoshkevich [Tue, 1 Oct 2019 14:03:08 +0000 (14:03 +0000)]
S/390: Implement vcond expander for V1TI,V1TF

Currently gcc does not emit wf{c,k}* instructions when comparing long
double values.  Middle-end actually adds them in the first place, but
then veclower pass replaces them with floating point register pair
operations, because the corresponding expander is missing.

gcc/ChangeLog:

2019-10-01  Ilya Leoshkevich  <iii@linux.ibm.com>

PR target/77918
* config/s390/vector.md (V_HW): Add V1TI in order to make
vcond$a$b generate vcondv1tiv1tf.

From-SVN: r276408

5 years agoFix reload after function-abi patches (PR91948)
Richard Sandiford [Tue, 1 Oct 2019 12:55:16 +0000 (12:55 +0000)]
Fix reload after function-abi patches (PR91948)

The code was passing a pseudo rather than its allocated hard reg
to ira_need_caller_save_p.  Running under valgrind to reproduce
the failure also showed that ALLOCNO_CROSSED_CALLS_ABIS wasn't
being explicitly initialised.

2019-10-01  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR rtl-optimization/91948
* ira-build.c (ira_create_allocno): Initialize
ALLOCNO_CROSSED_CALLS_ABIS.
* ira-color.c (allocno_reload_assign): Pass hard_regno rather
than regno to ira_need_caller_save_p.

From-SVN: r276407

5 years agorecompute opt flags after opt level change
Alexandre Oliva [Tue, 1 Oct 2019 11:37:01 +0000 (11:37 +0000)]
recompute opt flags after opt level change

flag_omit_frame_pointer is set in machine-independent code depending
on the optimization level.  It is then overridden in x86
target-specific code depending on a macro defined by
--enable-frame-pointer.

Uses of attribute optimize go through machine-independent overriding
of flag_omit_frame_pointer, but the x86-specific overriding code did
NOT cover this flag, so, even if the attribute does not change the
optimization level, flag_omit_frame_pointer may end up with a
different value, and prevent inlining because of incompatible flags,
as detected by the gcc.dg/ipa/iinline-attr.c test on an
--enable-frame-pointer x86 toolchain.

for  gcc/ChangeLog

* config/i386/i386-options.c
(ix86_recompute_optlev_based_flags): New, moved out of...
(ix86_option_override_internal): ... this.  Call it.
(ix86_override_options_after_change): Call it here too.

From-SVN: r276405

5 years agoStore float for pow result test
Alexandre Oliva [Tue, 1 Oct 2019 11:36:47 +0000 (11:36 +0000)]
Store float for pow result test

Optimizing gcc.dg/torture/pr41094.c, the compiler computes the
constant value and short-circuits the whole thing.  At -O0, however,
on 32-bit x86, the call to pow() remains, and the program compares the
returned value in a stack register, with excess precision, with the
exact return value expected from pow().  If libm's pow() returns a
slightly off result, the compare fails.  If the value in the register
is stored in a separate variable, so it gets rounded to double
precision, and then compared, the compare passes.

It's not clear that the test was meant to detect libm's reliance on
rounding off the excess precision, but I guess it wasn't, so I propose
this slight change that enables it to pass regardless of the slight
inaccuracy of the C library in use.

for  gcc/testsuite/ChangeLog

* gcc.dg/torture/pr41094.c: Introduce intermediate variable.

From-SVN: r276404

5 years agoDWARF array bounds missing from C++ array definitions
Alexandre Oliva [Tue, 1 Oct 2019 11:36:31 +0000 (11:36 +0000)]
DWARF array bounds missing from C++ array definitions

A variable redeclaration or definition that provides additional type
information for it, e.g. outermost array bounds, is not reflected in
the debug information for the variable.  With this patch, the debug
info of the variable specialization gets a type attribute with the
adjusted type.

This patch affects mostly only array bounds.  However, when the
symbolic type used in a declaration and in a definition are different,
although they refer to the same type, debug information will end up
(correctly?) naming different symbolic types in the specification and
the definition.  Also, when a readonly declaration of an array loses
the readonly flag at the definition because of the initializer, the
definition may end up referencing a type while the specification
refers to a const-qualified version of that type.  If the type of the
variable is already const-qualified, e.g. an array of a const type,
the difference is meaningless.

for  gcc/ChangeLog

PR debug/91507
* dwarf2out.c (override_type_for_decl_p): New.
(gen_variable_die): Use it.

for  gcc/testsuite/ChangeLog

PR debug/91507
* gcc.dg/debug/dwarf2/array-0.c: New.
* gcc.dg/debug/dwarf2/array-1.c: New.
* gcc.dg/debug/dwarf2/array-2.c: New.
* gcc.dg/debug/dwarf2/array-3.c: New.
* g++.dg/debug/dwarf2/array-0.C: New.
* g++.dg/debug/dwarf2/array-1.C: New.
* g++.dg/debug/dwarf2/array-2.C: New.  Based on libstdc++-v3's
src/c++98/pool_allocator.cc:__pool_alloc_base::_S_heap_size.
* g++.dg/debug/dwarf2/array-3.C: New.  Based on
gcc's config/i386/i386-features.c:xlogue_layout::s_instances.
* g++.dg/debug/dwarf2/array-4.C: New.

From-SVN: r276403

5 years agotree-vect-loop.c (vectorizable_reduction): Move variables to where they are used.
Richard Biener [Tue, 1 Oct 2019 11:20:27 +0000 (11:20 +0000)]
tree-vect-loop.c (vectorizable_reduction): Move variables to where they are used.

2019-10-01  Richard Biener  <rguenther@suse.de>

* tree-vect-loop.c (vectorizable_reduction): Move variables
to where they are used.

From-SVN: r276402

5 years agoregrename: Use PC instead of CC0 to hide operands
Segher Boessenkool [Tue, 1 Oct 2019 11:12:03 +0000 (13:12 +0200)]
regrename: Use PC instead of CC0 to hide operands

The regrename pass temporarily changes some operand RTL to CC0 so that
note_stores and scan_rtx don't see those operands.  CC0 is deprecated
and we want to remove it, so we need to use something else here.
PC fits the bill fine.

* regrename.c (hide_operands): Use pc_rtx instead of cc0_rtx.
(build_def_use): Use PC instead of CC0 in a comment.

From-SVN: r276401

5 years agoAdd myself to MAINTAINERS file
Frederik Harwath [Tue, 1 Oct 2019 09:50:44 +0000 (09:50 +0000)]
Add myself to MAINTAINERS file

2019-10-01  Frederik Harwath <frederik@codesourcery.com>

 * MAINTAINERS: Add myself to Write After Approval

From-SVN: r276396