]> gcc.gnu.org Git - gcc.git/log
gcc.git
4 years agoMake vect_get_mask_type_for_stmt take a group size
Richard Sandiford [Fri, 29 Nov 2019 14:47:34 +0000 (14:47 +0000)]
Make vect_get_mask_type_for_stmt take a group size

This patch makes vect_get_mask_type_for_stmt and
get_mask_type_for_scalar_type take a group size instead of
the SLP node, so that later patches can call it before an
SLP node has been built.

2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vectorizer.h (get_mask_type_for_scalar_type): Replace
the slp_tree parameter with a group size parameter.
(vect_get_mask_type_for_stmt): Likewise.
* tree-vect-stmts.c (get_mask_type_for_scalar_type): Likewise.
(vect_get_mask_type_for_stmt): Likewise.
* tree-vect-slp.c (vect_slp_analyze_node_operations_1): Update
call accordingly.

From-SVN: r278849

4 years agoMake vectorizable_operation punt early on codes it doesn't handle
Richard Sandiford [Fri, 29 Nov 2019 14:47:28 +0000 (14:47 +0000)]
Make vectorizable_operation punt early on codes it doesn't handle

vectorizable_operation returned false for codes that are handled by
vectorizable_shift, but only after it had already done a lot of work.
Checking earlier should be more efficient and avoid polluting the logs
with duplicate info.

Also, there was no such early-out for comparisons or COND_EXPRs.
Fixing that avoids a false scan-tree-dump hit with a later patch.

2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vect-stmts.c (vectorizable_operation): Punt early
on codes that are handled elsewhere.

From-SVN: r278848

4 years agoImprove tree-vect-patterns.c handling of boolean comparisons
Richard Sandiford [Fri, 29 Nov 2019 14:47:20 +0000 (14:47 +0000)]
Improve tree-vect-patterns.c handling of boolean comparisons

vect_recog_bool_pattern assumed that a comparison between two booleans
should always become a comparison of vector mask types (implemented as an
XOR_EXPR).  But if the booleans in question are generated as data values
(e.g. because they're loaded directly from memory), we should treat them
like ordinary integers instead, just as we do for boolean logic ops whose
operands are loaded from memory.  vect_get_mask_type_for_stmt already
handled this case:

      /* We may compare boolean value loaded as vector of integers.
 Fix mask_type in such case.  */
      if (mask_type
  && !VECTOR_BOOLEAN_TYPE_P (mask_type)
  && gimple_code (stmt) == GIMPLE_ASSIGN
  && TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison)
mask_type = truth_type_for (mask_type);

and not handling it here complicated later patches.

The initial list of targets for vect_bool_cmp is deliberately conservative.

2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* doc/sourcebuild.texi (vect_bool_cmp): Document.
* tree-vect-patterns.c (search_type_for_mask_1): If neither
operand to a boolean comparison is a natural vector mask,
handle both operands like normal integers instead.

gcc/testsuite/
* gcc.dg/vect/vect-bool-cmp-2.c: New test.
* lib/target-supports.exp (check_effective_target_vect_bool_cmp): New
effective target procedure.

From-SVN: r278847

4 years agolibstdc++:: improve how pretty printers find node types (PR 91997)
Jonathan Wakely [Fri, 29 Nov 2019 14:47:03 +0000 (14:47 +0000)]
libstdc++:: improve how pretty printers find node types (PR 91997)

This fixes two related problems.

The iterators for node-based containers use nested typedefs such as
std::list<T>::iterator::_Node to denote their node types. As reported in
https://bugzilla.redhat.com/show_bug.cgi?id=1053438 those typedefs are
not always present in the debug info. That means the pretty printers
cannot find them using gdb.lookup_type (via the find_type helper).
Instead of looking up the nested typedefs this patch makes the printers
look up the actual class templates directly.

A related problem (and the original topic of PR 91997) is that GDB fails
to find types via gdb.lookup_type when printing a backtrace from a
non-C++ functiion: https://sourceware.org/bugzilla/show_bug.cgi?id=25234
That is also solved by not looking up the nested typedef.

PR libstdc++/91997
* python/libstdcxx/v6/printers.py (find_type): Fail more gracefully
if we run out of base classes to look at.
(llokup_templ_spec, lookup_node_type): New utilities to find node
types for node-based containers.
(StdListPrinter.children, NodeIteratorPrinter.__init__)
(NodeIteratorPrinter.to_string, StdSlistPrinter.children)
(StdSlistIteratorPrinter.to_string, StdRbtreeIteratorPrinter.__init__)
(StdMapPrinter.children, StdSetPrinter.children)
(StdForwardListPrinter.children): Use lookup_node_type instead of
find_type.
(StdListIteratorPrinter.__init__, StdFwdListIteratorPrinter.__init__):
Pass name of node type to NodeIteratorPrinter constructor.
(Tr1HashtableIterator.__init__): Rename argument.
(StdHashtableIterator.__init__): Likewise. Use lookup_templ_spec
instead of find_type.
* testsuite/libstdc++-prettyprinters/59161.cc: Remove workaround for
_Node typedef not being present in debuginfo.
* testsuite/libstdc++-prettyprinters/91997.cc: New test.

From-SVN: r278846

4 years agoFortran] OpenACC – permit common blocks in some clauses
Tobias Burnus [Fri, 29 Nov 2019 13:59:21 +0000 (13:59 +0000)]
Fortran] OpenACC – permit common blocks in some clauses

        * testsuite/libgomp.oacc-fortran/declare-5.f90: Extend by
        adding a common-block test case.

From-SVN: r278845

4 years agotree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Bail out early for too large...
Richard Biener [Fri, 29 Nov 2019 13:53:10 +0000 (13:53 +0000)]
tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Bail out early for too large objects.

2019-11-29  Richard Biener  <rguenther@suse.de>

* tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Bail
out early for too large objects.

From-SVN: r278844

4 years agoFortran] OpenACC – permit common blocks in some clauses
Tobias Burnus [Fri, 29 Nov 2019 13:49:44 +0000 (14:49 +0100)]
Fortran] OpenACC – permit common blocks in some clauses

        * fortran.dg/goacc/common-block-3.f90: Check that unused common-block
        variables do not get mapped.

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

4 years agoAdd an x86_64 test for PR 92476
Martin Jambor [Fri, 29 Nov 2019 13:36:47 +0000 (14:36 +0100)]
Add an x86_64 test for PR 92476

2019-11-29  Martin Jambor  <mjambor@suse.cz>

PR ipa/92476
        * g++.dg/lto/pr92476_[01].C: New test.

From-SVN: r278842

4 years agoipa-cp: Avoid ICEs when looking at expanded thunks and unoptimized functions
Martin Jambor [Fri, 29 Nov 2019 13:29:35 +0000 (14:29 +0100)]
ipa-cp: Avoid ICEs when looking at expanded thunks and unoptimized functions

2019-11-29  Martin Jambor  <mjambor@suse.cz>

PR ipa/92476
* ipa-cp.c (set_single_call_flag): Set node_calling_single_call in
the summary only if the summary exists.
(find_more_scalar_values_for_callers_subset): Check node_dead in
the summary only if the summary exists.
(ipcp_store_bits_results): Ignore nodes without lattices.
(ipcp_store_vr_results): Likewise.
* cgraphclones.c: Include ipa-fnsummary.h and ipa-prop.h and the
header files required by them.
(cgraph_node::expand_all_artificial_thunks): Analyze expanded thunks.

From-SVN: r278841

4 years agoDon't pass booleans as mask types to simd clones (PR 92710)
Richard Sandiford [Fri, 29 Nov 2019 13:04:56 +0000 (13:04 +0000)]
Don't pass booleans as mask types to simd clones (PR 92710)

In this PR we assigned a vector mask type to the result of a comparison
and then tried to pass that mask type to a simd clone, which expected
a normal (non-mask) type instead.

This patch simply punts on call arguments that have a mask type.
A better fix would be to pattern-match the comparison to a COND_EXPR,
like we would if the comparison was stored to memory, but doing that
isn't gcc 9 or 10 material.

Note that this doesn't affect x86_64-linux-gnu because the ABI promotes
bool arguments to ints.

2019-11-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR tree-optimization/92710
* tree-vect-stmts.c (vectorizable_simd_clone_call): Reject
vector mask arguments.

gcc/testsuite/
PR tree-optimization/92710
* gcc.dg/vect/pr92710.c: New test.

From-SVN: r278839

4 years agogcc/testsuite/ChangeLog - fix date in date line
Tobias Burnus [Fri, 29 Nov 2019 12:24:27 +0000 (13:24 +0100)]
gcc/testsuite/ChangeLog - fix date in date line

From-SVN: r278837

