Piotr Trojanek [Thu, 31 Oct 2019 12:38:17 +0000 (13:38 +0100)]
[Ada] Accept objects from nested packages in Initializes contract
2020-06-02 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* sem_prag.adb (Collect_States_And_Objects): Call itself on
declaration of nested packages; append abstract states
one-by-one, so that in recursive call we do not overwrite the
ones that have been already collected.
Eric Botcazou [Sun, 15 Dec 2019 17:26:24 +0000 (18:26 +0100)]
[Ada] Use Standard.Natural on indices in support routines for Ada.Tags
2020-06-02 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_atag.ads (Build_Inherit_Predefined_Prims): Change type
of Num_Predef_Prim parameter from Int to Nat.
* exp_atag.adb (Build_Range): New procedure.
(Build_Val): Likewise.
(Build_CW_Membership): Call Build_Val.
(Build_Get_Predefined_Prim_Op_Address): Likewise.
(Build_Inherit_CPP_Prims): Likewise.
(Build_Get_Prim_Op_Address): Likewise.
(Build_Set_Predefined_Prim_Op_Address): Likewise.
(Build_Inherit_Prims): Call Build_Range.
(Build_Inherit_Predefined_Prims): Likewise. Change type of
Num_Predef_Prim parameter from Int to Nat.
Piotr Trojanek [Thu, 12 Dec 2019 10:45:24 +0000 (11:45 +0100)]
[Ada] Reuse Is_Package_Or_Generic_Package where possible
2020-06-02 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* contracts.adb, einfo.adb, exp_ch9.adb, sem_ch12.adb,
sem_ch4.adb, sem_ch7.adb, sem_ch8.adb, sem_elab.adb,
sem_type.adb, sem_util.adb: Reuse Is_Package_Or_Generic_Package
where possible (similarly, reuse Is_Concurrent_Type if it was
possible in the same expressions).
Iain Buclaw [Sun, 31 May 2020 22:18:44 +0000 (00:18 +0200)]
Fix unrecognised -mcpu target 'armv7-a' on arm-wrs-vxworks7
In the removal of arm-wrs-vxworks, the default cpu was updated from arm8
to armv7-a, but this is not recognized as a valid -mcpu target. There
is however generic-armv7-a, which was likely the intended cpu that
should have been used instead.
gcc/ChangeLog:
PR target/95420
* config.gcc (arm-wrs-vxworks7*): Set default cpu to generic-armv7-a.
Iain Buclaw [Mon, 1 Jun 2020 11:27:06 +0000 (13:27 +0200)]
d: Fix segfault in build_frontend_type on alpha-*-*
The va_list type for Alpha includes a nameless dummy field for alignment
purposes. To transpose this into D, a field named "__pad%d" is inserted
into the struct definition.
It was also noticed that in the D front-end AST copy of the backend
type, all offsets for fields generated by build_frontend_type were set
to zero due to a wrong assumption that DECL_FIELD_OFFSET would have a
non-zero value. This has been fixed to use byte_position instead.
gcc/d/ChangeLog:
* d-builtins.cc (build_frontend_type): Handle struct fields with NULL
DECL_NAME. Use byte_position to get the real field offset.
The patch successfully bootstraps on x86_64-linux-gnu and
ppc64le-linux-gnu. I also tested ppc64-linux-gnu that exposed:
https://reviews.llvm.org/D80864 (which is fixed on master).
Abidiff looks happy and I made UBSAN and ASAN bootstrap on
x86_64-linux-gnu.
I'm planning to do merge from master twice a year, once now and
next time short before stage1 closes.
I am going to install the patches as merge from master is obvious
and I haven't made anything special.
Kito Cheng [Tue, 2 Jun 2020 16:17:12 +0000 (10:17 -0600)]
testsuite: Disable colorization for ubsan test
- Run gcc testsuite with qemu will print out ascii color code for
ubsan related testcase, however several testcase didn't consider
that, so disable colorization prevent such problem and simplify the
process when adding testcase in future.
- Verified on native X86 and RISC-V qemu full system mode and user mode.
gcc/testsuite/ChangeLog:
* lib/ubsan-dg.exp (orig_ubsan_options_saved): New
(orig_ubsan_options): Ditto.
(ubsan_init): Store UBSAN_OPTIONS and set UBSAN_OPTIONS.
(ubsan_finish): Restore UBSAN_OPTIONS.
Patrick Palka [Tue, 2 Jun 2020 01:37:04 +0000 (21:37 -0400)]
c++: constrained lambda inside template [PR92633]
When regenerating a constrained lambda during instantiation of an
enclosing template, we are forgetting to substitute into the lambda's
constraints. Fix this by substituting through the constraints during
tsubst_lambda_expr.
gcc/cp/ChangeLog:
PR c++/92633
PR c++/92838
* pt.c (tsubst_function_decl): Don't do set_constraints when
regenerating a lambda.
(tsubst_lambda_expr): Substitute into the lambda's constraints
and do set_constraints here.
gcc/testsuite/ChangeLog:
PR c++/92633
PR c++/92838
* g++.dg/cpp2a/concepts-lambda11.C: New test.
* g++.dg/cpp2a/concepts-lambda12.C: New test.
Jonathan Wakely [Mon, 1 Jun 2020 23:07:05 +0000 (00:07 +0100)]
libstdc++: Fix filesystem::u8path for mingw targets (PR 95392)
When I refactored filesystem::path string conversions in
r11-587-584d52b088f9fcf78704b504c3f1f07e17c1cded I failed to update the
mingw-specific code in filesystem::u8path, causing a bootstrap failure.
This fixes it, and further refactors the mingw-specific code along the
same lines as the previous commit. All conversions from UTF-8 strings to
wide strings now use the same helper function, __wstr_from_utf8.
PR libstdc++/95392
* include/bits/fs_path.h (path::_S_to_string): Move to
namespace-scope and rename to ...
(__detail::__string_from_range): ... this.
[WINDOWS] (__detail::__wstr_from_utf8): New function template to
convert a char sequence containing UTF-8 to wstring.
(path::_S_convert(Iter, Iter)): Adjust call to _S_to_string.
(path::_S_convert_loc(Iter, Iter, const locale&)): Likewise.
(u8path(InputIterator, InputIterator)) [WINDOWS]: Use
__string_from_range to obtain a contiguous range and
__wstr_from_utf8 to obtain a wide string.
(u8path(const Source&)) [WINDOWS]: Use __effective_range to
obtain a contiguous range and __wstr_from_utf8 to obtain a wide
string.
(path::_S_convert(const _EcharT*, const _EcharT)) [WINDOWS]:
Use __wstr_from_utf8.
Uros Bizjak [Mon, 1 Jun 2020 20:23:51 +0000 (22:23 +0200)]
i386: Add __attribute__ ((gcc_struct)) to struct fenv [PR95418]
Windows ABI (MinGW) is different than Linux ABI when bitfileds are involved.
The following patch adds __attribute__ ((gcc_struct)) to struct fenv in order
to match the layout of x87 state image in memory.
Iain Sandoe [Mon, 1 Jun 2020 07:28:35 +0000 (08:28 +0100)]
coroutines: Correct handling of references in parm copies [PR95350].
Adjust to handle rvalue refs the same way as clang, and to correct
the handling of moves when a copy CTOR is present. This is one area
where we could make things easier for the end-user (as was implemented
before this change), however there needs to be agreement about when the
full statement containing a coroutine call ends (i.e. when the ramp
terminates or when the coroutine terminates).
PR c++/95350
* g++.dg/coroutines/torture/func-params-08.C: Adjust test to
reflect that all rvalue refs are dangling.
* g++.dg/coroutines/torture/func-params-09-awaitable-parms.C:
Likewise.
* g++.dg/coroutines/pr95350.C: New test.
I noticed recently that our input_iterator_wrapper utility for writing
tests has the following post-increment operator:
void
operator++(int)
{
++*this;
}
That fails to meet the Cpp17InputIterator requirement that *r++ is
valid. This change makes it return a non-void proxy type that can be
deferenced to produce another proxy, which is convertible to the
value_type. The second proxy converts to const T& to ensure it can't be
written to.
Jonathan Wakely [Mon, 1 Jun 2020 15:40:13 +0000 (16:40 +0100)]
libstdc++: Fix incorrect Docbook links
The <xref> element creates the link text automatically from the link
target, rather than using the text node child of the element. This can
be changed by using an endterm attribute, but it's simpler to just use
the <link> element instead.
Jan Hubicka [Mon, 1 Jun 2020 13:57:32 +0000 (15:57 +0200)]
Cleanup global decl stream reference streaming, part 1
This patch further simplifies way we reffer to global stream. Every function
section has vector of references to global trees which are populated during
streaming. This vector is for some reason divided into field_decls, fn_decls,
type_decls, types, namespace_decls, labels_decls and var_decls which contains
also other things.
There is no benefit for this split except perhaps for making the indexes
bit smaller and possibly better encodable by ulebs. This however does not
pay back and makes things unnecesarily complex.
We may want to re-add multiple tables if we start streaming something else than
trees into the global stream, but that would not work with current
infrastructure anyway.
The patch drops different streams and I checked that it results in reduction of
global stream and apparently very small increase in function streams but it may
be just because I updated tree in between the tests. This will be fixed by
incremental patch.
The patch also removes some of ugly macro generators of accessors functions and
makes it easier to further optimize the way we stream references to trees which
I plan to do incrementally.
I also made the API for streaming referneces symmetric. I.e. you
stream out by
lto_output_var_decl_ref
and stream in by
lto_input_var_decl_ref
instead streaming out by
lto_output_var_decl_index
and streaming in by
decl_index = streamer_read_uhwi (ib);
lto_file_decl_data_get_fn_decl (file_data, decl_index);
lto-bootstrapped/regtested x86_64-linux, will commit it shortly.
Feng Xue [Tue, 3 Mar 2020 02:32:40 +0000 (10:32 +0800)]
Fix dump in clone materialization
2020-06-01 Feng Xue <fxue@os.amperecomputing.com>
gcc/
* cgraphclones.c (materialize_all_clones): Adjust replace map dump.
* ipa-param-manipulation.c (ipa_dump_adjusted_parameters): Do not
dump infomation if there is no adjusted parameter.
* (ipa_param_adjustments::dump): Adjust prefix spaces for dump string.
Iain Sandoe [Sun, 31 May 2020 19:30:10 +0000 (20:30 +0100)]
coroutines: Avoid functions with unlowered coroutine trees [PR95087].
Diagnosing bad uses of 'return' in coroutines is somewhat
tricky, since the user can use the keyword before we know
that the function is a coroutine (where such returns are not
permitted). At present, we are just doing a check for any
use of 'return' and erroring on that. However, we can't then
pass the function body on, since it will contain unlowered
coroutine trees.
This avoids the issue by dropping the entire function body
under that circumstance. We could do better (for 11) but
this is intended to allow back-port of other fixes to 10.
gcc/cp/ChangeLog:
PR c++/95087
* coroutines.cc (morph_fn_to_coro): If we see an
early fatal error, drop the erroneous function body.
gcc/testsuite/ChangeLog:
PR c++/95087
* g++.dg/coroutines/co-return-syntax-08-bad-return.C:
Adjust the testcase to do the compile (rather than an
-fsyntax-only parse).
Jakub Jelinek [Sun, 31 May 2020 08:45:21 +0000 (10:45 +0200)]
expr: Fix fallout from optimize store_expr from STRING_CST [PR95052]
> Can't hurt, and debugging the assert tripping is likely a hell of a lot easier
> than debugging the resultant incorrect code. So if it passes, then I'd say go
> for it.
Testing passed, so I've committed it with those asserts (and thankfully I've
added them!) but it apparently broke Linux kernel build on arm.
The problem is that if the STRING_CST is very short, while the full object
has BLKmode, the short string could very well have
QImode/HImode/SImode/DImode and in that case it wouldn't take the path that
copies the string and then clears the remaining space, but different paths
in which it will ICE because of those asserts and without those it would
just emit wrong-code.
The following patch fixes it by enforcing BLKmode for the string MEM, even
if it is short, so that we copy it and memset the rest.
2020-05-31 Jakub Jelinek <jakub@redhat.com>
PR middle-end/95052
* expr.c (store_expr): For shortedned_string_cst, ensure temp has
BLKmode.
Arnaud Charlet [Sat, 30 May 2020 18:40:02 +0000 (14:40 -0400)]
Ability to build the GNAT runtime with project files
This change add project files to provide the ability to rebuild the
runtime with gprbuild after setup-rts is called.
gcc/ada/
* Makefile.rtl (ADA_INCLUDE_SRCS): Replace Makefile.adalib by
libada.gpr and associated project files.
(g-debpoo.o): Add missing rule to ensure subprograms are not reordered.
(setup-rts): Add generation of libgnat/libgnarl.lst.
(LIBGNAT_SRCS): Remove thread.c which is part of libgnarl.
* tracebak.c, tb-gcc.c: Merged the two files to simplify dependencies.
* libgnarl/libgnarl.gpr, libgnat/libada.gpr,
libgnat/libgnat.gpr, libgnat/libgnat_common.gpr: New files.
* doc/gnat_ugn/the_gnat_compilation_model.rst: Makefile.adalib
replaced by libada.gpr.
* libgnat/system-mingw.ads: Remove obsolete comment.
* gcc-interface/Makefile.in: Remove dependency on tb-gcc.c.
Harald Anlauf [Sat, 30 May 2020 18:59:41 +0000 (20:59 +0200)]
PR fortran/95373 - ICE in build_reference_type, at tree.c:7942
The use of KIND, LEN, RE, and IM inquiry references for applicable intrinsic
types is valid only for suffienctly new Fortran standards. Add appropriate
checks in the appropriate place.
2020-05-30 Harald Anlauf <anlauf@gmx.de>
gcc/fortran/
PR fortran/95373
* primary.c (is_inquiry_ref): Move validity check of inquiry
references against selected Fortran standard from here...
(gfc_match_varspec) ...to here.
This is necessary as libmsvcrt.a is not a pure import library, but
also contains some functions that invoke others in KERNEL32.DLL.
gcc/
* config/i386/mingw32.h (REAL_LIBGCC_SPEC): Insert -lkernel32
after -lmsvcrt. This is necessary as libmsvcrt.a is not a pure
import library, but also contains some functions that invoke
others in KERNEL32.DLL.
Signed-off-by: Liu Hao <lh_mouse@126.com> Signed-off-by: Jonathan Yong <10walls@gmail.com>
Patrick Palka [Sat, 30 May 2020 01:12:21 +0000 (21:12 -0400)]
c++: satisfaction value of type typedef to bool [PR95386]
In the testcase below, the satisfaction value of fn1<int>'s constraint
is INTEGER_CST '1' of type BOOLEAN_TYPE value_type, which is a typedef
to the standard boolean_type_node. But satisfaction_value expects to
see exactly boolean_true_node or integer_one_node, which this value is
neither, causing us to trip over the assert therein.
This patch changes satisfaction_value to accept INTEGER_CST of any
boolean type.
gcc/cp/ChangeLog:
PR c++/95386
* constraint.cc (satisfaction_value): Accept INTEGER_CST of any
boolean type.
gcc/testsuite/ChangeLog:
PR c++/95386
* g++.dg/concepts/pr95386.C: New test.
rs6000: Prefer VSX insns over VMX ones (part 1: perm and mrg)
There are various VSX insns that do the same job as (older) AltiVec
insns, just with a wider range of possible registers. Many patterns
for such insns have the "v" alternative before the "wa" alternative,
which makes the output less readable than possible (since vs32 is v0,
and most insns before or after this insn will be VSX as well).
This changes the define_insns for the mrg and perm machine instructions
to prefer the VSX form. No behaviour change. Only one testcase needed
a little adjustment as well.
Patrick Palka [Fri, 22 May 2020 14:28:19 +0000 (10:28 -0400)]
c++: P0848R3 and member function templates [PR95181]
When comparing two special member function templates to see if one hides
the other (as per P0848R3), we need to check satisfaction which we can't
do on templates. So this patch makes add_method skip the eligibility
test on member function templates and just lets them coexist.
gcc/cp/ChangeLog:
PR c++/95181
* class.c (add_method): Let special member function templates
coexist if they are not equivalently constrained, or in a class
template.
gcc/testsuite/ChangeLog:
PR c++/95181
* g++.dg/concepts/pr95181.C: New test.
* g++.dg/concepts/pr95181-2.C: New test.
Jason Merrill [Fri, 29 May 2020 20:55:52 +0000 (16:55 -0400)]
c++: Template template parameter in constraint [PR95371]
any_template_parm_r was assuming that the DECL_TEMPLATE_RESULT of a template
will have a suitable TEMPLATE_INFO from which we can look at the generic
arguments for that template. But that wasn't true for a template template
parameter; this patch makes it so.
gcc/cp/ChangeLog:
PR c++/95371
* pt.c (process_template_parm): Set DECL_TEMPLATE_INFO
on the DECL_TEMPLATE_RESULT.
gcc/testsuite/ChangeLog:
PR c++/95371
* g++.dg/cpp2a/concepts-ttp1.C: New test.
Jan Hubicka [Fri, 29 May 2020 20:41:11 +0000 (22:41 +0200)]
Simplify tree streaming.
this patch cleans up tree streaming. The code is prepared to stream nested
trees, but we only handle flat trees. As a result we have quite heavy function
to stream in/out tree reference which is used many times and shows up in
profile.
This patch adds stream_write_tree_ref/stream_read_tree_ref which is used to
stream references to trees that are required to exist in the cache or be
indexable.
The actual implementation is just a first cut. I would like to make it more
compact. We used to stream 2 byte tag (as UHWI) + UHWI representing the index.
Now we stream one UHWI that represent type of reference + index for references
to cache, but still two integers for references to global stream. This is
becaue the abstraction is not very helpful here and I want to clean this up
incrementally.
I would also like to get rid of the ref_p parameters which seems unnecessary for
flat streams.
This reduces around 7% of global stream, 3% when compressed.
More reduction will happen once the format is sanitized a bit.
from
[WPA] read 4597161 unshared trees
[WPA] read 2937414 mergeable SCCs of average size 1.364280
[WPA] 8604617 tree bodies read in total
[WPA] tree SCC table: size 524287, 247507 elements, collision ratio: 0.377468
[WPA] tree SCC max chain length 2 (size 1)
[WPA] Compared 2689907 SCCs, 184 collisions (0.000068)
[WPA] Merged 2689890 SCCs
[WPA] Merged 3722677 tree bodies
[WPA] Merged 632040 types
...
[WPA] Compression: 88124141 input bytes, 234906430 uncompressed bytes (ratio: 2.665631)
[WPA] Size of mmap'd section decls: 88124141 bytes
...
[WPA] Compression: 113758813 input bytes, 316149514 uncompressed bytes (ratio: 2.779121)
[WPA] Size of mmap'd section decls: 88124141 bytes
[WPA] Size of mmap'd section function_body: 14485721 bytes
to
[WPA] read 4597174 unshared trees
[WPA] read 2937413 mergeable SCCs of average size 1.364280
[WPA] 8604629 tree bodies read in total
[WPA] tree SCC table: size 524287, 247509 elements, collision ratio: 0.377458
[WPA] tree SCC max chain length 2 (size 1)
[WPA] Compared 2689904 SCCs, 183 collisions (0.000068)
[WPA] Merged 2689888 SCCs
[WPA] Merged 3722675 tree bodies
[WPA] Merged 632041 types
....
[WPA] Size of mmap'd section decls: 86177293 bytes
[WPA] Compression: 86177293 input bytes, 217625095 uncompressed bytes (ratio: 2.525318)
....
[WPA] Compression: 111682269 input bytes, 297228756 uncompressed bytes (ratio: 2.661378)
[WPA] Size of mmap'd section decls: 86177293 bytes
[WPA] Size of mmap'd section function_body: 14349032 bytes
Harald Anlauf [Fri, 29 May 2020 19:19:31 +0000 (21:19 +0200)]
PR fortran/95090 - ICE: identifier overflow
The initial fix for this PR uncovered several latent issues with further
too small string buffers which showed up only when testing on i686.
Provide sufficiently large temporaries.
2020-05-29 Harald Anlauf <anlauf@gmx.de>
gcc/fortran/
PR fortran/95090
* class.c (get_unique_type_string): Enlarge temporary for
name-mangling. Use strncpy to prevent buffer overrun.
(get_unique_hashed_string): Enlarge temporary.
(gfc_hash_value): Enlarge temporary for name-mangling.
Marek Polacek [Tue, 26 May 2020 23:59:26 +0000 (19:59 -0400)]
c++: Fix bogus -Wparentheses warning [PR95344]
Since r267272, which added location wrappers, cp_fold loses
TREE_NO_WARNING on a MODIFY_EXPR that finish_parenthesized_expr set, and
that results in a bogus -Wparentheses warning.
I.e., previously we had "b = 1" but now we have "VIEW_CONVERT_EXPR<bool>(b) = 1"
and cp_fold_maybe_rvalue folds away the location wrapper and so we do
2718 x = fold_build2_loc (loc, code, TREE_TYPE (x), op0, op1);
in cp_fold and the flag is lost.
PR c++/95344
* cp-gimplify.c (cp_fold) <case MODIFY_EXPR>: Don't set
TREE_THIS_VOLATILE here.
(cp_fold): Set it here along with TREE_NO_WARNING.
Patrick Palka [Fri, 29 May 2020 13:40:40 +0000 (09:40 -0400)]
c++: lambdas inside constraints [PR92652]
When parsing a constraint-expression, a requires-clause or a
requires-expression, we temporarily increment processing_template_decl
so that we always obtain template trees which we could later reduce via
substitution even when not inside a template.
But incrementing processing_template_decl when we're already inside a
template has the unintended side effect of shifting up the template
parameter levels of a lambda defined inside one of these constructs,
which leads to confusion later during substitution into the lambda.
This patch fixes this issue by incrementing processing_template_decl
during parsing of these constructs only if it is 0.
Passes 'make check-c++', and also tested by building cmcstl2, does this
look OK to commit after a full bootstrap/regtest?
gcc/cp/ChangeLog:
PR c++/92652
PR c++/93698
PR c++/94128
* parser.c (cp_parser_requires_clause_expression): Temporarily
increment processing_template_decl only if it is 0.
(cp_parser_constraint_expression): Likewise.
(cp_parser_requires_expression): Likewise.
gcc/testsuite/ChangeLog:
PR c++/92652
PR c++/93698
PR c++/94128
* g++.dg/cpp2a/concepts-lambda8.C: New test.
* g++.dg/cpp2a/concepts-lambda9.C: New test.
* g++.dg/cpp2a/concepts-lambda10.C: New test.
Patrick Palka [Fri, 29 May 2020 13:44:09 +0000 (09:44 -0400)]
c++: constexpr ctor with RANGE_EXPR index [PR95241]
In the testcase below, the CONSTRUCTOR for 'field' contains a RANGE_EXPR
index:
{{aggr_init_expr<...>, [1...2]={.off=1}}}
but get_or_insert_ctor_field isn't prepared to handle looking up a
RANGE_EXPR index.
This patch adds limited support to get_or_insert_ctor_field for looking
up a RANGE_EXPR index. The limited scope of this patch should make it
more suitable for backporting, and more extensive support would be
needed only to handle self-modifying CONSTRUCTORs that contain a
RANGE_EXPR index, but I haven't yet been able to come up with a testcase
that actually creates such a CONSTRUCTOR.
gcc/cp/ChangeLog:
PR c++/95241
* constexpr.c (get_or_insert_ctor_field): Add limited support
for RANGE_EXPR index lookups.
gcc/testsuite/ChangeLog:
PR c++/95241
* g++.dg/cpp0x/constexpr-array25.C: New test.
This adds SLP_TREE_REPRESENTATIVE - a representative stmt-info that
is used by SLP analysis and code generation. This avoids the need
for the hack in vect_slp_rearrange_stmts which previously avoided
to re-arrange stmts that might not have been isomorphic because
of operand swapping. It also plays nice with future directions of SLP
and for the forseeable future is easier than replicating more and
more info in the SLP node as long as non-SLP is in-tree.
2020-05-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/95272
* tree-vectorizer.h (_slp_tree::representative): Add.
(SLP_TREE_REPRESENTATIVE): Likewise.
* tree-vect-loop.c (vectorizable_reduction): Adjust SLP
node gathering.
(vectorizable_live_operation): Use the representative to
attach the reduction info to.
* tree-vect-slp.c (_slp_tree::_slp_tree): Initialize
SLP_TREE_REPRESENTATIVE.
(vect_create_new_slp_node): Likewise.
(slp_copy_subtree): Copy it.
(vect_slp_rearrange_stmts): Re-arrange even COND_EXPR stmts.
(vect_slp_analyze_node_operations_1): Pass the representative
to vect_analyze_stmt.
(vect_schedule_slp_instance): Pass the representative to
vect_transform_stmt.
Richard Biener [Fri, 29 May 2020 08:46:06 +0000 (10:46 +0200)]
tree-optimization/95356 - more vectorizable_shift massaging
The previous fix clashed with the rewrite to emit SLP invariants
during the SLP walk. Thus the following adjusts the SLP tree
hacking vectorizable_shift does appropriately.
Still resisting the attempt of a rewrite of vectorizable_shift ...
2020-05-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/95356
* tree-vect-stmts.c (vectorizable_shift): Do in-place SLP
node hacking during analysis.
Jan Hubicka [Fri, 29 May 2020 10:25:48 +0000 (12:25 +0200)]
Fix streamer desynchornization caused by streamer debugging patch
it turns out I lost one hunk in the patch disabling extra streaming
which causes streamer to go out of sync in the case non-trivial scc
containing the node being streamed appears in local stream (which seems
quite rare since it does not happen during bootstrap).
Martin Liska [Fri, 29 May 2020 09:29:25 +0000 (11:29 +0200)]
Fix various limitations of git-backport.py.
I've just tested the script and I'm going to install the patch
to all active branches.
contrib/ChangeLog:
* git-backport.py: The script did 'git co HEAD~' when
there was no modified ChangeLog file in a successful
git cherry pick.
Run cherry-pick --continue without editor.
Jakub Jelinek [Fri, 29 May 2020 08:42:50 +0000 (10:42 +0200)]
expander: Optimize store_expr from STRING_CST [PR95052]
In the following testcase, store_expr of e.g. 97 bytes long string literal
into 1MB long array is implemented by copying the 97 bytes from .rodata
section, followed by clearing the remaining bytes. But, as the STRING_CST
has type char[1024*1024], we actually allocate whole 1MB in .rodata section
for it, even when we only use the first 97 bytes from that.
The following patch tweaks it so that if we are going to initialize only the
small part from it, we don't emit all the zeros that we never use after it.
2020-05-29 Jakub Jelinek <jakub@redhat.com>
PR middle-end/95052
* expr.c (store_expr): If expr_size is constant and significantly
larger than TREE_STRING_LENGTH, set temp to just the
TREE_STRING_LENGTH portion of the STRING_CST.
Richard Biener [Fri, 29 May 2020 07:25:53 +0000 (09:25 +0200)]
tree-optimization/95393 - fold MIN/MAX_EXPR generated by phiopt
This makes sure to fold generated stmts so they do not survive
until RTL expansion and cause awkward code generation.
2020-05-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/95393
* tree-ssa-phiopt.c (minmax_replacement): Use gimple_build
to build the min/max expression so we simplify cases like
MAX(0, s) immediately.
* gcc.dg/tree-ssa/phi-opt-21.c: New testcase.
* g++.dg/vect/slp-pr87105.cc: Adjust.
Joe Ramsay [Fri, 29 May 2020 07:44:37 +0000 (08:44 +0100)]
aarch64: add support for unpacked EOR, ORR and AND
Extended patterns for these instructions to support unpacked vectors.
BIC will have to wait, as there is not currently support for unpacked
NOT.
2020-05-29 Joe Ramsay <joe.ramsay@arm.com>
gcc/
* config/aarch64/aarch64-sve.md (<LOGICAL:optab><mode>3): Add support
for unpacked EOR, ORR, AND.
gcc/testsuite/
* gcc.target/aarch64/sve/load_const_offset_2.c: Force using packed
vectors.
* gcc.target/aarch64/sve/logical_unpacked_and_1.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_and_2.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_and_3.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_and_4.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_and_5.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_and_6.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_and_7.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_eor_1.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_eor_2.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_eor_3.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_eor_4.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_eor_5.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_eor_6.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_eor_7.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_orr_1.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_orr_2.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_orr_3.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_orr_4.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_orr_5.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_orr_6.c: New test.
* gcc.target/aarch64/sve/logical_unpacked_orr_7.c: New test.
* gcc.target/aarch64/sve/scatter_store_6.c: Force using packed vectors.
* gcc.target/aarch64/sve/scatter_store_7.c: Force using packed vectors.
* gcc.target/aarch64/sve/strided_load_3.c: Force using packed vectors.
* gcc.target/aarch64/sve/strided_store_3.c: Force using packed vectors.
* gcc.target/aarch64/sve/unpack_signed_1.c: Force using packed vectors.
Jakub Jelinek [Thu, 28 May 2020 21:40:54 +0000 (23:40 +0200)]
c++: Try to complete decomp types [PR95328]
Two years ago Paolo has added the
else if (processing_template_decl && !COMPLETE_TYPE_P (type))
pedwarn (...);
lines into cp_finish_decomp. For type dependent decl we punt much earlier,
but even for types which aren't type dependent COMPLETE_TYPE_P might be
false as this testcase shows, so this patch tries to complete_type first
(the reason for writing it that way is that it is then followed by another
else if and if complete_type returns error_mark_node, we shouldn't report
anything, as a bug should have been reported already.
2020-05-28 Jakub Jelinek <jakub@redhat.com>
PR c++/95328
* decl.c (cp_finish_decomp): Call complete_type before checking
COMPLETE_TYPE_P.
Harald Anlauf [Thu, 28 May 2020 20:28:08 +0000 (22:28 +0200)]
PR fortran/95373 - ICE in build_reference_type, at tree.c:7942
The use of KIND, LEN, RE, and IM inquiry references for applicable intrinsic
types is valid only for suffienctly new Fortran standards. Add appropriate
check.
2020-05-28 Harald Anlauf <anlauf@gmx.de>
gcc/fortran/
PR fortran/95373
* primary.c (is_inquiry_ref): Check validity of inquiry
references against selected Fortran standard.
gcc/testsuite/
PR fortran/95373
* gfortran.dg/pr95373_1.f90: New test.
* gfortran.dg/pr95373_2.f90: New test.
Jason Merrill [Thu, 28 May 2020 04:35:56 +0000 (00:35 -0400)]
c++: Immediately deduce auto member [PR94926].
In r9-297 I was trying to be more flexible and treat static data members of
class templates more like variable templates, where the type need not be
determined until the variable is instantiated, but I suppose that in a class
the types of all the non-template members need to be determined at the time
of class instantiation.
gcc/cp/ChangeLog:
PR c++/94926
* decl.c (cp_finish_decl): Revert r9-297 change.
(check_static_variable_definition): Likewise.
* constexpr.c (ensure_literal_type_for_constexpr_object): Likewise.
* pt.c (instantiate_decl): Return early on type error.
Nicolás Bértolo [Fri, 22 May 2020 20:54:41 +0000 (17:54 -0300)]
jit: port libgccjit to Windows
2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
/ChangeLog:
* configure.ac: Don't require --enable-host-shared when building
for Mingw.
* configure: Regenerate.
2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
gcc/ChangeLog:
* Makefile.in: don't look for libiberty in the "pic" subdirectory
when building for Mingw. Add dependency on xgcc with the proper
extension.
2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
gcc/c/ChangeLog:
* Make-lang.in: Remove extra slash.
2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
gcc/jit/ChangeLog:
* Make-lang.in: Remove extra slash. Build libgccjit.dll and its
import library in Windows.
* config-lang.in: Update comment about --enable-host-shared.
* jit-w32.h: New file.
* jit-w32.c: New file.
(print_last_error): New function that prints the error
string corresponding to GetLastError().
(get_TOKEN_USER_current_user): Helper function used for getting
the SID belonging to the current user.
(create_directory_for_current_user): Helper function to create
a directory with permissions such that only the current user can
access it.
(win_mkdtemp): Create a temporary directory using Windows APIs.
* jit-playback.c: Do not chmod files in Windows. Use LoadLibrary,
FreeLibrary and GetProcAddress instead of libdl.
* jit-result.h, jit-result.c: Introduce result::handle_t to
abstract over the types used for dynamic library handles.
* jit-tempdir.c: Do not use mkdtemp() in Windows, use
win_mkdtemp().