2020-06-02 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_ch3.adb (Replace_Discriminants): Preserve the Etype of the
Name of N_Variant_Part nodes when rewriting it.
2020-06-02 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_ch3.adb (Signed_Integer_Type_Declaration): Change the type
of the bounds from Universal_Integer to Implicit_Base.
2020-06-02 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* lib-xref-spark_specific.adb (Create_Heap): use a new variant
of Name_Enter to directly converts String to Make_Id.
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).
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.
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.
Merged from revision b638b63b99d66786cb37336292604a2ae3490cfd.
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.
libsanitizer/ChangeLog:
* MERGE: Merge from master.
- 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.
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.
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.
Another case where we can't find the OBJ_TYPE_REF_OBJECT in the
OBJ_TYPE_REF_EXPR. So let's just evaluate the sanitize call first.
gcc/cp/ChangeLog:
PR c++/95466
PR c++/95311
PR c++/95221
* class.c (build_vfn_ref): Revert 95311 change.
* cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
COMPOUND_EXPR.
gcc/testsuite/ChangeLog:
PR c++/95466
* g++.dg/ubsan/vptr-17.C: New test.
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.
2020-06-01 Uroš Bizjak <ubizjak@gmail.com>
libatomic/ChangeLog:
* config/x86/fenv.c (struct fenv): Add __attribute__ ((gcc_struct)).
libgcc/ChangeLog:
* config/i386/sfp-exceptions.c (struct fenv):
Add __attribute__ ((gcc_struct)).
libgfortran/ChangeLog:
PR libfortran/95418
* config/fpu-387.h (struct fenv): Add __attribute__ ((gcc_struct)).
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).
gcc/cp/ChangeLog:
PR c++/95350
* coroutines.cc (struct param_info): Remove rv_ref field.
(build_actor_fn): Remove specifial rvalue ref handling.
(morph_fn_to_coro): Likewise.
gcc/testsuite/ChangeLog:
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.
* testsuite/util/testsuite_iterators.h:
(input_iterator_wrapper::operator++(int)): Return proxy object.
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.
* doc/xml/manual/containers.xml: Replace <xref> with <link>.
* doc/xml/manual/evolution.xml: Likewise.
* doc/html/manual/api.html: Regenerate.
* doc/html/manual/containers.html: Regenerate.
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.
[WPA] Compression: 86220483 input bytes, 217762146 uncompressed bytes (ratio: 2.525643)
[WPA] Compression: 111735464 input bytes, 297410918 uncompressed bytes (ratio: 2.661741)
[WPA] Size of mmap'd section decls: 86220483 bytes
[WPA] Size of mmap'd section function_body: 14353447 bytes
to:
[WPA] Compression: 85754594 input bytes, 216006049 uncompressed bytes (ratio: 2.518886)
[WPA] Compression: 111370381 input bytes, 295746052 uncompressed bytes (ratio: 2.655518)
[WPA] Size of mmap'd section decls: 85754594 bytes
[WPA] Size of mmap'd section function_body: 14447946 bytes
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.
gcc/ChangeLog:
2020-06-01 Jan Hubicka <hubicka@ucw.cz>
* ipa-reference.c (stream_out_bitmap): Use lto_output_var_decl_ref.
(ipa_reference_read_optimization_summary): Use lto_intput_var_decl_ref.
* lto-cgraph.c (lto_output_node): Likewise.
(lto_output_varpool_node): Likewise.
(output_offload_tables): Likewise.
(input_node): Likewise.
(input_varpool_node): Likewise.
(input_offload_tables): Likewise.
* lto-streamer-in.c (lto_input_tree_ref): Declare.
(lto_input_var_decl_ref): Declare.
(lto_input_fn_decl_ref): Declare.
* lto-streamer-out.c (lto_indexable_tree_ref): Use only one decl stream.
(lto_output_var_decl_index): Rename to ..
(lto_output_var_decl_ref): ... this.
(lto_output_fn_decl_index): Rename to ...
(lto_output_fn_decl_ref): ... this.
* lto-streamer.h (enum lto_decl_stream_e_t): Remove per-type streams.
(DEFINE_DECL_STREAM_FUNCS): Remove.
(lto_output_var_decl_index): Remove.
(lto_output_fn_decl_index): Remove.
(lto_output_var_decl_ref): Declare.
(lto_output_fn_decl_ref): Declare.
(lto_input_var_decl_ref): Declare.
(lto_input_fn_decl_ref): Declare.
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.
There is a stray change (introducing a bogus line at the top) that
came via 2babbb6760c43bcd803a5e168ef5ecb0be8a5121; remove that again.
* doc/xml/manual/policy_data_structures_biblio.xml: Remove
stray change.
Use the GLIBCXX_CHECK_MATH_DECL macro to check for the full list of
vxworks math decls.
libstdc++-v3/ChangeLog
* crossconfig.m4 (<*-vxworks>): Check for more math decls.
* configure: Rebuild.
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).
This comment was added in SVN r173410, v850e1-* was added to config.sub
in SVN r174691 (around 2011). So it should no longer apply.
contrib/ChangeLog:
* config-list.mk (LIST): Add v850e1-elf.
Support for crisv32-*-* and cris-*-linux* was removed in git r11-214.
contrib/ChangeLog:
* config-list.mk (LIST): Remove cris-linux, crisv32-elf, and
crisv32-linux.
The build_new_method_call allows us to inspect the
function decl used. In most cases, this is not used
and we can just set the parm to NULL.
gcc/cp/ChangeLog:
* coroutines.cc (build_co_await): Remove unused
variable.
(finish_co_await_expr): Likewise.
(finish_co_yield_expr): Likewise; revise comment.
This patch fixes a 8/9/10/11 regression, where finalized types
were not finalized (and deallocated), which led to memory
leaks.
gcc/fortran/ChangeLog:
2020-05-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/94361
* class.c (finalize_component): Use expr->finalized instead of
comp->finalized.
* gfortran.h (gfc_component): Remove finalized member.
(gfc_expr): Add it here instead.
gcc/testsuite/ChangeLog:
2020-05-24 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/94361
* gfortran.dg/finalize_28.f90: Adjusted free counts.
* gfortran.dg/finalize_33.f90: Likewise.
* gfortran.dg/finalize_34.f90: Likewise.
* gfortran.dg/finalize_35.f90: New test.
> 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.
* gcc.dg/pr95052.c: New test.