4 years agoFix testcase - was missing -fopenacc
Tobias Burnus [Fri, 29 Nov 2019 12:18:50 +0000 (12:18 +0000)]
Fix testcase - was missing -fopenacc

        PR ipa/84963
        * gfortran.dg/goacc/pr84963.f90: Use dg-additional-options not
        dg-options as otherwise -fopenacc is not used.

From-SVN: r278836

4 years agoprofile-count.c (profile_count::to_cgraph_frequency, [...]): Check for compaibility...
Jan Hubicka [Fri, 29 Nov 2019 10:29:44 +0000 (11:29 +0100)]
profile-count.c (profile_count::to_cgraph_frequency, [...]): Check for compaibility of counts.

* profile-count.c (profile_count::to_cgraph_frequency,
profile_count::to_sreal_scale): Check for compaibility of counts.
* profile-count.h (compatible_p): Make public; add checking for
global0 versus global types.
* cgraph.c (cgraph_node::verify_node): Verify count compatibility.

From-SVN: r278835

4 years agoTestsuite: Turn off vect-epilogue-nomask for slp-rect-3
Tamar Christina [Fri, 29 Nov 2019 09:22:15 +0000 (09:22 +0000)]
Testsuite: Turn off vect-epilogue-nomask for slp-rect-3

Without epiloque no mask it would only try HI modes, but thanks to the
epiloques nomask It tries QI mode as well which succeeds.  The xfail
then generates an xpass since the condition on it checks for HI to SI
and not QI.

So I disabled the epiloque mask since it seems to violate the conditions
the test actually wanted to test for.

gcc/testsuite/ChangeLog:

* gcc.dg/vect/slp-reduc-3.c: Turn off epilogue-nomask.

From-SVN: r278834

