2019-12-09 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR tree-optimization/89007
* tree-vect-patterns.c (vect_recog_average_pattern): If there is no
target support available, generate code to distribute rshift over plus
and add a carry.
testsuite/
* gcc.target/aarch64/sve/pr89007-1.c: New test.
* gcc.target/aarch64/sve/pr89007-2.c: Likewise.
From-SVN: r279112
When concatenating a path ending in a root-directory onto another path,
we added an empty filename to the end of the path twice, but only
reserved space for one. That meant the second write went past the end of
the allocated buffer.
PR libstdc++/92853
* src/c++17/fs_path.cc (filesystem::path::operator+=(const path&)):
Do not process a trailing directory separator twice.
* testsuite/27_io/filesystem/path/concat/92853.cc: New test.
* testsuite/27_io/filesystem/path/concat/path.cc: Test more cases.
From-SVN: r279110
This patch fixes three sissues with -fprofile-reorder-functions:
1) First is that tp_first_run is stored as 32bit integer while it can easily
overflow (and does so during Firefox profiling).
2) Second problem is that flag_profile_functions can
not be tested w/o function context.
The changes to expand_all_functions makes it to work on mixed units by
first outputting all functions w/o -fprofile-reorder-function (or with no
profile info) and then outputting in first_run order
3) LTO partitioner was mixing up order by tp_first_run and by order.
for no_reorder we definitly want to order via first, while for everything
else we want to roder by second.
I have also merged duplicated comparators since they are bit fragile into
tp_first_run_node_cmp.
I originaly started to look into this because of undefined symbols with
Firefox PGO builds. These symbols went away with fixing these bug but I am not
quite sure how. it is possible that there is another problem in lto_blanced_map
but even after reading the noreorder code few times carefuly I did not find it.
Other explanation would be that our new qsort with broken comparator due to
overflow can actualy remove some entries in the array, but that sounds bit
crazy.
Bootstrapped/regested x86_64-linux.
* cgraph.c (cgraph_node::dump): Make tp_first_run 64bit.
* cgraph.h (cgrpah_node): Likewise.
(tp_first_run_node_cmp): Deeclare.
* cgraphunit.c (node_cmp): Rename to ...
(tp_first_run_node_cmp): ... this; export; watch for 64bit overflows;
clear tp_first_run for no_reorder and !flag_profile_reorder_functions.
(expand_all_functions): Collect tp_first_run and normal functions to
two vectors so the other functions remain sorted. Do not check for
flag_profile_reorder_functions it is function local flag.
* profile.c (compute_value_histograms): Update tp_first_run printing.
* lto-partition.c (node_cmp): Turn into simple order comparsions.
(varpool_node_cmp): Remove.
(add_sorted_nodes): Use node_cmp.
(lto_balanced_map): Use tp_first_run_node_cmp.
From-SVN: r279093
The value 0 in tp_first_run is special meaing that profile is unknown. We
should not set it to 1.
* ipa-split.c (split_function): Preserve 0 tp_first_run.
From-SVN: r279091
do_estimate_edge_time tests that cached and real values matches. This test
is not working precisely for global profiles because of roundoff issues when
profile of clones is subtracted from profile of offline body. This is checked
by presence of ipa counter. This breaks with partial profile training because
we turn IPA profiles to local when they drop to 0.
* ipa-inline-analysis.c (do_estimate_edge_time): Silence overactive
sanity check.
From-SVN: r279090
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92780
* resolve.c (resolve_assoc_var): Issue error if the associating
entity is a program.
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92780
* gfortran.dg/associate_50.f90: New test.
From-SVN: r279088
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92764
* interface.c (gfc_procedure_use): Check for existence of derived
component before using (twice).
2018-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92764
* gfortran.dg/interface_44.f90: New test.
From-SVN: r279087
2019-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92755
* dependency.c (gfc_dep_resolver): Move skipping of _data ref
into the loop.
2019-12-08 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92755
* gfortran.dg/dependency_57.f90: New test.
From-SVN: r279086
2019-12-07 Andrew Pinski <apinski@marvell.com>
* config/cpu/aarch64/opt/ext/opt_random.h: Wrap around with check
for little-endian like ext/random is done.
From-SVN: r279081
Compiling this testcase results in a bogus "invalid cast" error; this occurs
since the introduction of location wrappers in finish_id_expression.
Here we are parsing the decltype expression via cp_parser_decltype_expr which
can lead to calling various fold_* and c-family routines. They use
non_lvalue_loc, but that won't create a NON_LVALUE_EXPR wrapper around a location
wrapper.
So before the location wrappers addition cp_parser_decltype_expr would return
NON_LVALUE_EXPR <c>. Now it returns VIEW_CONVERT_EXPR<float *>(c), but the
STRIP_ANY_LOCATION_WRAPPER immediately following it strips the location wrapper,
and suddenly we don't know whether we have an lvalue anymore. And that's sad
because then decltype produces the wrong type, causing nonsense errors.
* fold-const.c (maybe_lvalue_p): Handle VIEW_CONVERT_EXPR.
* g++.dg/cpp0x/decltype73.C: New test.
From-SVN: r279077
PR middle-end/90840
* expr.c (expand_assignment): In the case of a CONCAT on the LHS, make
sure to pass a valid inner mode in calls to simplify_gen_subreg.
From-SVN: r279076
While trying out Dennis's Armv8.6-A patch, I noticed that texi2pod.pl
didn't handle the new @multitable correctly. There were two problems:
(1) @multitables nested in other @tables inherited the @item type from
the enclosing @table. Since the new @multitable is in a @table @samp,
we applied @samp markup to the @multitable @items. This in turn
meant that it captured the @tab separator in the @item markup.
Fixed by pushing an empty item code onto the stack.
(2) We didn't handle @headitem. Fixed by enclosing it in italics,
like we do for section headings. This causes it to be underlined
in the man output.
2019-12-07 Richard Sandiford <richard.sandiford@arm.com>
contrib/
* texi2pod.pl: Handle @headitems in @multitables, printing them
in italics. Push an empty item code onto the stack.
From-SVN: r279074
PR c/87488
* pretty-print.c (pp_begin_url, pp_end_url, test_urls): Use BEL
instead of ST sequence to terminate OSC 8 strings.
Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r279073
PR c++/92831
* call.c (build_conditional_expr_1): For ?: with omitted middle
operand use cp_stabilize_reference if arg1 is glvalue_p rather than
just if it is lvalue_p.
* g++.dg/ext/temp-extend1.C: New test.
From-SVN: r279069
* cp-tree.h (extend_ref_init_temps): Add a new argument with NULL
default arg.
* call.c (set_up_extended_ref_temp): Add COND_GUARD argument, pass it
down to extend_ref_init_temps. Before pushing cleanup, if COND_GUARD
is non-NULL, create a bool temporary if needed, initialize to false
and guard the cleanup with the temporary being true.
(extend_ref_init_temps_1): Add COND_GUARD argument, pass it down
to recursive calls and set_up_extended_ref_temp. Handle COND_EXPR.
(extend_ref_init_temps): Add COND_GUARD argument, pass it down to
recursive calls and to extend_ref_init_temps_1.
* g++.dg/cpp0x/temp-extend2.C: New test.
From-SVN: r279064
This patch makes the C++ frontend work with the verify_type_context hook.
We need some new type contexts for features that don't exist in C, but
otherwise the patch is very similar to the C one.
TCTX_CAPTURE_BY_COPY could really be treated as an instance of
TCTX_FIELD, but the error message is better if we split it out.
2019-12-06 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* target.h (TCTX_ALLOCATION, TCTX_DEALLOCATION, TCTX_EXCEPTIONS)
(TCTX_CAPTURE_BY_COPY): New type_context_kinds.
* config/aarch64/aarch64-sve-builtins.cc (verify_type_context):
Handle them.
gcc/cp/
* decl.c (start_decl_1): Use verify_type_context to check whether
the target allows variables of a particular type to have static
or thread-local storage duration.
(check_array_initializer): Use verify_type_context to check whether
the target allows a particular type to be used as an array element.
(create_array_type_for_decl): Likewise.
(cp_finish_decl): Use verify_type_context to check whether
the target allows static member variables of a particular type.
(grokdeclarator): Likewise. Also use verify_type_context to check
whether the target allows non-static member variables of a particular
type.
* except.c: Include target.h.
(is_admissible_throw_operand_or_catch_parameter): Use
verify_type_context to check whether the target allows particular
types to be thrown and caught.
* typeck2.c (add_exception_specifier): Likewise.
* init.c (build_new_1): Use verify_type_context to check whether
the target allows particular types to be dynamically allocated.
(build_vec_delete_1, build_delete): Use verify_type_context to check
whether the target allows particular types to be deleted.
* lambda.c (add_capture): Use verify_type_context to check
whether the target allows particular types to be captured by copy.
* pt.c: Include target.h.
(instantiate_class_template_1): Use verify_type_context to check
whether the target allows non-static member variables of a particular
type.
* typeck.c (cxx_alignof_expr): Use verify_type_context to check
whether the target allows the alignment of a particular type
to be measured.
(pointer_diff, cp_build_unary_op): Use verify_type_context to check
whether the target allows arithmetic involving pointers to particular
types.
gcc/testsuite/
* g++.dg/ext/sve-sizeless-1.C: New test.
* g++.dg/ext/sve-sizeless-2.C: Likewise.
From-SVN: r279058
2019-12-06 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn-valu.md (gather<mode>_insn_1offset<exec>): Use %o
in the asm output.
From-SVN: r279055
After the fix for PR c/36941 and PR c/88827 (r278976), this test emits
a different error message and needs an update.
2019-12-06 Christophe Lyon <christophe.lyon@linaro.org>
PR c/36941
PR c/88827
* gcc.target/aarch64/sve/acle/general-c/type_redef_11.c: Update
expected diagnostics.
From-SVN: r279039
prune_runtime_alias_test_list used ordered_remove to remove a merged
alias pair, which made the function quadratic when many aliases could
be removed.
I had a testcase in which these memmoves accounted for an impressive
85% of compile time. The fact that we had so many probably shows
a deeper problem, but still, it's easy to remove as we go.
2019-12-06 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* tree-data-ref.c (prune_runtime_alias_test_list): Exit early
for empty vectors. Avoid using ordered_remove and instead
shuffle the vector as we go.
From-SVN: r279038
2019-12-06 Richard Biener <rguenther@suse.de>
* genmatch.c (enum tree_code): Remove CONVERT{0,1,2} and
VIEW_CONVERT{0,1,2}.
(expr::opt_grp): Add and initialize.
(lower_opt_convert): Rename to ...
(lower_opt): ... and work on opt_grp, simply switching operations
from being optional to being present or not.
(has_opt_convert): Rename to ...
(has_opt): ... and adjust.
(parser::parse_operation): Return the optional opt_grp,
remove special-casing of conditional operations and more generally
parse [digit]'?'.
(parser::parse_expr): Stick on the parsed opt_grp and perform
rough verification.
(parser::parse_for): Remove now unnecessary code.
(main): Likewise.
* doc/match-and-simplify.texi: Mention ? now works on all
unary operations and also match predicates.
From-SVN: r279037