4 years agore PR tree-optimization/92715 (error: position plus size exceeds size of referenced...
Richard Biener [Fri, 29 Nov 2019 09:18:48 +0000 (09:18 +0000)]
re PR tree-optimization/92715 (error: position plus size exceeds size of referenced object in  ‘bit_field_ref’)

2019-11-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92715
* tree-ssa-forwprop.c (simplify_vector_constructor): Bail
out for uniform vectors and source vectors with less elements
than the destination.

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

From-SVN: r278833

4 years agore PR c++/60228 (ICE using lambda in #pragma omp declare reduction)
Jakub Jelinek [Fri, 29 Nov 2019 09:10:44 +0000 (10:10 +0100)]
re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)

PR c++/60228
* parser.c (cp_parser_omp_declare_reduction_exprs): If
processing_template_decl, wrap the combiner or initializer
into EXPR_STMT.
* decl.c (start_preparsed_function): Don't start a lambda scope
for DECL_OMP_DECLARE_REDUCTION_P functions.
(finish_function): Don't finish a lambda scope for
DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
them nor cp_genericize them.
* mangle.c (decl_mangling_context): Look through
DECL_OMP_DECLARE_REDUCTION_P functions.
* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
functions, use tentative linkage, don't keep their bodies with
-fkeep-inline-functions and return false at the end.

* g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
DECL_OMP_DECLARE_REDUCTION_P functions.

* testsuite/libgomp.c++/udr-20.C: New test.
* testsuite/libgomp.c++/udr-21.C: New test.

From-SVN: r278832

4 years agore PR c++/60228 (ICE using lambda in #pragma omp declare reduction)
Jakub Jelinek [Fri, 29 Nov 2019 09:08:46 +0000 (10:08 +0100)]
re PR c++/60228 (ICE using lambda in #pragma omp declare reduction)

PR c++/60228
* parser.c (cp_parser_omp_declare_reduction_exprs): If
processing_template_decl, wrap the combiner or initializer
into EXPR_STMT.
* decl.c (start_preparsed_function): Don't start a lambda scope
for DECL_OMP_DECLARE_REDUCTION_P functions.
(finish_function): Don't finish a lambda scope for
DECL_OMP_DECLARE_REDUCTION_P functions, nor cp_fold_function
them nor cp_genericize them.
* mangle.c (decl_mangling_context): Look through
DECL_OMP_DECLARE_REDUCTION_P functions.
* semantics.c (expand_or_defer_fn_1): For DECL_OMP_DECLARE_REDUCTION_P
functions, use tentative linkage, don't keep their bodies with
-fkeep-inline-functions and return false at the end.

* g++.dg/gomp/openmp-simd-2.C: Don't expect bodies for
DECL_OMP_DECLARE_REDUCTION_P functions.

* testsuite/libgomp.c++/udr-20.C: New test.
* testsuite/libgomp.c++/udr-21.C: New test.

From-SVN: r278831

4 years agoCheck for TYPE_NAME in type_with_linkage_p.
Martin Liska [Fri, 29 Nov 2019 09:03:25 +0000 (10:03 +0100)]
Check for TYPE_NAME in type_with_linkage_p.

2019-11-29  Martin Liska  <mliska@suse.cz>

PR lto/91574
* ipa-devirt.c (types_same_for_odr): Check for existence
of TYPE_NAMEs first.
2019-11-29  Martin Liska  <mliska@suse.cz>

PR lto/91574
* g++.dg/lto/pr91574_0.C: New test.

From-SVN: r278829

4 years agore PR tree-optimization/92704 (ICE: Segmentation fault (in process_bb))
Richard Biener [Fri, 29 Nov 2019 08:05:03 +0000 (08:05 +0000)]
re PR tree-optimization/92704 (ICE: Segmentation fault (in process_bb))

2019-11-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92704
* tree-if-conv.c (combine_blocks): Deal with virtual PHIs
in loops performing only loads.

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

From-SVN: r278828

4 years agoHandle C2x attributes in Objective-C.
Joseph Myers [Fri, 29 Nov 2019 01:06:57 +0000 (01:06 +0000)]
Handle C2x attributes in Objective-C.

When adding the initial support for C2x attributes, I deferred the
unbounded lookahead support required to support such attributes in
Objective-C (except for the changes to string literal handling, which
were the riskier piece of preparation for such lookahead support).
This patch adds that remaining ObjC support.

For C, the parser continues to work exactly as it did before.  For
ObjC, however, when checking for whether '[[' starts attributes, it
lexes however many tokens are needed to check for a matching ']]', but
in a raw mode that omits all the context-sensitive processing that
c_lex_with_flags normally does, so that that processing can be done
later when the right context-sensitive flags are set.  Those tokens
are saved in a separate raw_tokens vector in the parser, and normal
c_lex_one_token calls will get tokens from there and perform the
remaining processing on them, if any tokens are found there, so all
parsing not using the new interfaces gets the same tokens as it did
before.  (For C, this raw lexing never occurs and the vector of raw
tokens is always NULL.)

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c:
* c-parser.c (struct c_parser): Add members raw_tokens and
raw_tokens_used.
(c_lex_one_token): Add argument raw.  Handle lexing raw tokens and
using previously-lexed raw tokens.
(c_parser_peek_nth_token_raw)
(c_parser_check_balanced_raw_token_sequence): New functions.
(c_parser_nth_token_starts_std_attributes): Use
c_parser_check_balanced_raw_token_sequence for Objective-C.

gcc/testsuite:
* objc.dg/attributes/gnu2x-attr-syntax-1.m: New test.

From-SVN: r278827

4 years agoRemove unused decimal floating-point pointer types
Julian Brown [Fri, 29 Nov 2019 00:58:35 +0000 (00:58 +0000)]
Remove unused decimal floating-point pointer types

gcc/
* builtin-types.def (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR,
BT_DFLOAT128_PTR) Remove.
* tree-core.h (TI_DFLOAT32_PTR_TYPE, TI_DFLOAT64_PTR_TYPE,
TI_DFLOAT128_PTR_TYPE): Remove.
* tree.c (build_common_type_nodes): Remove dfloat32_ptr_type_node,
dfloat64_ptr_type_node and dfloat128_ptr_type_node initialisation.
* tree.h (dfloat32_ptr_type_node, dfloat64_ptr_type_node,
dfloat128_ptr_type_node): Remove macros.

gcc/jit/
* jit-builtins.c (BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR):
Remove commented-out cases.

Reviewed-by: Joseph Myers <joseph@codesourcery.com>
From-SVN: r278826

4 years agoDaily bump.
GCC Administrator [Fri, 29 Nov 2019 00:16:20 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278825

4 years agors6000: Fix formatting of *mov{si,di}_internal.*
Segher Boessenkool [Thu, 28 Nov 2019 23:50:06 +0000 (00:50 +0100)]
rs6000: Fix formatting of *mov{si,di}_internal.*

* config/rs6000/rs6000.md (*movsi_internal1): Fix formatting.  Improve
formatting.
(*movdi_internal64): Ditto.

From-SVN: r278822

4 years agors6000: Use memory_operand for all simple {l,st}*brx instructions
Segher Boessenkool [Thu, 28 Nov 2019 22:28:59 +0000 (23:28 +0100)]
rs6000: Use memory_operand for all simple {l,st}*brx instructions

We run fwprop before combine, very early even in the case of fwprop1;
and fwprop1 will change memory addressing to what it considers cheaper.
After the "common" change, it now changes the indexed store instruction
in the testcase to be to a constant address.  But that is not an
improvement at all: the byte reverse instructions only exist in the
indexed form, so they will not match anymore.

This patch changes the patterns for the byte reverse instructions to
allow plain memory_operand, letting reload fix this up.

PR target/92602
* config/rs6000/rs6000.md (bswap<mode>2_load for HSI): Change the
indexed_or_indirect_operand to be memory_operand.
(bswap<mode>2_store for HSI): Ditto.
(bswapdi2_load): Ditto.
(bswapdi2_store): Ditto.

From-SVN: r278821

4 years agoTranslate header for -fdbg-cnt-list.
Martin Liska [Thu, 28 Nov 2019 20:56:51 +0000 (21:56 +0100)]
Translate header for -fdbg-cnt-list.

2019-11-28  Martin Liska  <mliska@suse.cz>

PR debug/46558
* dbgcnt.c (dbg_cnt_list_all_counters): Mark table
headers for translation.

From-SVN: r278820

4 years agoProperly use TYPE_MAIN_VARIANT in warn_types_mismatch.
Martin Liska [Thu, 28 Nov 2019 20:56:23 +0000 (21:56 +0100)]
Properly use TYPE_MAIN_VARIANT in warn_types_mismatch.

2019-11-28  Martin Liska  <mliska@suse.cz>

PR lto/92609
* ipa-devirt.c (warn_types_mismatch): Use TYPE_MAIN_VARIANT
consistently.
2019-11-28  Martin Liska  <mliska@suse.cz>

PR lto/92609
* g++.dg/lto/pr92609_0.C: New test.
* g++.dg/lto/pr92609_1.C: New test.

From-SVN: r278819

4 years ago[Darwin, X86, testsuite] Update tests for common section use.
Iain Sandoe [Thu, 28 Nov 2019 19:41:55 +0000 (19:41 +0000)]
[Darwin, X86, testsuite] Update tests for common section use.

The switch to default of no-common means that we no longer
indirect the accesses to 'xxx' in this test.  Adjust the scan-
assembler tests to reflect this.

gcc/testsuite/ChangeLog:

2019-11-28  Iain Sandoe  <iain@sandoe.co.uk>

* gcc.target/i386/pr32219-2.c: Adjust scan-assembler entries
for revised common default.

From-SVN: r278818

4 years agore PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and...
Jerry DeLisle [Thu, 28 Nov 2019 18:33:20 +0000 (18:33 +0000)]
re PR libfortran/90374 (Fortran 2018: Support d0.d, e0.d, es0.d, en0.d, g0.d and ew.d e0 edit descriptors for output)

PR fortran/90374
* io.c (check_format): Allow zero width expoenent with e0.

* io/format.c (parse_format_list): Relax format checking to allow
e0 exponent specifier.

* gfortran.dg/fmt_zero_width.f90: Update test.

From-SVN: r278817

4 years agoRemove leftover optimize checks.
Jan Hubicka [Thu, 28 Nov 2019 17:51:40 +0000 (18:51 +0100)]
Remove leftover optimize checks.

* ipa-inline.c (want_early_inline_function_p): Remove leftover optimize
checks.

From-SVN: r278816

4 years agoprofile-count.c (profile_count::combine_with_ipa_count): Return uninitialized count...
Jan Hubicka [Thu, 28 Nov 2019 17:04:41 +0000 (18:04 +0100)]
profile-count.c (profile_count::combine_with_ipa_count): Return uninitialized count if called on ininitialized count.

* profile-count.c (profile_count::combine_with_ipa_count): Return
uninitialized count if called on ininitialized count.

From-SVN: r278815

4 years agoPrevent inconsistent profiles to be created in inlin_transform
Jan Hubicka [Thu, 28 Nov 2019 16:59:43 +0000 (17:59 +0100)]
Prevent inconsistent profiles to be created in inlin_transform

* ipa-inline-transform.c (inline_transform): Scale profile before
redirecting.

From-SVN: r278814

4 years agoprofile-count.h (profile_count::max): Work on profiles of different type.
Jan Hubicka [Thu, 28 Nov 2019 16:58:24 +0000 (17:58 +0100)]
profile-count.h (profile_count::max): Work on profiles of different type.

* profile-count.h (profile_count::max): Work on profiles of different
type.
(profile_count::apply_scale): Be sure that ret is not local or global0
type if num is global.

From-SVN: r278813

4 years agocgraph: ifunc resolvers cannot be made local (PR 92697)
Martin Jambor [Thu, 28 Nov 2019 15:39:48 +0000 (16:39 +0100)]
cgraph: ifunc resolvers cannot be made local (PR 92697)

2019-11-28  Martin Jambor  <mjambor@suse.cz>

PR ipa/92697
* cgraph.c (cgraph_node_cannot_be_local_p_1): Return true for
ifunc_resolvers.
* symtab.c (symtab_node::dump_base): Dump ifunc_resolver flag.
Removed trailig whitespace.

testsuite/
* g++.dg/ipa/pr92697.C: New.

From-SVN: r278812

4 years agoFix previous commit (that included unrelated changes)
Jan Hubicka [Thu, 28 Nov 2019 14:50:19 +0000 (14:50 +0000)]
Fix previous commit (that included unrelated changes)

This patch fixes profile updates while cloning.  When new clone is produced
its global profile is subtracted from the original function.  If the original
function profile drops to 0 we want to switch from global profiles to global0
profiles which is implemented by combine_with_ipa_count_within.

However this is done on all edges independnetly and it may happen that we end
up combining global and globa0 profiles in one functions which is not a good
idea.

This implements profile_count::combine_with_ipa_count_within which is able
to take into account that the counter is inside function with a given count.

* profile-count.h (profile_count::combine_with_ipa_count_within):
Declare.
* profile-count.c (profile_count::combine_with_ipa_count_within):
New.
* cgraphclones.c (cgraph_edge::clone, cgraph_node::create_clone): Use
it.

From-SVN: r278811

4 years agoFix profile adjusments while cloning
Jan Hubicka [Thu, 28 Nov 2019 14:44:08 +0000 (15:44 +0100)]
Fix profile adjusments while cloning

This patch fixes profile updates while cloning.  When new clone is produced
its global profile is subtracted from the original function.  If the original
function profile drops to 0 we want to switch from global profiles to global0
profiles which is implemented by combine_with_ipa_count_within.

However this is done on all edges independnetly and it may happen that we end
up combining global and globa0 profiles in one functions which is not a good
idea.

This implements profile_count::combine_with_ipa_count_within which is able
to take into account that the counter is inside function with a given count.

* profile-count.h (profile_count::combine_with_ipa_count_within):
Declare.
* profile-count.c (profile_count::combine_with_ipa_count_within):
New.
* cgraphclones.c (cgraph_edge::clone, cgraph_node::create_clone): Use
it.

From-SVN: r278810

4 years agoipa-utils.c (ipa_merge_profiles): Be sure that all type transtions of counters are...
Jan Hubicka [Thu, 28 Nov 2019 14:21:08 +0000 (15:21 +0100)]
ipa-utils.c (ipa_merge_profiles): Be sure that all type transtions of counters are done same way.

* ipa-utils.c (ipa_merge_profiles): Be sure that all type transtions
of counters are done same way.

From-SVN: r278809

4 years ago* ipa-cp.c (update_profiling_info): Fix scaling.
Jan Hubicka [Thu, 28 Nov 2019 14:16:29 +0000 (15:16 +0100)]
* ipa-cp.c (update_profiling_info): Fix scaling.

From-SVN: r278808

4 years agore PR tree-optimization/92645 (Hand written vector code is 450 times slower when...
Richard Biener [Thu, 28 Nov 2019 12:26:50 +0000 (12:26 +0000)]
re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)

2019-11-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92645
* tree-inline.c (remap_gimple_stmt): When the return value
is not wanted, elide GIMPLE_RETURN.

* gcc.dg/tree-ssa/inline-12.c: New testcase.

From-SVN: r278807

4 years agore PR tree-optimization/92645 (Hand written vector code is 450 times slower when...
Richard Biener [Thu, 28 Nov 2019 12:22:04 +0000 (12:22 +0000)]
re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)

2019-11-28  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92645
* tree-ssa-forwprop.c (get_bit_field_ref_def): Also handle
conversions inside a mode class.  Remove restriction on
preserving the element size.
(simplify_vector_constructor): Deal with the above and for
identity permutes also try using VEC_UNPACK_[FLOAT_]LO_EXPR
and VEC_PACK_TRUNC_EXPR.

* gcc.target/i386/pr92645-4.c: New testcase.

From-SVN: r278806

4 years agoMust use push insn to pass varargs arguments of DFmode because otherwise the middle...
Georg-Johann Lay [Thu, 28 Nov 2019 10:29:30 +0000 (10:29 +0000)]
Must use push insn to pass varargs arguments of DFmode because otherwise the middle-end generates wrong code.

Must use push insn to pass varargs arguments of DFmode because
otherwise the middle-end generates wrong code.
PR target/92055
* config/avr/avr.md (MPUSH) [DF, DC]: Add modes to mode iterator.

From-SVN: r278805

4 years ago[testsuite][arm] Force use of -mfloat-abi=softfp in asm-flag-4.c
Christophe Lyon [Thu, 28 Nov 2019 09:16:55 +0000 (09:16 +0000)]
[testsuite][arm] Force use of -mfloat-abi=softfp in asm-flag-4.c

The asm-flag-4.c test forces the generation of Thumb code for armv4t,
which is not supported when using the 'hard' FP ABI. This patch
ensures the test uses -mfloat-abi=softfp safely, to avoid irrelevant
failures.

2019-11-28  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/arm/asm-flag-4.c: Use -mfloat-abi=softfp.

From-SVN: r278804

4 years agore PR tree-optimization/92691 (ICE in strlen_dom_walker::before_dom_children at gcc...
Jakub Jelinek [Thu, 28 Nov 2019 08:36:06 +0000 (09:36 +0100)]
re PR tree-optimization/92691 (ICE in strlen_dom_walker::before_dom_children at gcc/tree-ssa-strlen.c:5177 since r274933)

PR tree-optimization/92691
* tree-ssa-strlen.c (handle_store): Clarify return value meaning
in function comment.
(strlen_check_and_optimize_call): Likewise.  For handle_printf_call
calls, return !handle_printf_call rather than always returning true.
(check_and_optimize_stmt): Describe return value meaning in function
comment.  Formatting fix.

* gcc.dg/tree-ssa/builtin-snprintf-10.c: New test.

From-SVN: r278803

4 years agore PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array)
Jakub Jelinek [Thu, 28 Nov 2019 08:06:09 +0000 (09:06 +0100)]
re PR c++/92695 (P1064R0 - virtual constexpr fails if object taken from array)

PR c++/92695
* decl2.c (mark_used): Don't call note_vague_linkage_fn for pure
virtual functions, even if they are declared inline.

* g++.dg/warn/inline3.C: New test.

From-SVN: r278802

4 years agoHandle correctly global0 and global counters in profile_count::to_sreal_scale
Jan Hubicka [Thu, 28 Nov 2019 07:31:26 +0000 (08:31 +0100)]
Handle correctly global0 and global counters in profile_count::to_sreal_scale

This patch fixes problem in profile_count::to_sreal_scale.  We our porfile
counters can be function local, global (ipa) or function local but globally 0.
The last is used to hold static estimates for functions executed 0 times in
profile.  Now only one 64bit value is stored and if we compute frequency
of global0 counter in global counter we mix them up and return non-zero value
incorrectly.

I also implemented unit test, but will commit sanity checking separately from
fixes: there are multiple bugs in this area I tracked down.

* profile-count.c (profile_count::to_sreal_scale): Handle correctly
combination of globa0 and global counters..

From-SVN: r278801

4 years ago[rs6000] Fix PR92566 by checking VECTOR_UNIT_NONE_P
Kewen Lin [Thu, 28 Nov 2019 06:34:31 +0000 (06:34 +0000)]
[rs6000] Fix PR92566 by checking VECTOR_UNIT_NONE_P

As Segher pointed out in PR92566, we shouldn't offer some vector modes which
aren't supported under current setting.  This patch is to make it check by
VECTOR_UNIT_NONE_P which is initialized as current architecture masks.

2019-11-28  Kewen Lin  <linkw@gcc.gnu.org>

    PR target/92566
    * gcc/config/rs6000/rs6000.c (rs6000_preferred_simd_mode): Check by
    VECTOR_UNIT_NONE_P instead.

From-SVN: r278800

4 years agosse.md (avx512f_maskcmp<mode>3): Refine VF to VF_AVX512VL.
Hongtao Liu [Thu, 28 Nov 2019 05:20:37 +0000 (05:20 +0000)]
sse.md (avx512f_maskcmp<mode>3): Refine VF to VF_AVX512VL.

* gcc/config/i386/sse.md (avx512f_maskcmp<mode>3):
 Refine VF to VF_AVX512VL.

From-SVN: r278799

4 years agoDaily bump.
GCC Administrator [Thu, 28 Nov 2019 00:16:21 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278794

4 years agoReformat movdi_internal64.
Michael Meissner [Thu, 28 Nov 2019 00:11:28 +0000 (00:11 +0000)]
Reformat movdi_internal64.

2019-11-26  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.md (movdi_internal64): Reformat.

From-SVN: r278788

4 years agoReformat movsi_internal.
Michael Meissner [Wed, 27 Nov 2019 23:04:04 +0000 (23:04 +0000)]
Reformat movsi_internal.

2019-11-27  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.md (movsi_internal): Reformat.

From-SVN: r278787

4 years agoImplement P1814R0, CTAD for alias templates.
Jason Merrill [Wed, 27 Nov 2019 22:05:53 +0000 (17:05 -0500)]
Implement P1814R0, CTAD for alias templates.

This patch implements C++20 class template argument deduction for alias
templates, which works by a moderately arcane transformation of the
deduction guides for the underlying class template.  When implementing it,
it seemed that I could simplify the rules in the draft a bit and get
essentially the same effect; I'll be emailing the committee to that effect
soon.

gcc/cp/
* pt.c (rewrite_tparm_list): Factor out of build_deduction_guide.
(maybe_aggr_guide): Check for copy-init here.
(alias_ctad_tweaks, deduction_guides_for): New.
(ctor_deduction_guides_for): Factor out of do_class_deduction.
(ctad_template_p): New.
* parser.c (cp_parser_simple_type_specifier): Use it.
* constraint.cc (append_constraint): New.
gcc/c-family/
* c-cppbuiltin.c (c_cpp_builtins): Update __cpp_deduction_guides.

From-SVN: r278786

4 years agoFix constrained alias template transparency.
Jason Merrill [Wed, 27 Nov 2019 22:05:47 +0000 (17:05 -0500)]
Fix constrained alias template transparency.

A constrained alias template can't be treated as equivalent to its
underlying template/type for much the same reason that an alias template
like void_t can't; we're relying on checking during substitution.

* cxx-pretty-print.c (pp_cxx_unqualified_id): Handle alias
template-id.
* pt.c (complex_alias_template_p): True if constraints.
(get_underlying_template, tsubst): Check alias constraints.
(push_template_decl_real): Set alias constraints here.
* parser.c (cp_parser_alias_declaration): Not here.
* constraint.cc (get_constraints): Take const_tree.

From-SVN: r278785

4 years agoPR c++/92206 - ICE with typedef to dependent alias.
Jason Merrill [Wed, 27 Nov 2019 22:05:41 +0000 (17:05 -0500)]
PR c++/92206 - ICE with typedef to dependent alias.

rsandifo's patch for 92206 demonstrated a problem with the existing checking
for alias template specializations: they were returning false for a typedef
to an alias template specialization.  Which is sometimes what the caller
wants, and sometimes not: Sometimes we're interested in whether the type was
written as an alias template-id, and sometimes whether it represents one.

The testcase illustrates a case that remained wrong with the earlier patch:
if the typedef is itself an alias template specialization, we can't strip an
underlying dependent alias.

* pt.c (dependent_alias_template_spec_p)
(alias_template_specialization_p): Add transparent_typedefs
parameter.
(iterative_hash_template_arg, any_template_parm_r)
(primary_template_specialization_p, tsubst, dependent_type_p_r):
Adjust.
* decl.c (check_elaborated_type_specifier): Adjust.
* error.c (dump_template_bindings, dump_aggr_type): Adjust.

From-SVN: r278784

4 years agoDo not define DFP builtin functions, if DFP has been disabled.
Peter Bergner [Wed, 27 Nov 2019 20:55:56 +0000 (20:55 +0000)]
Do not define DFP builtin functions, if DFP has been disabled.

PR bootstrap/92661
* config/rs6000/rs6000-call.c: (def_builtin): Do not define the
builtin if we don't have an actual type.
(builtin_function_type): If the builtin function uses a DFP type
and decimal float has been disabled, then return NULL_TREE.

From-SVN: r278783

4 years agoFix 'libgomp.fortran/target-print-1.f90', 'libgomp.oacc-fortran/print-1.f90' for...
Thomas Schwinge [Wed, 27 Nov 2019 17:50:55 +0000 (18:50 +0100)]
Fix 'libgomp.fortran/target-print-1.f90', 'libgomp.oacc-fortran/print-1.f90' for offload target nvptx

libgomp/
* testsuite/lib/libgomp.exp
(check_effective_target_offload_target_nvptx): New proc.
* testsuite/libgomp.fortran/target-print-1.f90: Use it with
'dg-skip-if'.
* testsuite/libgomp.oacc-fortran/print-1.f90: Likewise.
* testsuite/libgomp.fortran/target-print-1-nvptx.f90: New file.
* testsuite/libgomp.oacc-fortran/print-1-nvptx.f90: Likewise.

From-SVN: r278779

4 years agore PR rtl-optimization/92510 (ICE in native_encode_rtx, at simplify-rtx.c:6272)
Jakub Jelinek [Wed, 27 Nov 2019 16:32:54 +0000 (17:32 +0100)]
re PR rtl-optimization/92510 (ICE in native_encode_rtx, at simplify-rtx.c:6272)

PR rtl-optimization/92510
* combine.c (gen_lowpart_for_combine): Only transform lowpart subreg
of comparison into a comparison with different mode if both imode and
omode are scalar integral modes.

* gcc.dg/pr92510.c: New test.

From-SVN: r278777

4 years agore PR c++/92236 ([concepts] Explain non-satisfaction in static_assert)
Andrew Sutton [Wed, 27 Nov 2019 15:23:02 +0000 (15:23 +0000)]
re PR c++/92236 ([concepts] Explain non-satisfaction in static_assert)

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

PR c++/92236
Defer evaluation of concept checks so that static assertions can
emit more detailed diagnostics.

gcc/cp/
* constexpr.c (cxx_eval_call_expression): Handle concept checks.
(cxx_eval_constant_expression): Diagnose misuse of function concepts
as template-id expressions. Follow the usual return path for results.
(cxx_eval_outermost_constant_expr): Avoid calling
cp_get_callee_fndecl_nofold for function concepts.
* constraint.cc (build_function_check): Fully type the concept check
so that we don't ICE in conversions.
* cp-gimplify.c (cp_genericize_r) [CALL_EXPR]: Handle concept checks.
[TEMPLATE_ID_EXPR] Likewise.
* cvt.c (convert_to_void): Always evaluate concept checks so we don't
accidentally ignore them. Substitution during satisfaction can make
a program ill-formed (example in g++.dg/cpp2a/concepts6.C).
* pt.c (tsubst_copy_and_build): [CALL_EXPR]: Don't evaluate concepts.
[TEMPLATE_ID_EXPR]: Likewise.
* semantics.c (finish_call_expr): Don't evaluate concepts.
(finish_id_expression_1): Likewise.
(finish_static_assert): Preserve the original condition so we can
diagnose concept errors when a check returns false.

gcc/testsuite/
* g++.dg/cpp2a/concepts-iconv1.C: Update diagnostics.
* g++.dg/cpp2a/concepts-requires5.C: Likewise.
* g++.dg/cpp2a/concepts6.C: New test.

From-SVN: r278775

4 years agore PR c++/92439 ([concepts] trunk crashes on constraint satisfaction failure)
Andrew Sutton [Wed, 27 Nov 2019 15:16:37 +0000 (15:16 +0000)]
re PR c++/92439 ([concepts] trunk crashes on constraint satisfaction failure)

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

PR c++/92439
Improve quality of diagnostics for subexpressions that need parens.

gcc/cp/
* parser.c (cp_parser_requires_clause_opt): Add a flag to indicate
when parsing a requires-clause before lambda parameters, and...
(cp_parser_lambda_declarator_opt): ... use that here ...
(cp_parser_type_parameter): ... and here ...
(cp_parser_late_return_type_opt): ... and here ...
(cp_parser_explicit_template_declaration): ... and here.
(cp_parser_diagnose_ungrouped_constraint_plain): Adjust the message
because this can apply to subexpressions that are not immediately
after a requires-clause.
(cp_parser_diagnose_ungrouped_constraint_rich): Likewise.
(primary_constraint_error): New.
(cp_parser_constraint_requires_parens): New.
(cp_parser_unary_constraint_requires_parens): New.
(cp_parser_constraint_primary_expression): Check for unary expressions
before parsing the primary expression. Also check for binary and
postfix operators after a successful parse of the primary expression.
Force a re-parse if the result would form a lower-precedence string.
(cp_parser_constraint_logical_and_expression): Propagate lambda flag;
move checks for ill-formed constraints into the constraint primary
expression.
(cp_parser_constraint_logical_or_expression): Likewise.
(cp_parser_requires_clause_expression): Propagate lambda flag.

gcc/testsuite/
* g++.dg/cpp2a/concepts-requires20.C: New.

From-SVN: r278774

4 years agore PR c++/88395 (ICE: Segmentation fault signal terminated program cc1plus, with...
Andrew Sutton [Wed, 27 Nov 2019 15:09:22 +0000 (15:09 +0000)]
re PR c++/88395 (ICE: Segmentation fault signal terminated program cc1plus, with -std=c++2a -fconcepts)

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

PR c++/88395
Prevent recursive satisfaction by adding requests to the instantiation
stack.

gcc/cp/
* constraint.cc (satisfy_declaration_constraints): Push tinst levels
around satisfaction.

gcc/testsuite/
* g++.dg/cpp2a/concepts-pr88395.C: New.
* g++.dg/cpp2a/concepts-recursive-sat1.C: New.
* g++.dg/cpp2a/concepts-recursive-sat2.C: New.
* g++.dg/cpp2a/concepts-recursive-sat3.C: New.

From-SVN: r278773

4 years agore PR rtl-optimization/90007 (ICE in extract_constrain_insn_cached, at recog.c:2223)
Vladimir Makarov [Wed, 27 Nov 2019 14:24:47 +0000 (14:24 +0000)]
re PR rtl-optimization/90007 (ICE in extract_constrain_insn_cached, at recog.c:2223)

2019-11-27  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/90007
* recog.c (constrain_operands): Permit hard registers too for
memory when LRA is used.

2019-11-27  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/90007
* gcc.target/i386/pr90007.c: New test.

From-SVN: r278770

4 years agoDiagnose certain constraint errors as hard errors, but otherwise treat them the same...
Andrew Sutton [Wed, 27 Nov 2019 14:02:49 +0000 (14:02 +0000)]
Diagnose certain constraint errors as hard errors, but otherwise treat them the same as normal SFINAE-type errors.

2019-11-27  Andrew Sutton  <asutton@lock3software.com>

Diagnose certain constraint errors as hard errors, but otherwise treat
them the same as normal SFINAE-type errors. Also, generally clean up
the satisfaction functions.

gcc/cp/
* constexpr.c (cxx_eval_constant_expression): Use
evaluate_concept_check.
* constraint.cc (normalize_concept_definition): Accept a diagnostic
flag and only cache when not diagnosing errors.
(decl_satisfied_cache): Map to trees instead of bools.
(satisfy_atom): Guarantee a location for the errors, propagate complain
flags to force_rvalue, and emit errors for non-boolean constraints.
(get_normalized_constraints_and_args): New overloads. Factored out of
satisfy_constraint_expression and satisfy_declaration_constraints.
(satisfy_constraint_expression): Propagate diagnostic info to
normalization.
(satisfy_declaration_constraints): New. Factored out of
constraints_satisfied_p.
(constraint_satisfaction_value): New. Calls
satisfy_constraint_expression or satisfy_declaration_constraints.
(constraints_satisfied_p): Call constraint_satisfaction_value.
(evaluate_concept_check): Don't take tsubst_falgs_t. Replay
satisfaction if an error is encountered.
(current_failed_constraint): Moved from pt.c.
(diagnose_constraints): Call constraint_satisfaction_value.
* cp-tree.h: Update declarations.
* pt.c (current_failed_constraint): Moved to constraint.cc.
* semantics.c (finish_id_expression_1): Remove a duplicate case.

gcc/testsuite/
* g++.dg/concepts/pr84330.C: Update diagnostics.
* g++.dg/cpp2a/concepts-requires2.C: Likewise.

From-SVN: r278768

4 years agom68k.c (m68k_output_compare_fp): Restore differences between Coldfire and regular...
Bernd Schmidt [Wed, 27 Nov 2019 13:07:44 +0000 (13:07 +0000)]
m68k.c (m68k_output_compare_fp): Restore differences between Coldfire and regular m68k.

* config/m68k/m68k.c (m68k_output_compare_fp): Restore differences
between Coldfire and regular m68k.
* config/m68k/m68k.md (cmp1_cf_constraints): Disallow constants.

From-SVN: r278767

4 years agotarget.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
Richard Biener [Wed, 27 Nov 2019 12:22:02 +0000 (12:22 +0000)]
target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.

2019-11-27  Richard Biener  <rguenther@suse.de>

* target.def (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
* targhooks.c (default_builtin_vectorized_conversion): Likewise.
* targhooks.h (default_builtin_vectorized_conversion): Likewise.
* optabs-tree.c (supportable_convert_operation): Do not call
targetm.vectorize.builtin_conversion.  Remove unused decl parameter.
* optabs-tree.h (supportable_convert_operation): Adjust.
* doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_CONVERSION): Remove.
* doc/tm.texi: Regenerate.
* tree-ssa-forwprop.c (simplify_vector_constructor): Adjust.
* tree-vect-generic.c (expand_vector_conversion): Likewise.
* tree-vect-stmts.c (vect_gen_widened_results_half): Remove
unused decl parameter and adjust.
(vect_create_vectorized_promotion_stmts): Likewise.
(vectorizable_conversion): Adjust.

From-SVN: r278765

4 years agore PR tree-optimization/92690 (vector CTOR optimization performs invalid conversion)
Richard Biener [Wed, 27 Nov 2019 12:16:54 +0000 (12:16 +0000)]
re PR tree-optimization/92690 (vector CTOR optimization performs invalid conversion)

2019-11-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92690
* tree-ssa-forwprop.c (simplify_vector_constructor): Avoid
converting elements not originally converted.

* gcc.dg/torture/pr92690.c: New testcase.
* gcc.dg/tree-ssa/forwprop-35.c: Adjust.

From-SVN: r278764

4 years agore PR fortran/91944 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c...
Jakub Jelinek [Wed, 27 Nov 2019 10:00:50 +0000 (11:00 +0100)]
re PR fortran/91944 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c:6156)

PR fortran/91944
* simplify.c (gfc_simplify_spread): Check gfc_init_expr_flag instead
of gfc_current_ns->sym_root->n.sym->attr.flavor == FL_PARAMETER.

* gfortran.dg/spread_size_limit_2.f90: New test.

From-SVN: r278762

4 years agoPR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0
Tobias Burnus [Wed, 27 Nov 2019 09:16:24 +0000 (10:16 +0100)]
PR 92463 - Cleanups due to minimum MPFR version bump to 3.1.0

        PR middle-end/92463
        * configure.ac: Use MPFR_RNDN instead of GMP's MP_RNDN.
        * configure: Regenerate

        gcc/
        PR middle-end/92463
        * builtins.c (do_mpfr_ckconv, do_mpc_ckconv, do_mpfr_remquo,
        do_mpfr_lgamma_r, do_mpc_arg2): Use MPFR_RNDx instead of GMP_RNDx,
        mpfr_rnd_t instead of mp_rnd_t.
        * fold-const-call.c (do_mpfr_ckconv, do_mpfr_arg1, do_mpfr_sincos,
        do_mpfr_arg2, do_mpfr_arg3, do_mpc_arg1, do_mpc_arg2): Likewise.
        * gimple-ssa-sprintf.c (format_floating_max, format_floating):
        Use mpfr_exp_t instead of mp_exp_t.
        * real.c (real_from_string, dconst_e_ptr, dconst_sqrt2_ptr): Use
        MPFR_RNDx instead of GMP_RNDx.
        * realmpfr.c (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t and
        mpfr_exp_t instead mp_rnd_t and mp_exp_t, respectively.
        * realmpfr.h (real_from_mpfr, mpfr_from_real): Use mpfr_rnd_t instead
        of mp_rnd_t and remove MPFR_RNDx poisoning.
        * ubsan.c (ubsan_instrument_float_cast): MPFR_RNDx instead of GMP_RNDx.

        fortran/
        PR middle-end/92463
        * arith.c (gfc_check_real_range): Replace mp_exp_t by mpfr_exp_t.

From-SVN: r278761

4 years ago[PATCH] Fix PR91790 by considering different first_stmt_info for realign
Kewen Lin [Wed, 27 Nov 2019 09:08:20 +0000 (09:08 +0000)]
[PATCH] Fix PR91790 by considering different first_stmt_info for realign

As PR91790 exposed, when we have one slp node whose first_stmt_info_for_drptr
is different from first_stmt_info, it's possible that the first_stmt DR isn't
initialized yet before stmt SLP_TREE_SCALAR_STMTS[0] of slp node. So we
shouldn't use first_stmt_info for vect_setup_realignment, instead we can use
the one based on first_stmt_info_for_drptr DR with additional adjustment by
bumping the distance from first_stmt DR.

gcc/ChangeLog

2019-11-27  Kewen Lin  <linkw@gcc.gnu.org>

    PR tree-optimization/91790
    * gcc/tree-vect-stmts.c (vectorizable_load): Use the adjusted DR for
    vect_setup_realignment when first_stmt_info is different from
    first_stmt_info_for_drptr.

From-SVN: r278760

4 years agore PR c++/92524 (ICE in short program with constexpr and std::array)
Jakub Jelinek [Wed, 27 Nov 2019 09:04:40 +0000 (10:04 +0100)]
re PR c++/92524 (ICE in short program with constexpr and std::array)

PR c++/92524
* tree.c (replace_placeholders_r): Don't walk constructor elts with
RANGE_EXPR indexes.

* g++.dg/cpp0x/pr92524.C: New test.

From-SVN: r278759

4 years agore PR tree-optimization/92645 (Hand written vector code is 450 times slower when...
Richard Biener [Wed, 27 Nov 2019 08:56:23 +0000 (08:56 +0000)]
re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)

2019-11-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92645
* tree-ssa-forwprop.c (simplify_vector_constructor): Handle
CTORs with just a subset of the original vectors.

* gcc.target/i386/pr92645-2.c: New testcase.
* gcc.target/i386/pr92645-3.c: Likewise.

From-SVN: r278758

4 years agore PR lto/92674 (ICE in gimple_phi_arg, at gimple.h:4406 since r240291)
Richard Biener [Wed, 27 Nov 2019 08:52:17 +0000 (08:52 +0000)]
re PR lto/92674 (ICE in gimple_phi_arg, at gimple.h:4406 since r240291)

2019-11-27  Richard Biener  <rguenther@suse.de>

PR middle-end/92674
* tree-inline.c (expand_call_inline): Delay purging EH/abnormal
edges and instead record blocks in bitmap.
(gimple_expand_calls_inline): Adjust.
(fold_marked_statements): Delay EH cleanup until all folding is
done.
(optimize_inline_calls): Do EH/abnormal cleanup for calls after
inlining finished.

From-SVN: r278757

4 years agoAllow autoinc in jumps, but only when using reload.
Bernd Schmidt [Wed, 27 Nov 2019 03:31:24 +0000 (03:31 +0000)]
Allow autoinc in jumps, but only when using reload.

* auto-inc-dec.c (merge_in_block): Allow autoinc in jumps unless
LRA is enabled.
* combine.c (can_combine_p): Disallow autoinc in jumps unless LRA is
disabled.

From-SVN: r278756

4 years agoRemember the location of a variable template-id.
Jason Merrill [Wed, 27 Nov 2019 03:14:33 +0000 (22:14 -0500)]
Remember the location of a variable template-id.

I noticed that tsubst of a TEMPLATE_ID_EXPR was losing the location
information from its EXPR_LOCATION.  Then I noticed that
cxx_eval_constant_expression was also throwing away location information for
variable references.

* pt.c (tsubst_copy_and_build) [TEMPLATE_ID_EXPR]: Remember the
location of a variable template-id.
* constexpr.c (cxx_eval_constant_expression): Get expr location
before stripping location wrappers.
(non_const_var_error): Take location argument.

From-SVN: r278755

4 years agore PR debug/92664 (Wrong .debug_line section information when compiling stdin input...
Jakub Jelinek [Wed, 27 Nov 2019 00:23:39 +0000 (01:23 +0100)]
re PR debug/92664 (Wrong .debug_line section information when compiling stdin input with -g3)

PR debug/92664
* dwarf2out.c (lookup_filename): Use "<stdin>" instead of "".

From-SVN: r278752

4 years agoDaily bump.
GCC Administrator [Wed, 27 Nov 2019 00:16:19 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278751

4 years agotypeck.c (cp_build_unary_op): Consistently use the accurate location in seven additio...
Paolo Carlini [Wed, 27 Nov 2019 00:00:35 +0000 (00:00 +0000)]
typeck.c (cp_build_unary_op): Consistently use the accurate location in seven additional diagnostic messages.

/cp
2019-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

* typeck.c (cp_build_unary_op): Consistently use the accurate
location in seven additional diagnostic messages.
(cp_build_compound_expr): Use cp_expr_loc_or_input_loc in one place.

/testsuite
2019-11-26  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/cpp1z/bool-increment1.C: Test location(s) too.
* g++.dg/expr/bitfield3.C: Likewise.
* g++.dg/expr/bitfield4.C: Likewise.
* g++.dg/expr/bitfield5.C: Likewise.
* g++.dg/expr/bitfield6.C: Likewise.
* g++.dg/expr/bool1.C: Likewise.
* g++.dg/expr/bool2.C: Likewise.
* g++.dg/expr/bool3.C: Likewise.
* g++.dg/expr/bool4.C: Likewise.
* g++.dg/expr/lval3.C: Likewise.
* g++.dg/other/error18.C: Likewise.
* g++.dg/warn/Wpointer-arith-1.C: Likewise.
* g++.old-deja/g++.bugs/900212_01.C: Likewise.
* g++.old-deja/g++.bugs/900428_02.C: Likewise.
* g++.old-deja/g++.jason/rfg14.C: Likewise.
* g++.old-deja/g++.other/overload11.C: Likewise.

From-SVN: r278743

4 years agoPR tree-optimization/92683 - strncmp incorrect result with equal substrings and non...
Martin Sebor [Tue, 26 Nov 2019 23:56:22 +0000 (23:56 +0000)]
PR tree-optimization/92683 - strncmp incorrect result with equal substrings and non-const bound

gcc/testsuite/ChangeLog:

PR tree-optimization/92683
* gcc.dg/strcmpopt_8.c: New test.
* gcc.dg/strcmpopt_9.c: New test.

gcc/ChangeLog:

PR tree-optimization/92683
* gimple-fold.c (gimple_fold_builtin_string_compare): Restore a test
inadvertently removed in a previous change.  Rename local variable
for clarity.

From-SVN: r278742

4 years agoUpdate vect_char_add target selector to use its own cache
Joel Hutton [Tue, 26 Nov 2019 22:11:39 +0000 (22:11 +0000)]
Update vect_char_add target selector to use its own cache

This patch updates the vect_char_add target selector to use its own
cache instead of the vect_int cache.

This was causing a situation where bb-slp-40.c would fail on sparc when
run after other tests that use the vect_int target selector, but pass
when run on its own.

2019-11-26  Joel Hutton  <Joel.Hutton@arm.com>

gcc/testsuite/
PR testsuite/92391
* lib/target-supports.exp (check_effective_target_vect_char_add):
Use a separate cache entry from vect_int.

From-SVN: r278738

4 years agore PR c++/92648 (Handling of unknown attributes)
Jakub Jelinek [Tue, 26 Nov 2019 21:58:22 +0000 (22:58 +0100)]
re PR c++/92648 (Handling of unknown attributes)

PR c++/92648
* parser.c (cp_parser_std_attribute): For unknown attributes,
skip balanced token seq instead of trying to parse
attribute-argument-clause as expression list.  Formatting fix.

* g++.dg/cpp0x/gen-attrs-71.C: New test.

From-SVN: r278737

4 years agore PR c++/61414 (enum class bitfield size-checking needs a separate warning flag...
Jakub Jelinek [Tue, 26 Nov 2019 21:57:27 +0000 (22:57 +0100)]
re PR c++/61414 (enum class bitfield size-checking needs a separate warning flag controlling it)

PR c++/61414
* c-attribs.c (handle_mode_attribute): Add mode attribute to
ENUMERAL_TYPEs.

* class.c (enum_to_min_precision): New hash_map.
(enum_min_precision): New function.
(check_bitfield_decl): Use it.

* g++.dg/cpp0x/enum23.C: Remove xfail.
* g++.dg/cpp0x/enum28.C: New test.

From-SVN: r278736

4 years agoInsert missed log entry.
Jerry DeLisle [Tue, 26 Nov 2019 21:29:30 +0000 (21:29 +0000)]
Insert missed log entry.

From-SVN: r278735

4 years agoRemove entry committed to wrong log.
Jerry DeLisle [Tue, 26 Nov 2019 21:28:14 +0000 (21:28 +0000)]
Remove entry committed to wrong log.

From-SVN: r278734

4 years agoUnbreak objc build – with --enable-maintainer-mode
Tobias Burnus [Tue, 26 Nov 2019 20:16:30 +0000 (20:16 +0000)]
Unbreak objc build – with --enable-maintainer-mode

        * Makefile.in (aclocal_deps): Fix path to cet.m4.

From-SVN: r278732

4 years agolibstdc++: Use C++98 syntax to instantiate input_iterator_tag
François Dumont [Tue, 26 Nov 2019 19:23:11 +0000 (19:23 +0000)]
libstdc++: Use C++98 syntax to instantiate input_iterator_tag

* include/debug/helper_functions.h (__valid_range_aux): Use C++98
std::input_iterator_tag default constructor invocation.

From-SVN: r278731

4 years agore PR target/92669 (ICE in pre_and_rev_post_order_compute_fn at gcc/cfganal.c:1034...
Richard Biener [Tue, 26 Nov 2019 12:03:58 +0000 (12:03 +0000)]
re PR target/92669 (ICE in pre_and_rev_post_order_compute_fn at gcc/cfganal.c:1034 since r278666)

2019-11-26  Richard Biener  <rguenther@suse.de>

PR middle-end/92669
* cfganal.c (pre_and_rev_post_order_compute_fn): Deal with
NULL pre_order.

From-SVN: r278723

4 years agore PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)
Jakub Jelinek [Tue, 26 Nov 2019 09:08:31 +0000 (10:08 +0100)]
re PR sanitizer/92154 (new glibc breaks arm bootstrap due to libsanitizer)

PR sanitizer/92154
* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.

From-SVN: r278722

4 years agoS/390: Add undef for MUSL_DYNAMIC_LINKERxx
Robin Dapp [Tue, 26 Nov 2019 09:00:26 +0000 (09:00 +0000)]
S/390: Add undef for MUSL_DYNAMIC_LINKERxx

This fixes the s390 bootstrap by undefining existing defines before
redefining them.

gcc/ChangeLog:

2019-11-26  Robin Dapp  <rdapp@linux.ibm.com>

  * config/s390/linux.h: Add undef for MUSL_DYNAMIC_LINKERxx.

From-SVN: r278721

4 years agore PR tree-optimization/92644 (ICE in wide_int_to_tree_1, at tree.c:1530)
Jakub Jelinek [Tue, 26 Nov 2019 08:43:27 +0000 (09:43 +0100)]
re PR tree-optimization/92644 (ICE in wide_int_to_tree_1, at tree.c:1530)

PR tree-optimization/92644
* tree-ssa-phiopt.c (minmax_replacement): Add INTEGRAL_TYPE_P check
next to INTEGER_CST checks.

* g++.dg/opt/pr92644.C: New test.

From-SVN: r278720

4 years agore PR tree-optimization/92645 (Hand written vector code is 450 times slower when...
Richard Biener [Tue, 26 Nov 2019 08:32:38 +0000 (08:32 +0000)]
re PR tree-optimization/92645 (Hand written vector code is 450 times slower when compiled with GCC compared to Clang)

2019-11-26  Richard Biener  <rguenther@suse.de>

PR tree-optimization/92645
* tree-vect-slp.c (vect_build_slp_tree_2): For unary ops
do not build the operation from scalars if the operand is.

* gcc.target/i386/pr92645.c: New testcase.

From-SVN: r278719

4 years agolibstdc++: Add C++20 P1032 constexpr to _GLIBCXX_DEBUG array
François Dumont [Tue, 26 Nov 2019 06:12:34 +0000 (06:12 +0000)]
libstdc++: Add C++20 P1032 constexpr to _GLIBCXX_DEBUG array

* include/debug/array (array<>::fill): Add C++20 constexpr.
(array<>::swap): Likewise.

From-SVN: r278718

4 years agolibstdc++: Add _GLIBCXX_DEBUG safe iterator C++20 iterator concept
François Dumont [Tue, 26 Nov 2019 06:07:23 +0000 (06:07 +0000)]
libstdc++: Add _GLIBCXX_DEBUG safe iterator C++20 iterator concept

* include/debug/safe_iterator.h
[__cpp_lib_concepts](_Safe_iterator<>::iterator_concept): Define for
C++20.

From-SVN: r278717

4 years agoDaily bump.
GCC Administrator [Tue, 26 Nov 2019 00:16:15 +0000 (00:16 +0000)]
Daily bump.

From-SVN: r278716

4 years ago* gfortran.dg/dec-comparison.f90: Change dg-do from run to compile.
Jakub Jelinek [Mon, 25 Nov 2019 23:24:40 +0000 (00:24 +0100)]
* gfortran.dg/dec-comparison.f90: Change dg-do from run to compile.

From-SVN: r278713

4 years agoFix typo in C++2a paper number - P1920R1 -> P1902R1
Jakub Jelinek [Mon, 25 Nov 2019 21:48:24 +0000 (22:48 +0100)]
Fix typo in C++2a paper number - P1920R1 -> P1902R1

From-SVN: r278707

4 years agore PR fortran/92629 (internal compiler error: in convert_mpz_to_unsigned, at fortran...
Harald Anlauf [Mon, 25 Nov 2019 19:50:38 +0000 (19:50 +0000)]
re PR fortran/92629 (internal compiler error: in convert_mpz_to_unsigned, at fortran/simplify.c:173)

2019-11-25  Harald Anlauf  <anlauf@gmx.de>

PR fortran/92629
* simplify.c (convert_mpz_to_unsigned): Skip assert for argument
range when -fno-range-check is specified.

PR fortran/92629
* gfortran.dg/pr92629.f90: New testcase.

From-SVN: r278699

4 years agolibstdc++: Add move_sentinel, common_iterator and counted_iterator
Jonathan Wakely [Mon, 25 Nov 2019 19:02:03 +0000 (19:02 +0000)]
libstdc++: Add move_sentinel, common_iterator and counted_iterator

This implements most of the remaining C++20 additions to the <iterator>
header.

* include/bits/iterator_concepts.h (ranges::iter_swap): Fix parameter
types of poison pill overload. Use remove_reference_t when checking
constraints.
* include/bits/stl_iterator.h (move_sentinel): Define for C++20.
(move_iterator): Adjust definitions of nested types for C++20. Add
hidden friends for move_sentinel operations, iter_move and iter_swap.
(common_iterator, counted_iterator): Define for C++20.
* testsuite/24_iterators/move_iterator/cust.cc: New test.
* testsuite/24_iterators/move_iterator/sentinel.cc: New test.
* testsuite/24_iterators/common_iterator/1.cc: New test.
* testsuite/24_iterators/counted_iterator/1.cc: New test.

From-SVN: r278698

4 years agoPR libstdc++/91786 fix compilation error with Clang
Jonathan Wakely [Mon, 25 Nov 2019 19:01:58 +0000 (19:01 +0000)]
PR libstdc++/91786 fix compilation error with Clang

PR libstdc++/91786
* include/bits/fs_path.h (filesystem_error): Move definition before
the use in u8path.

From-SVN: r278697

4 years agoconfig/gcn/mkoffload.c – remove unused static vars
Tobias Burnus [Mon, 25 Nov 2019 14:25:17 +0000 (14:25 +0000)]
config/gcn/mkoffload.c – remove unused static vars

        * config/gcn/mkoffload.c (COMMENT_PREFIX, struct id_map,
        func_ids, funcs_tail, var_ids, vars_tail) Remove unused
        definitions.

From-SVN: r278688

4 years agoUpdate dump message in IPA ICF.
Martin Liska [Mon, 25 Nov 2019 14:02:55 +0000 (15:02 +0100)]
Update dump message in IPA ICF.

2019-11-25  Martin Liska  <mliska@suse.cz>

* ipa-icf.c (sem_item_optimizer::dump_cong_classes): Clean
up used dump message.

From-SVN: r278687

4 years agoComment too strict checking assert.
Martin Liska [Mon, 25 Nov 2019 13:57:00 +0000 (14:57 +0100)]
Comment too strict checking assert.

2019-11-25  Martin Liska  <mliska@suse.cz>

PR bootstrap/92653
* ipa-fnsummary.c (ipa_fn_summary::account_size_time): Comment out
too strict checking assert.

From-SVN: r278686

4 years agotypeck.c (cp_build_indirect_ref_1): Add location_t parameter and use it in error...
Paolo Carlini [Mon, 25 Nov 2019 13:49:50 +0000 (13:49 +0000)]
typeck.c (cp_build_indirect_ref_1): Add location_t parameter and use it in error messages.

/gcc
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

* typeck.c (cp_build_indirect_ref_1): Add location_t parameter
and use it in error messages.
(build_x_indirect_ref): Adjust call.
(build_indirect_ref): Likewise.
(cp_build_fold_indirect_ref): Likewise.
(cp_build_array_ref): Likewise.
* call.c (build_new_op_1): Likewise.
* semantics.c (finish_omp_clauses): Likewise.
(finish_omp_depobj): Likewise.
* typeck2.c (build_x_arrow): Likewise.
* cp-tree.h (cp_build_indirect_ref): Update declaration.

* call.c (build_new_op_1): Use location argument in warning_at.

* typeck.c (cp_build_modify_expr): Consistently use the
location_t argument.

/libcc1
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

* libcp1plugin.cc (plugin_pragma_push_user_expression): Update
cp_build_indirect_ref call.

/gcc/testsuite
2019-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/base-operand-non-pointer-1.C: New.
* g++.dg/pr53055.C: Check location too.
* g++.old-deja/g++.bugs/900213_02.C: Likewise.
* g++.old-deja/g++.bugs/900215_02.C: Likewise.
* g++.old-deja/g++.other/badarrow.C: Likewise.
* g++.old-deja/g++.other/deref1.C: Likewise.

* g++.dg/warn/Wenum-compare.C: Check location too.

* g++.dg/cpp0x/initlist26.C: Check location too.
* g++.dg/cpp0x/initlist28.C: Likewise.
* g++.dg/cpp0x/initlist29.C: Likewise.
* g++.dg/cpp0x/initlist33.C: Likewise.
* g++.dg/expr/string-2.C: Likewise.
* g++.dg/other/ptrmem5.C: Likewise.
* g++.old-deja/g++.benjamin/14664-1.C: Likewise.
* g++.old-deja/g++.benjamin/14664-2.C: Likewise.
* g++.old-deja/g++.brendan/init12.C: Likewise.
* g++.old-deja/g++.bugs/900324_04.C: Likewise.
* g++.old-deja/g++.ext/array1.C: Likewise.
* g++.old-deja/g++.jason/rfg17.C: Likewise.

From-SVN: r278685

4 years agoPrevent all uses of DFP when unsupported (PR c/91985).
Joseph Myers [Mon, 25 Nov 2019 13:45:42 +0000 (13:45 +0000)]
Prevent all uses of DFP when unsupported (PR c/91985).

Code that directly uses _Decimal* types on architectures not
supporting DFP is properly diagnosed ("error: decimal floating-point
not supported for this target"), via a call to
targetm.decimal_float_supported_p, if the _Decimal32, _Decimal64 or
_Decimal128 keywords are used to access it.  Use via mode attributes
is also diagnosed ("unable to emulate 'SD'"); so is use of the
FLOAT_CONST_DECIMAL64 pragma.  However, it is possible to access those
types via typeof applied to constants or built-in functions without
such an error.  I expect that there are ways to get an ICE from this;
certainly it uses a completely undefined ABI.

This patch arranges for the types not to exist in the compiler at all
when DFP is not supported.  As is done with unsupported _FloatN /
_FloatNx types, the global tree nodes are left as NULL_TREE, and the
built-in function machinery is made to use error_mark_node for them in
that case in builtin-types.def, so that the built-in functions are
unavailable.  Code handling constants is adjusted to give an error,
and other code that might not work with the global tree nodes being
NULL_TREE is also updated.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.  Also tested
with no regressions for cross to aarch64-linux-gnu, as a configuration
without DFP support.

PR c/91985
gcc:
* builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128)
(BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR): Define to
error_mark_node if corresponding global tree node is NULL.
* tree.c (build_common_tree_nodes): Do not initialize
dfloat32_type_node, dfloat64_type_node or dfloat128_type_node if
decimal floating-point not supported.

gcc/c:
* c-decl.c (finish_declspecs): Use int instead of decimal
floating-point types if decimal floating-point not supported.

gcc/c-family:
* c-common.c (c_common_type_for_mode): Handle decimal
floating-point types being NULL_TREE.
* c-format.c (get_format_for_type_1): Handle specified types being
NULL_TREE.
* c-lex.c (interpret_float): Give an error for decimal
floating-point constants when decimal floating-point not
supported.

gcc/lto:
* lto-lang.c (lto_type_for_mode): Handle decimal floating-point
types being NULL_TREE.

gcc/testsuite:
* gcc.dg/c2x-no-dfp-1.c, gcc.dg/gnu2x-builtins-no-dfp-1.c: New
tests.
* gcc.dg/fltconst-pedantic-dfp.c: Expect errors when decimal
floating-point not supported.

From-SVN: r278684

This page took 0.108094 seconds and 5 git commands to generate.