Iain Buclaw [Tue, 4 May 2021 22:28:44 +0000 (00:28 +0200)]
libphobos: Fix visibility of std.process.searchPathFor
This symbol is used by std.file.thisExePath on OpenBSD.
Reviewed-on: https://github.com/dlang/phobos/pull/8041
libphobos/ChangeLog:
* src/MERGE: Merge upstream phobos
32cfe9b61.
Martin Liska [Mon, 10 May 2021 10:11:48 +0000 (12:11 +0200)]
gcc_update: fix check for local source tree.
contrib/ChangeLog:
* gcc_update: Start using reload.c instead of version.c.
Richard Biener [Fri, 7 May 2021 07:51:18 +0000 (09:51 +0200)]
middle-end/100464 - avoid spurious TREE_ADDRESSABLE in folding debug stmts
canonicalize_constructor_val was setting TREE_ADDRESSABLE on bases
of ADDR_EXPRs but that's futile when we're dealing with CTOR values
in debug stmts. This rips out the code which was added for Java
and should have been an assertion when we didn't have debug stmts.
To not regress g++.dg/tree-ssa/array-temp1.C we have to adjust the
testcase to not look for a no longer applied invalid optimization.
2021-05-10 Richard Biener <rguenther@suse.de>
PR middle-end/100464
PR c++/100468
gcc/
* gimple-fold.c (canonicalize_constructor_val): Do not set
TREE_ADDRESSABLE.
gcc/cp/
* call.c (set_up_extended_ref_temp): Mark the temporary
addressable if the TARGET_EXPR was.
gcc/testsuite/
* gcc.dg/pr100464.c: New testcase.
* g++.dg/tree-ssa/array-temp1.C: Adjust.
Richard Biener [Wed, 5 May 2021 14:15:12 +0000 (16:15 +0200)]
tree-optimization/100434 - DSE aggregate call LHS
This makes DSE consider aggregate LHS of calls as dead, for pure
or const calls the whole stmt and for others by removing the LHS.
2021-05-05 Richard Biener <rguenther@suse.de>
PR tree-optimization/100434
* tree-ssa-dse.c (initialize_ao_ref_for_dse): Handle
call LHS.
(dse_optimize_stmt): Handle call LHS by dropping the
LHS or the whole call if it doesn't have other
side-effects.
(pass_dse::execute): Adjust.
* gcc.dg/tree-ssa/ssa-dse-43.c: New testcase.
Martin Liska [Mon, 10 May 2021 09:35:49 +0000 (11:35 +0200)]
Fix genversion linker error.
When renaming gcov-iov to genversion I forgot one hunk that led
to the following linker error:
ld: error: build/genversion.o: requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
gcc/ChangeLog:
* Makefile.in: Add missing genversion rule.
Alex Coplan [Mon, 10 May 2021 08:46:45 +0000 (09:46 +0100)]
arm: Fix wrong code with MVE V2DImode loads and stores [PR99960]
As the PR shows, we currently miscompile V2DImode loads and stores for
MVE. We're currently using 64-bit loads/stores, but need to be using
128-bit vector loads and stores. Fixed thusly.
Some intrinsics tests were checking that we (incorrectly) used the
64-bit loads/stores: these have been updated.
gcc/ChangeLog:
PR target/99960
* config/arm/mve.md (*mve_mov<mode>): Simplify output code. Use
vldrw.u32 and vstrw.32 for V2D[IF]mode loads and stores.
gcc/testsuite/ChangeLog:
PR target/99960
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_s64.c:
Update now that we're (correctly) using full 128-bit vector
loads/stores.
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_u64.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_s64.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vldrdq_gather_base_wb_z_u64.c:
Likewise.
* gcc.target/arm/mve/intrinsics/vuninitializedq_int.c: Likewise.
* gcc.target/arm/mve/intrinsics/vuninitializedq_int1.c:
Likewise.
Martin Liska [Fri, 19 Mar 2021 14:23:01 +0000 (15:23 +0100)]
LTO plugin: use startswith function.
lto-plugin/ChangeLog:
* lto-plugin.c (LTO_SEGMENT_NAME): Remove.
(LTO_SYMTAB_PREFIX): Likewise.
(LTO_SYMTAB_PREFIX_LEN): Likewise.
(LTO_SYMTAB_EXT_PREFIX): Likewise.
(LTO_SYMTAB_EXT_PREFIX_LEN): Likewise.
(LTO_LTO_PREFIX): Likewise.
(LTO_LTO_PREFIX_LEN): Likewise.
(OFFLOAD_SECTION): Likewise.
(OFFLOAD_SECTION_LEN): Likewise.
(startswith): New function.
(all_symbols_read_handler): Use it.
(process_symtab): Likewise.
(process_symtab_extension): Likewise.
(process_offload_section): Likewise.
(process_option): Likewise.
Martin Liska [Wed, 17 Mar 2021 15:36:44 +0000 (16:36 +0100)]
Come up with startswith function.
gcc/ada/ChangeLog:
* gcc-interface/utils.c (def_builtin_1): Use startswith
function instead of strncmp.
gcc/analyzer/ChangeLog:
* sm-file.cc (is_file_using_fn_p): Use startswith
function instead of strncmp.
gcc/ChangeLog:
* builtins.c (is_builtin_name): Use startswith
function instead of strncmp.
* collect2.c (main): Likewise.
(has_lto_section): Likewise.
(scan_libraries): Likewise.
* coverage.c (coverage_checksum_string): Likewise.
(coverage_init): Likewise.
* dwarf2out.c (is_cxx): Likewise.
(gen_compile_unit_die): Likewise.
* gcc-ar.c (main): Likewise.
* gcc.c (init_spec): Likewise.
(read_specs): Likewise.
(execute): Likewise.
(check_live_switch): Likewise.
* genattrtab.c (write_attr_case): Likewise.
(IS_ATTR_GROUP): Likewise.
* gencfn-macros.c (main): Likewise.
* gengtype.c (type_for_name): Likewise.
(gen_rtx_next): Likewise.
(get_file_langdir): Likewise.
(write_local): Likewise.
* genmatch.c (get_operator): Likewise.
(get_operand_type): Likewise.
(expr::gen_transform): Likewise.
* genoutput.c (validate_optab_operands): Likewise.
* incpath.c (add_sysroot_to_chain): Likewise.
* langhooks.c (lang_GNU_C): Likewise.
(lang_GNU_CXX): Likewise.
(lang_GNU_Fortran): Likewise.
(lang_GNU_OBJC): Likewise.
* lto-wrapper.c (run_gcc): Likewise.
* omp-general.c (omp_max_simt_vf): Likewise.
* omp-low.c (omp_runtime_api_call): Likewise.
* opts-common.c (parse_options_from_collect_gcc_options): Likewise.
* read-rtl-function.c (function_reader::read_rtx_operand_r): Likewise.
* real.c (real_from_string): Likewise.
* selftest.c (assert_str_startswith): Likewise.
* timevar.c (timer::validate_phases): Likewise.
* tree.c (get_file_function_name): Likewise.
* ubsan.c (ubsan_use_new_style_p): Likewise.
* varasm.c (default_function_rodata_section): Likewise.
(incorporeal_function_p): Likewise.
(default_section_type_flags): Likewise.
* system.h (startswith): Define startswith.
gcc/c-family/ChangeLog:
* c-ada-spec.c (print_destructor): Use startswith
function instead of strncmp.
(dump_ada_declaration): Likewise.
* c-common.c (disable_builtin_function): Likewise.
(def_builtin_1): Likewise.
* c-format.c (check_tokens): Likewise.
(check_plain): Likewise.
(convert_format_name_to_system_name): Likewise.
gcc/c/ChangeLog:
* c-aux-info.c (affix_data_type): Use startswith
function instead of strncmp.
* c-typeck.c (build_function_call_vec): Likewise.
* gimple-parser.c (c_parser_gimple_parse_bb_spec): Likewise.
gcc/cp/ChangeLog:
* decl.c (duplicate_decls): Use startswith
function instead of strncmp.
(cxx_builtin_function): Likewise.
(omp_declare_variant_finalize_one): Likewise.
(grokfndecl): Likewise.
* error.c (dump_decl_name): Likewise.
* mangle.c (find_decomp_unqualified_name): Likewise.
(write_guarded_var_name): Likewise.
(decl_tls_wrapper_p): Likewise.
* parser.c (cp_parser_simple_type_specifier): Likewise.
(cp_parser_tx_qualifier_opt): Likewise.
* pt.c (template_parm_object_p): Likewise.
(dguide_name_p): Likewise.
gcc/d/ChangeLog:
* d-builtins.cc (do_build_builtin_fn): Use startswith
function instead of strncmp.
* dmd/dinterpret.c (evaluateIfBuiltin): Likewise.
* dmd/dmangle.c: Likewise.
* dmd/hdrgen.c: Likewise.
* dmd/identifier.c (Identifier::toHChars2): Likewise.
gcc/fortran/ChangeLog:
* decl.c (variable_decl): Use startswith
function instead of strncmp.
(gfc_match_end): Likewise.
* gfortran.h (gfc_str_startswith): Likewise.
* module.c (load_omp_udrs): Likewise.
(read_module): Likewise.
* options.c (gfc_handle_runtime_check_option): Likewise.
* primary.c (match_arg_list_function): Likewise.
* trans-decl.c (gfc_get_symbol_decl): Likewise.
* trans-expr.c (gfc_conv_procedure_call): Likewise.
* trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Likewise.
gcc/go/ChangeLog:
* gofrontend/runtime.cc (Runtime::name_to_code): Use startswith
function instead of strncmp.
gcc/objc/ChangeLog:
* objc-act.c (objc_string_ref_type_p): Use startswith
function instead of strncmp.
* objc-encoding.c (encode_type): Likewise.
* objc-next-runtime-abi-02.c (has_load_impl): Likewise.
Martin Liska [Fri, 12 Mar 2021 08:31:37 +0000 (09:31 +0100)]
gcc-changelog: Remove components that will be removed.
contrib/ChangeLog:
* gcc-changelog/git_commit.py: Remove components that will be
removed.
Martin Liska [Tue, 16 Mar 2021 12:22:55 +0000 (13:22 +0100)]
c++: remove redundand NULL check.
gcc/cp/ChangeLog:
PR c++/99616
* decl.c (grokdeclarator): Remove redundant NULL check.
Martin Liska [Thu, 22 Apr 2021 07:39:39 +0000 (09:39 +0200)]
Remove __cplusplus >= 201103
Right now, we require a C++11 compiler, so the check is not needed any
longer.
gcc/analyzer/ChangeLog:
* program-state.cc (program_state::operator=): Remove
__cplusplus >= 201103.
(program_state::program_state): Likewise.
* program-state.h: Likewise.
* region-model.h (class region_model): Remove dead code.
gcc/ChangeLog:
* bitmap.h (class auto_bitmap): Remove
__cplusplus >= 201103.
* config/aarch64/aarch64.c: Likewise.
* gimple-ssa-store-merging.c (store_immediate_info::store_immediate_info):
Likewise.
* sbitmap.h: Likewise.
Martin Liska [Tue, 20 Apr 2021 14:56:07 +0000 (16:56 +0200)]
Use genversion to generate version.h.
c++tools/ChangeLog:
* Makefile.in: Include also ../gcc folder.
gcc/ChangeLog:
* Makefile.in: Rename gcov-iov to genversion and depend
on version.h (instead of gcov-iov.h).
* gcov-io.h: Include version.h instread of gcov-iov.h.
* gengtype-state.c (read_state_version): Likewise.
* gcov-iov.c: Moved to...
* genversion.c: ...here.
* lto-streamer.h (LTO_major_version): Define it with
GCC_major_version.
* version.c: Removed.
* version.h: Removed.
libgcc/ChangeLog:
* libgcov-driver.c (gcov_version): Use different name that does
not clash with newly introduced macro.
Claudiu Zissulescu [Mon, 10 May 2021 06:49:35 +0000 (09:49 +0300)]
arc: Improve vector support for ARCv2.
Add vector negate, reduc_plus_scal, vec_duplicate, vector
min/max/mult/div patterns. Besides vector negate and reduction
patterns, all the others are emulated using scalar instructions. The
reason is taking advantage of the double load/store instructions as
well as enabling the autovectorizer to further analize a loop.
gcc/
2021-05-10 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.md (UNSPEC_ARC_DMPYWH): Define.
* config/arc/simdext.md (VCT): Add predicates for iterator
elements.
(EMUVEC): Define.
(voptab): Likewise.
(vec_widen_<V_US>mult_hi_v4hi): Change pattern predicate.
(<voptab>v2si3): New patterns.
(neg): Likewise.
(reduc_plus_scal_v4hi): Likewise.
(reduc_plus_scal_v2si): Likewise.
(vec_duplicatev2si): Likewise.
(vec_duplicatev4hi): Likewise.
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Claudiu Zissulescu [Mon, 10 May 2021 06:49:35 +0000 (09:49 +0300)]
arc: Cleanup simdext.md file
Textual cleanup of the simdext.md file. Format the output assembly
instructions.
gcc/
2021-05-10 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/simdext.md: Format and cleanup file.
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Claudiu Zissulescu [Mon, 10 May 2021 06:49:35 +0000 (09:49 +0300)]
arc: Disable movmisalign patterns when aligned access is required
Disable movmisalign patterns when aligned access is required.
gcc/
2021-05-10 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/simdext.md (movmisalignv2hi): Allow misaligned access
only when munaligned-access option is on.
(movmisalign<mode>): Likewise.
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Claudiu Zissulescu [Mon, 10 May 2021 06:03:41 +0000 (09:03 +0300)]
arc: Fix compilation warnings.
gcc/
2021-05-10 Claudiu Zissulescu <claziss@synopsys.com>
* common/config/arc/arc-common.c (arc_handle_option): Remove dot
from string.
* config/arc/arc.c (arc_reorg): Remove underscore from string.
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Claudiu Zissulescu [Mon, 10 May 2021 06:03:41 +0000 (09:03 +0300)]
arc: Update ctz/clz patterns
ARCv2 ISA introduces special clz/ctz instructions. This patch is
adding support for them when available.
Corner case:
mov r0,0x0 : (w0) r0 <= 0x00000000 *
ffs r1,r0 : (w0) r1 <= 0x0000001f *
fls r2,r0 : (w0) r2 <= 0x00000000 *
gcc/
2021-05-10 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (CLZ_DEFINED_VALUE_AT_ZERO): Define.
(CTZ_DEFINED_VALUE_AT_ZERO): Likewise.
* config/arc/arc.md (clrsbsi2): Cleanup pattern.
(norm_f): Likewise.
(ffs): Likewise.
(ffs_f): Likewise.
(clzsi2): Use fls instruction when available.
(arc_clzsi2): Likewise.
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Claudiu Zissulescu [Mon, 10 May 2021 06:03:41 +0000 (09:03 +0300)]
arc: Add alternative names for gp and fp registers.
Add alternative register name r26 for gp register, and add
alternative register name r27 for fp register.
gcc/
2021-05-10 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (ADDITIONAL_REGISTER_NAMES): Add r26 and r27.
Claudiu Zissulescu [Mon, 10 May 2021 06:03:41 +0000 (09:03 +0300)]
arc: Fix documentation __builtin_arc_sr
The arguments of __builtin_arc_sr are swapped in documentation. Fix it.
gcc/
2021-05-10 Claudiu Zissulescu <claziss@synopsys.com>
* doc/extend.texi (__builtin_arc_sr): Swap arguments.
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Bernd Edlinger [Sat, 8 May 2021 05:46:17 +0000 (07:46 +0200)]
Reset prologue_location before calling code_end
Some targets emit thunks from the targetm.asm_out.code_end
function and set the DECL_IGNORED_P, but due to
e69ac020372 ("Add line debug info for virtual thunks")
the value in prologue_location is no longer ignored.
So reset that value before calling the backend.
2021-05-10 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR middle-end/100467
* toplev.c (compile_file): Call insn_locations_init before
targetm.asm_out.code_end.
GCC Administrator [Mon, 10 May 2021 00:16:28 +0000 (00:16 +0000)]
Daily bump.
GCC Administrator [Sun, 9 May 2021 00:16:29 +0000 (00:16 +0000)]
Daily bump.
Paul Thomas [Sat, 8 May 2021 11:12:48 +0000 (12:12 +0100)]
Correct ChangeLob entries for PR46991
Paul Thomas [Fri, 7 May 2021 18:52:40 +0000 (19:52 +0100)]
Fortran: Correct PR number from 46691 [PR46991].
2021-05-07 Paul Thomas <pault@gcc.gnu.org>
gcc/testsuite/ChangeLog
PR fortran/46991
* gfortran.dg/class_dummy_7.f90: Correct PR number.
Eric Botcazou [Sat, 8 May 2021 07:49:38 +0000 (09:49 +0200)]
Remove obsolete gcc.dg/sso-9.c
gcc/testsuite/
* gcc.dg/sso-9.c: Delete.
GCC Administrator [Sat, 8 May 2021 00:16:27 +0000 (00:16 +0000)]
Daily bump.
Andrew Stubbs [Fri, 7 May 2021 22:55:35 +0000 (23:55 +0100)]
Revert "amdgcn: disable TImode"
This reverts commit
7af392687952608b988bd5a476583106b3f51740.
Andrew Stubbs [Fri, 7 May 2021 14:31:05 +0000 (15:31 +0100)]
Ensure emit_move_insn operands are valid
Some architectures are fine with PLUS in move instructions, but others
are not (amdgcn is the motivating example).
2021-05-07 Jakub Jelinek <jakub@redhat.com>
Andrew Stubbs <amd@codesourcery.com>
gcc/ChangeLog:
PR target/100418
* builtins.c (try_store_by_multiple_pieces): Use force_operand for
emit_move_insn operands.
Jonathan Wakely [Thu, 6 May 2021 18:14:42 +0000 (19:14 +0100)]
libstdc++: Fix constraints for rvalue stream insertion/extraction
The __rval_streamable() function was an attempt to test for
convertibility cheaply and without confusing diagnostics. It doesn't
work with Clang though, and is probably ill-formed.
Replace that helper function with a check for derivation from ios_base,
and use that in the alias templates __rvalue_stream_insertion_t and
__rvalue_stream_extraction_t. Use concepts for the constraints when
available.
libstdc++-v3/ChangeLog:
* include/std/istream (__rvalue_stream_extraction_t): Replace
use of __rval_streamable.
* include/std/ostream (__rvalue_stream_insertion_t): Likewise.
(__rval_streamable): Remove.
(_Require_derived_from_ios_base, __derived_from_ios_base): New
helper for checking constraints.
* testsuite/27_io/basic_istream/extractors_other/char/4.cc: Fix
reference to the wrong subclause of the standard.
* testsuite/27_io/basic_istream/extractors_other/wchar_t/4.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/6.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/99692.cc:
New test.
* testsuite/27_io/filesystem/path/io/dr2989.cc: Adjust pruned
errors.
Eric Botcazou [Fri, 7 May 2021 20:52:18 +0000 (22:52 +0200)]
Fix incorrect array bounds with -fgnat-encodings=minimal in DWARF
This makes add_subscript_info query the get_array_descr_info hook for the
actual information when it is defined.
gcc/
* cfgexpand.c (expand_gimple_basic_block): Do not inherit a current
location for the outgoing edges of an empty block.
* dwarf2out.c (add_subscript_info): Retrieve the bounds and index
type by means of the get_array_descr_info langhook, if it is set and
returns true. Remove obsolete code dealing with unnamed subtypes.
gcc/testsuite/
* gnat.dg/debug18.adb: New test.
Andrew MacLeod [Fri, 7 May 2021 16:03:01 +0000 (12:03 -0400)]
Clean up and virtualize the on-entry cache interface.
Cleanup/Virtualize the ssa_block_range class, and implement the current
vector approach as a derived class.
Allow memory allocation from the irange allocator obstack for easy freeing.
* gimple-range-cache.cc (ssa_block_ranges): Virtualize.
(sbr_vector): Renamed from ssa_block_cache.
(sbr_vector::sbr_vector): Allocate from obstack abd initialize.
(ssa_block_ranges::~ssa_block_ranges): Remove.
(sbr_vector::set_bb_range): Use varying and undefined cached values.
(ssa_block_ranges::set_bb_varying): Remove.
(sbr_vector::get_bb_range): Adjust assert.
(sbr_vector::bb_range_p): Adjust assert.
(~block_range_cache): No freeing loop required.
(block_range_cache::get_block_ranges): Remove.
(block_range_cache::set_bb_range): Inline get_block_ranges.
(block_range_cache::set_bb_varying): Remove.
* gimple-range-cache.h (set_bb_varying): Remove prototype.
* value-range.h (irange_allocator::get_memory): New.
Andrew MacLeod [Tue, 27 Apr 2021 12:44:46 +0000 (08:44 -0400)]
When searching for non-null, check the dominator tree.
The non-null bitmap only indicates which blocks non-null setting occurs.
Generalized queries need to search the dom tree, whereas propagation
engines only need to know the current block. Add a flag for this purpose.
* gimple-range-cache.cc (non_null_ref::non_null_deref_p): Search
dominator tree is available and requested.
(ranger_cache::ssa_range_in_bb): Don't search dom tree here.
(ranger_cache::fill_block_cache): Don't search dom tree here either.
* gimple-range-cache.h (non_null_deref_p): Add dom_search param.
Andrew MacLeod [Mon, 26 Apr 2021 23:23:25 +0000 (19:23 -0400)]
Fix range_on_exit for PHI stmts when there are no other stmts in the block.
last_stmt(bb) returns NULL for blocks which only have PHI stmts, and
range_on_exit would trigger a cache fill all the way to the top of the
program for the SSA_NAME.
* gimple-range.cc (gimple_ranger::range_on_exit): Handle block with
only PHI nodes better.
Andrew MacLeod [Mon, 26 Apr 2021 22:14:15 +0000 (18:14 -0400)]
Make TRUE/FALSE edge calculation available without the outgoing edge class.
Rename class to gimple_outoging_edge and provide a non-class routine for
the outgoing edge of a gcond.
* gimple-range-edge.h (gimple_outgoing_range): Rename from
outgoing_range.
(gcond_edge_range): Export prototype.
* gimple-range-edge.cc (gcond_edge_range): New.
(gimple_outgoing_range::edge_range_p): Use gcond_edge_range.
* gimple-range-gori.h (gori_compute): Use gimple_outgoing_range.
Andrew MacLeod [Mon, 26 Apr 2021 21:50:18 +0000 (17:50 -0400)]
Don't over-allocate switch default range object.
We were always allocating the 255 max ranges for the default condition.
Instead, use int_range_max to build the default range, then allocate and
store only what is needed.
* gimple-range-edge.cc (outgoing_range::calc_switch_ranges): Compute
default range into a temp and allocate only what is needed.
Andrew MacLeod [Mon, 26 Apr 2021 21:46:31 +0000 (17:46 -0400)]
Change x mod 0 to produce UNDEFINED rather than VARYING.
* range-op.cc (operator_trunc_mod::wi_fold): x % 0 is UNDEFINED.
Andrew MacLeod [Mon, 26 Apr 2021 21:41:22 +0000 (17:41 -0400)]
Enhance initial global value setting.
Incorporate code from vr_values to get safe initial parameter values.
If this is a local automatic which is used before defined, use UNDEFINED.
* gimple-range.h (gimple_range_global): Pick up parameter initial
values, and use-before defined locals are UNDEFINED.
Eric Botcazou [Fri, 7 May 2021 18:44:36 +0000 (20:44 +0200)]
Do not apply scalar storage order to pointer fields
Pointer fields (and vector fields originally) were not really considered
when the scalar_storage_order attribute, so they are swapped as well.
As pointed out, this is problematic to describe in DWARF and probably
not very useful in any case, so this pulls them out.
gcc/
* doc/extend.texi (scalar_storage_order): Mention effect on pointer
and vector fields.
* tree.h (reverse_storage_order_for_component_p): Return false if
the type is a pointer.
gcc/c/
* c-typeck.c (build_unary_op) <ADDR_EXPR>: Do not issue an error
on the address of a pointer field in a record with reverse SSO.
gcc/testsuite/
* gcc.dg/sso-12.c: New test.
Andrew Stubbs [Fri, 7 May 2021 14:42:21 +0000 (15:42 +0100)]
amdgcn: disable TImode
The TImode support works for moves only, which has worked in most case up
to now, but no longer.
We still need TImode to exist for the instructions that take two DImode
values packed together, but we don't need to advertise this to the middle-end.
gcc/ChangeLog:
* config/gcn/gcn.c (gcn_scalar_mode_supported_p): Disable TImode.
Jason Merrill [Wed, 5 May 2021 01:33:33 +0000 (21:33 -0400)]
c++: reject class lvalues in 'rvalue'
Wrapping a class lvalue in NON_LVALUE_EXPR is not sufficient to make it a
usable prvalue; callers must use force_rvalue instead.
gcc/cp/ChangeLog:
* tree.c (rvalue): Assert expr is not a class lvalue.
Jason Merrill [Thu, 6 May 2021 02:25:45 +0000 (22:25 -0400)]
c++: avoid non-TARGET_EXPR class prvalues
Around PR98469 I asked Jakub to wrap a class BIT_CAST_EXPR in TARGET_EXPR;
SPACESHIP_EXPR needs the same thing. The dummy CAST_EXPR created in
can_convert is another instance of a non-TARGET_EXPR prvalue, so let's use
the declval-like build_stub_object there instead.
gcc/cp/ChangeLog:
* cp-tree.h (build_stub_object): Declare.
* method.c (build_stub_object): No longer static.
* call.c (can_convert): Use it.
* tree.c (build_dummy_object): Adjust comment.
* typeck.c (cp_build_binary_op): Wrap SPACESHIP_EXPR in a
TARGET_EXPR.
Jason Merrill [Wed, 5 May 2021 01:33:36 +0000 (21:33 -0400)]
c++: don't call 'rvalue' in coroutines code
A change to check glvalue_p rather than specifically for TARGET_EXPR
revealed issues with the coroutines code's use of the 'rvalue' function,
which shouldn't be used on class glvalues, so I've removed those calls.
In build_co_await I just dropped them, because I don't see anything in the
co_await specification that indicates that we would want to move from an
lvalue result of operator co_await. And simplified that code while I was
touching it; cp_build_modify_expr (...INIT_EXPR...) will call the
constructor.
In morph_fn_to_coro I changed the handling of the rvalue reference coroutine
frame field to use move, to treat the rval ref as an xvalue. I used
forward_parm to pass the function parms to the constructor for the field.
And I simplified the return handling so we get the desired rvalue semantics
from the normal implicit move on return.
I question default-initializing the non-void return value of the function if
get_return_object returns void; I'm not messing with it here, but I've filed
PR100476 about it.
gcc/cp/ChangeLog:
* coroutines.cc (build_co_await): Don't call 'rvalue'.
(flatten_await_stmt): Simplify initialization.
(morph_fn_to_coro): Change 'rvalue' to 'move'. Simplify.
gcc/testsuite/ChangeLog:
* g++.dg/coroutines/coro-bad-gro-00-class-gro-scalar-return.C:
Adjust diagnostic.
Christophe Lyon [Fri, 7 May 2021 15:52:35 +0000 (15:52 +0000)]
tree-optimization/79333 - fold stmts following SSA edges in VN
copysign is only available with c99_runtime, skip ssa-fre-94.c
otherwise.
2021-05-07 Christophe Lyon <christophe.lyon@linaro.org>
PR tree-optimization/79333
gcc/testsuite/
* gcc.dg/tree-ssa/ssa-fre-94.c: Require c99_runtime.
Jakub Jelinek [Fri, 7 May 2021 15:48:37 +0000 (17:48 +0200)]
libcpp: Fix up pragma preprocessing [PR100450]
Since the r0-85991-ga25a8f3be322fe0f838947b679f73d6efc2a412c
https://gcc.gnu.org/legacy-ml/gcc-patches/2008-02/msg01329.html
changes, so that we handle macros inside of pragmas that should expand
macros, during preprocessing we print those pragmas token by token,
with CPP_PRAGMA printed as
fputs ("#pragma ", print.outf);
if (space)
fprintf (print.outf, "%s %s", space, name);
else
fprintf (print.outf, "%s", name);
where name is some identifier (so e.g. print
#pragma omp parallel
or
#pragma omp for
etc.). Because it ends in an identifier, we need to handle it like
an identifier (i.e. CPP_NAME) for the decision whether a space needs
to be emitted in between that #pragma whatever or #pragma whatever whatever
and following token, otherwise the attached testcase is preprocessed as
#pragma omp forreduction(+:red)
rather than
#pragma omp for reduction(+:red)
The cpp_avoid_paste function is only called for this purpose.
2021-05-07 Jakub Jelinek <jakub@redhat.com>
PR c/100450
* lex.c (cpp_avoid_paste): Handle token1 CPP_PRAGMA like CPP_NAME.
* c-c++-common/gomp/pr100450.c: New test.
Uros Bizjak [Fri, 7 May 2021 15:14:34 +0000 (17:14 +0200)]
i386: Implement mmx_pblendv to optimize SSE conditional moves [PR98218]
Implement mmx_pblendv to optimize V8HI, V4HI and V2SI mode
conditional moves for SSE4.1 targets.
2021-05-07 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/98218
* config/i386/i386-expand.c (ix86_expand_sse_movcc):
Handle V8QI, V4HI and V2SI modes.
* config/i386/mmx.md (mmx_pblendvb): New insn pattern.
* config/i386/sse.md (unspec): Move UNSPEC_BLENDV ...
* config/i386/i386.md (unspec): ... here.
Tobias Burnus [Fri, 7 May 2021 10:11:51 +0000 (12:11 +0200)]
OpenMP: Fix SIMT for complex/float reduction with && and ||
2021-05-07 Tobias Burnus <tobias@codesourcery.com>
Tom de Vries <tdevries@suse.de>
gcc/ChangeLog:
* omp-low.c (lower_rec_simd_input_clauses): Set max_vf = 1 if
a truth_value_p reduction variable is nonintegral.
libgomp/ChangeLog:
* testsuite/libgomp.c-c++-common/reduction-5.c: New test, testing
complex/floating-point || + && reduction with 'omp target'.
* testsuite/libgomp.c-c++-common/reduction-6.c: Likewise.
Piotr Trojanek [Tue, 23 Feb 2021 22:37:50 +0000 (23:37 +0100)]
[Ada] Robust detection of access-to-subprogram and access-to-object types
gcc/ada/
* einfo-utils.adb (Is_Access_Object_Type): Use
Directly_Designated_Type.
(Is_Access_Subprogram_Type): Use Directly_Designated_Type.
(Set_Convention): Use plain Ekind.
* gen_il-gen-gen_entities.adb (Type_Kind): Use plain Ekind.
* sem_ch3.adb (Access_Type_Declaration): When seeing an illegal
completion with an access type don't attempt to decorate the
completion entity; previously the entity had its Ekind set to
E_General_Access_Type or E_Access_Type, but its Designated_Type
was empty, which caused a crash in freezing. (Actually, the
error recovery in the surrounding context is still incomplete,
e.g. we will crash when the illegal completion is an access to
an unknown identifier).
Bob Duff [Wed, 24 Feb 2021 19:08:50 +0000 (14:08 -0500)]
[Ada] Minor reformattings
gcc/ada/
* par_sco.adb: Align with/use clauses.
(Traverse_Declarations_Or_Statements): Minor comment fix.
* aspects.adb, atree.adb, atree.ads, checks.adb, comperr.adb,
contracts.adb, cstand.adb, debug_a.adb, einfo-utils.adb,
errout.adb, eval_fat.adb, exp_aggr.adb, expander.adb,
exp_atag.adb, exp_attr.adb, exp_cg.adb, exp_ch11.adb,
exp_ch12.adb, exp_ch13.adb, exp_ch2.adb, exp_ch3.adb,
exp_ch4.adb, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch8.adb,
exp_ch9.adb, exp_code.adb, exp_dbug.adb, exp_disp.adb,
exp_dist.adb, exp_fixd.adb, exp_imgv.adb, exp_intr.adb,
exp_pakd.adb, exp_prag.adb, exp_put_image.adb, exp_sel.adb,
exp_smem.adb, exp_spark.adb, exp_strm.adb, exp_tss.adb,
exp_unst.adb, exp_util.adb, exp_util.ads, freeze.adb,
frontend.adb, ghost.adb, gnat1drv.adb, gnat_cuda.adb,
impunit.adb, inline.adb, itypes.adb, itypes.ads, layout.adb,
lib.adb, lib-load.adb, lib-writ.adb, lib-xref.adb,
lib-xref-spark_specific.adb, live.adb, nlists.adb, par.adb,
par-ch11.adb, par-ch3.adb, par-ch5.adb, par-ch6.adb, pprint.adb,
repinfo.adb, restrict.adb, rtsfind.adb, scil_ll.adb, scn.adb,
sem.adb, sem_aggr.adb, sem_attr.adb, sem_aux.adb, sem_case.adb,
sem_cat.adb, sem_ch10.adb, sem_ch11.adb, sem_ch12.adb,
sem_ch13.adb, sem_ch2.adb, sem_ch3.adb, sem_ch4.adb,
sem_ch5.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_ch9.adb,
sem_dim.adb, sem_disp.adb, sem_dist.adb, sem_elab.adb,
sem_elim.adb, sem_eval.adb, sem_intr.adb, sem_mech.adb,
sem_prag.adb, sem_res.adb, sem_scil.adb, sem_smem.adb,
sem_type.adb, sem_util.adb, sem_util.ads, sem_warn.adb,
sinfo-cn.adb, sinfo-utils.ads, sinput.adb, sinput-l.adb,
sprint.adb, style.adb, styleg.adb, tbuild.adb, tbuild.ads,
treepr.adb, uname.adb: Align with/use clauses.
Bob Duff [Wed, 24 Feb 2021 13:13:36 +0000 (08:13 -0500)]
[Ada] Variable-sized node types -- cleanup
gcc/ada/
* atree.ads, atree.adb, gen_il-gen.ads: Fix comments and clean
up ??? marks. Rename Set_Ekind to be Mutate_Ekind.
* einfo.ads, sinfo.ads: Likewise. Change "definitive
definition" to "official definition", because the former sounds
redundant. Rename Set_Ekind to be Mutate_Ekind.
* checks.adb, contracts.adb, cstand.adb, exp_aggr.adb,
exp_attr.adb, exp_ch11.adb, exp_ch3.adb, exp_ch5.adb,
exp_ch6.adb, exp_ch7.adb, exp_ch9.adb, exp_disp.adb,
exp_dist.adb, exp_imgv.adb, exp_intr.adb, exp_prag.adb,
exp_unst.adb, exp_util.adb, gen_il-gen.adb, inline.adb,
lib-writ.adb, lib-xref-spark_specific.adb, sem_aggr.adb,
sem_ch10.adb, sem_ch11.adb, sem_ch12.adb, sem_ch13.adb,
sem_ch3.adb, sem_ch5.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb,
sem_ch9.adb, sem_dist.adb, sem_elab.adb, sem_prag.adb,
sem_util.adb: Rename Set_Ekind to be Mutate_Ekind.
Bob Duff [Tue, 23 Feb 2021 15:31:45 +0000 (10:31 -0500)]
[Ada] Restore nnd capability
gcc/ada/
* atree.adb: Move nnd-related code from here, and leave a
comment pointing to sinfo-utils.adb.
* sinfo-utils.ads, sinfo-utils.adb: Move nnd-related code to
here.
Piotr Trojanek [Mon, 8 Feb 2021 22:39:24 +0000 (23:39 +0100)]
[Ada] Fix link from body protected entry implementation to source code
gcc/ada/
* einfo.ads: Move Corresponding_Protected_Entry...
* sinfo.ads: ... here.
* exp_ch9.adb (Build_Entry_Body): Link procedure and entry
bodies.
* gen_il-fields.ads (Opt_Field_Enum): Add
Corresponding_Entry_Body field to nodes; remove
Corresponding_Protected_Entry field from entities.
* gen_il-gen-gen_entities.adb (Gen_Entities): Remove
Corresponding_Protected_Entry field from E_Void and
E_Subprogram_Body.
* gen_il-gen-gen_nodes.adb (Gen_Nodes): Add
Corresponding_Entry_Body field to N_Subprogram_Body.
* sem_ch6.adb (Analyze_Subprogram_Specification): Remove
manipulation of Ekind and Corresponding_Protected_Entry added as
part of the support for varsize-nodes.
Bob Duff [Wed, 10 Feb 2021 23:04:42 +0000 (18:04 -0500)]
[Ada] Reinitialize Private_Dependents when it is vanishing
gcc/ada/
* sem_ch3.adb (Process_Incomplete_Dependents): Reset
Private_Dependents field to zero before calling Set_Ekind. Also
move Set_Etype to after Set_Ekind, because it's always best to
set the Ekind as early as possible.
* atree.adb: Improve debugging facilities for vanishing fields.
Eric Botcazou [Fri, 5 Feb 2021 12:27:03 +0000 (13:27 +0100)]
[Ada] Replace packed records with integers in low-level implementation
gcc/ada/
* atree.ads (Slot): Change to modular type.
(Slot_1_Bit): Delete.
(Slot_2_Bit): Likewise.
(Slot_4_Bit): Likewise.
(Slot_8_Bit): Likewise.
(Slot_32_Bit): Likewise.
* atree.adb (Get_1_Bit_Val): Adjust to above change.
(Get_2_Bit_Val): Likewise.
(Get_4_Bit_Val): Likewise.
(Get_8_Bit_Val): Likewise.
(Get_32_Bit_Val): Likewise.
(Set_1_Bit_Val): Likewise.
(Set_2_Bit_Val): Likewise.
(Set_4_Bit_Val): Likewise.
(Set_8_Bit_Val): Likewise.
(Set_32_Bit_Val): Likewise.
(Print_Atree_Info): Likewise.
(Zero): Likewise.
* atree.h (Get_1_Bit_Field): Likewise.
(Get_2_Bit_Field): Likewise.
(Get_4_Bit_Field): Likewise.
(Get_8_Bit_Field): Likewise.
(Get_32_Bit_Field): Likewise.
(Get_32_Bit_Field_With_Default): Likewise.
* types.h (slot_1_bit): Delete.
(slot_2_bit): Likewise.
(slot_4_bit): Likewise.
(slot_8_bit): Likewise.
(slot_32_bit): Likewise.
(any_slot): Change to unsigned int.
(Slot_Size): New macro.
Eric Botcazou [Mon, 8 Feb 2021 11:24:56 +0000 (11:24 +0000)]
[Ada] Fix type mismatch warnings during LTO bootstrap #6
gcc/ada/
* gcc-interface/gigi.h (enum standard_datatype): Remove
ADT_exception_data_name_id and add ADT_not_handled_by_others_name_id.
(exception_data_name_id): Delete.
(not_handled_by_others_name_id): New macro.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Exception>: Remove old
kludge for exceptions.
<E_Record_Type>: Likewise.
(gnat_to_gnu_field): Force character type on Not_Handled_By_Others.
* gcc-interface/misc.c (gnat_argv): Change type to char **.
(gnat_init_options): Adjust accordingly.
* gcc-interface/trans.c (gigi): Set not_handled_by_others_name_id
and use it to set not_handled_by_others_decl.
(Exception_Handler_to_gnu_fe_sjlj): Fix indentation.
Eric Botcazou [Wed, 17 Feb 2021 09:27:41 +0000 (10:27 +0100)]
[Ada] Fix type mismatch warnings during LTO bootstrap #5
gcc/ada/
* raise-gcc.c (__gnat_others_value): Remove const qualifier.
(__gnat_all_others_value): Likewise.
(__gnat_unhandled_others_value): Likewise.
(GNAT_OTHERS): Cast to Exception_Id instead of _Unwind_Ptr.
(GNAT_ALL_OTHERS): Likewise.
(GNAT_UNHANDLED_OTHERS): Likewise.
(Is_Handled_By_Others): Change parameter type to Exception_Id.
(Language_For): Likewise.
(Foreign_Data_For): Likewise.
(is_handled_by): Likewise. Adjust throughout, remove redundant
line and fix indentation.
* libgnat/a-exexpr.adb (Is_Handled_By_Others): Remove pragma and
useless qualification from parameter type.
(Foreign_Data_For): Likewise.
(Language_For): Likewise.
Eric Botcazou [Thu, 18 Feb 2021 08:50:29 +0000 (09:50 +0100)]
[Ada] Fix type mismatch warnings during LTO bootstrap #4
gcc/ada/
* libgnat/s-stalib.ads (Exception_Data): Mark components as aliased.
* stand.ads (Standard_Entity_Type): Enhance comments.
* cstand.adb (Make_Component): Rename into...
(Make_Aliased_Component): ...this; set Is_Aliased and Is_Independent
flags on the component.
(Create_Standard): Adjust the types of the component of the record
Standard_Exception_Type and mark them as aliased.
* exp_ch11.adb (Expand_N_Exception_Declaration): Use OK
conversion to Standard_Address for Full_Name component, except
in CodePeer_Mode (set it to 0).
* exp_prag.adb (Expand_Pragma_Import_Or_Interface): Likewise.
* raise.h (struct Exception_Data): Change the type of Full_Name,
HTable_Ptr and Foreign_Data.
Eric Botcazou [Thu, 28 Jan 2021 11:40:18 +0000 (12:40 +0100)]
[Ada] Fix type mismatch warnings during LTO bootstrap #3
gcc/ada/
* atree.h (Slots_Ptr): Change pointed-to type to any_slot.
* fe.h (Get_RT_Exception_Name): Change type of parameter.
* namet.ads (Name_Entry): Mark non-boolean components as aliased,
reorder the boolean components and add an explicit Spare component.
* namet.adb (Name_Enter): Adjust aggregate accordingly.
(Name_Find): Likewise.
(Reinitialize): Likewise.
* namet.h (struct Name_Entry): Adjust accordingly.
(Names_Ptr): Use correct type.
(Name_Chars_Ptr): Likewise.
(Get_Name_String): Fix declaration and adjust to above changes.
* types.ads (RT_Exception_Code): Add pragma Convention C.
* types.h (Column_Number_Type): Fix original type.
(slot): Rename union type to...
(any_slot): ...this and adjust assertion accordingly.
(RT_Exception_Code): New enumeration type.
* uintp.ads (Uint_Entry): Mark components as aliased.
* uintp.h (Uints_Ptr): Use correct type.
(Udigits_Ptr): Likewise.
* gcc-interface/gigi.h (gigi): Adjust name and type of parameter.
* gcc-interface/cuintp.c (UI_To_gnu): Adjust references to Uints_Ptr
and Udigits_Ptr.
* gcc-interface/trans.c (Slots_Ptr): Adjust pointed-to type.
(gigi): Adjust type of parameter.
(build_raise_check): Add cast in call to Get_RT_Exception_Name.
Eric Botcazou [Tue, 16 Feb 2021 08:00:11 +0000 (09:00 +0100)]
[Ada] Fix type mismatch warnings during LTO bootstrap #2
gcc/ada/
* init.c (__gnat_raise_program_error): Fix parameter type.
(Raise_From_Signal_Handler): Likewise and mark as no-return.
* raise-gcc.c (__gnat_others_value): Fix type.
(__gnat_all_others_value): Likewise.
(__gnat_unhandled_others_value): Likewise.
* seh_init.c (Raise_From_Signal_Handler): Fix parameter type.
* libgnat/a-except.ads (Raise_From_Signal_Handler): Use convention C
and new symbol name, move declaration to...
(Raise_From_Controlled_Operation): Minor tweak.
* libgnat/a-except.adb (Raise_From_Signal_Handler): ...here.
* libgnat/a-exexpr.adb (bool): New C compatible boolean type.
(Is_Handled_By_Others): Use it as return type for the function.
Eric Botcazou [Wed, 27 Jan 2021 06:58:17 +0000 (07:58 +0100)]
[Ada] Fix type mismatch warnings during LTO bootstrap #1
gcc/ada/
* errout.ads (Set_Identifier_Casing): Add pragma Convention C.
* eval_fat.ads (Rounding_Mode): Likewise.
(Machine): Add WARNING comment line.
* exp_code.ads (Clobber_Get_Next): Add pragma Convention C.
* fe.h (Compiler_Abort): Fix return type.
(Set_Identifier_Casing): Change type of parameters.
(Clobber_Get_Next): Change return type.
* gcc-interface/trans.c (gnat_to_gnu) <N_Code_Statement>: Add cast.
Eric Botcazou [Thu, 4 Feb 2021 09:27:48 +0000 (10:27 +0100)]
[Ada] Small cleanup in C header file
gcc/ada/
* atree.h (Parent): Remove duplicate declaration.
(Get_1_Bit_Field): Also use INLINE specifier in the declaration,
fix formatting and use gcc_unreachable for the default case.
(Get_2_Bit_Field): Likewise.
(Get_4_Bit_Field): Likewise.
(Get_8_Bit_Field): Likewise.
(Get_32_Bit_Field): Likewise.
(Get_32_Bit_Field_With_Default): Likewise.
Bob Duff [Wed, 3 Feb 2021 10:31:16 +0000 (05:31 -0500)]
[Ada] Variable-sized node types
gcc/ada/
* atree.ads, atree.adb: Major rewrite to support variable-sized
node types. Add pragmas Suppress and Assertion_Policy. We now
have an extra level of indirection: Node_Offsets is a table
mapping Node_Ids to the offset of the start of each node in
Slots. Slots is a table containing one or more contiguous slots
for each node. Each slot is a 32-bit unchecked union that can
contain any mixture of 1, 2, 4, 8, and 32-bit fields that fits.
The old low-level getters and setters (e.g. Flag123) are
removed.
* gen_il-fields.ads, gen_il-gen-gen_entities.adb,
gen_il-gen-gen_nodes.adb, gen_il-gen.adb, gen_il-gen.ads,
gen_il-main.adb, gen_il-types.ads, gen_il-utils.adb,
gen_il-utils.ads, gen_il.adb, gen_il.ads: New gen_il program
that generates various Ada and C++ files. In particular, the
following files are generated by gen_il: einfo-entities.adb
einfo-entities.ads, gnatvsn.ads, nmake.adb, nmake.ads,
seinfo.ads, seinfo_tables.adb, seinfo_tables.ads,
sinfo-nodes.adb, sinfo-nodes.ads, einfo.h, and sinfo.h.
* sinfo-utils.adb, sinfo-utils.ads, einfo-utils.adb,
einfo-utils.ads: New files containing code that needs to refer
to Sinfo.Nodes and Einfo.Entities. This code is mostly moved
here from Sinfo and Einfo to break cycles.
* back_end.adb: Pass node_offsets_ptr and slots_ptr to gigi,
instead of nodes_ptr and flags_ptr. The Nodes and Flags tables
no longer exist. (Note that gigi never used the Flags table.)
* sinfo-cn.ads (Change_Identifier_To_Defining_Identifier,
Change_Character_Literal_To_Defining_Character_Literal,
Change_Operator_Symbol_To_Defining_Operator_Symbol): Turn N into
an IN formal.
* sinfo-cn.adb: Update. Add assertions, which can be removed at
some point. Rewrite to use higher-level facilities. Make sure
vanishing fields are zeroed out. Add with/use for new packages.
* sem_util.adb: Remove "Assert(False)" immediately followed by
"raise Program_Error". Use higher-level facilities such as
Walk_Sinfo_Fields instead of depending on low-level Set_FieldN
routines that no longer exist. Use Get_Comes_From_Source_Default
instead of Default_Node.Comes_From_Source (Default_Node no
longer exists). Use Set_Basic_Convention instead of
Basic_Set_Convention. Add with/use for new packages.
* sem_util.ads: The Convention field had getter Convention and
setter Basic_Set_Convention. Make that more uniform: there is
now a field called Basic_Convention, with Basic_Convention and
Set_Basic_Convention as getter/setter, and write Convention and
Set_Convention here.
* nlists.adb: Rewrite to use abstractions, rather then depending
on low-level implementation details of Atree. Necessary because
those details have changed. Add with/use for new packages.
* sem_ch12.adb: Use higher-level facilities such as
Walk_Sinfo_Fields instead of depending on low-level Set_FieldN
routines that no longer exist. Add with/use for new packages.
* exp_cg.adb, sem_ch10.adb, sem_ch4.adb, sem_eval.adb,
sem_prag.adb, sem_warn.adb: Change expanded names to refer to
the new packages for things that moved. Add with/use for new
packages.
* sem_ch3.adb: Likewise. Reinitialize vanishing fields.
* exp_disp.adb: Likewise. Remove failing assertion.
* sinfo.ads, einfo.ads: Remove code that is now generated into
Sinfo.Nodes and Einfo.Entities.
* sinfo.adb, einfo.adb: Replace bodies with "pragma No_Body;".
We should delete these at some point, but No_Body makes make
files easier. Some code is moved to Sinfo.Nodes, Einfo.Entities,
Sinfo.Utils, and Einfo.Utils. Some is no longer necessary.
* treepr.adb: Rewrite to use new tables. We no longer need
treeprs.ads.
* treepr.ads: Add comment.
* types.ads: Move types Component_Alignment_Kind and
Float_Rep_Kind here.
* atree.h: Major update to match atree.ads changes. Add slot
types, for use by getters/setters.
* types.h: Move types Component_Alignment_Kind and
Float_Rep_Kind here.
* fe.h: Rewrite to deal with code that has changed or moved from
Atree, Sinfo, Einfo.
* nlists.h: Move some code to fe.h.
* alloc.ads: Split Nodes_* constants into Node_Offsets and
Slots, because Atree has two separate tables. Increase values.
Remove Nodes_Release_Threshold. Improve comment.
* debug.adb, gnat1drv.adb: Remove obsolete gnatd.A and gnatd.N
switches. Add with/use for new packages.
* opt.ads: Minor comment fix.
* aspects.adb, checks.adb, comperr.adb, contracts.adb,
cstand.adb, debug_a.adb, errout.adb, eval_fat.adb, exp_aggr.adb,
exp_atag.adb, exp_attr.adb, exp_ch11.adb, exp_ch12.adb,
exp_ch13.adb, exp_ch2.adb, exp_ch3.adb, exp_ch4.adb,
exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_ch8.adb, exp_ch9.adb,
exp_code.adb, exp_dbug.adb, exp_dist.adb, exp_fixd.adb,
exp_imgv.adb, exp_intr.adb, exp_pakd.adb, exp_prag.adb,
exp_put_image.adb, exp_sel.adb, exp_smem.adb, exp_spark.adb,
exp_strm.adb, exp_tss.adb, exp_unst.adb, exp_util.adb,
exp_util.ads, expander.adb, freeze.adb, frontend.adb,
get_targ.ads, ghost.adb, gnat_cuda.adb, impunit.adb, inline.adb,
itypes.adb, itypes.ads, layout.adb, lib.adb, lib-load.adb,
lib-writ.adb, lib-xref.adb, lib-xref.ads,
lib-xref-spark_specific.adb, live.adb, par.adb, par_sco.adb,
pprint.adb, repinfo.adb, restrict.adb, rtsfind.adb, scil_ll.adb,
scn.adb, sem.adb, sem.ads, sem_aggr.adb, sem_attr.adb,
sem_aux.adb, sem_case.adb, sem_cat.adb, sem_ch11.adb,
sem_ch13.adb, sem_ch2.adb, sem_ch5.adb, sem_ch6.adb,
sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_dim.adb,
sem_disp.adb, sem_dist.adb, sem_elab.adb, sem_elim.adb,
sem_intr.adb, sem_mech.adb, sem_res.adb, sem_scil.adb,
sem_smem.adb, sem_type.adb, set_targ.ads, sinput.adb,
sinput-l.adb, sprint.adb, style.adb, styleg.adb, tbuild.adb,
tbuild.ads, uname.adb: Add with/use for new packages.
* libgnat/a-stoubu.adb, libgnat/a-stouut.adb: Simplify to ease
bootstrap.
* libgnat/a-stobfi.adb, libgnat/a-stoufi.adb (Create_File,
Create_New_File): Create file in binary format, to avoid
introducing unwanted text conversions on Windows. Simplify to
ease bootstrap.
* libgnat/a-stteou__bootstrap.ads: New.
* ceinfo.adb, csinfo.adb, nmake.adt, treeprs.adt, xeinfo.adb,
xnmake.adb, xsinfo.adb, xtreeprs.adb: Delete.
* Make-generated.in: Build and run the gen_il program to
generate files. The files are generated in the ada/gen_il
subdirectory, and then moved up to ada. We rely on gnatmake (as
opposed to make) to build the gen_il program efficiently (i.e.
don't do anything if the sources didn't change).
* gcc-interface/Makefile.in (ADAFLAGS): Add -gnatU.
(GNATMAKE_OBJS): Add new object files.
(GENERATED_FILES_FOR_TOOLS): New variable.
(../stamp-tools): Create a link for all
GENERATED_FILES_FOR_TOOLS.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add new object
files. Remove ada/treeprs.o.
(GNATBIND_OBJS): Add new object files.
(ada.mostlyclean): Remove ada/sdefault.adb and add
ada/stamp-gen_il.
(ada.maintainer-clean): Remove ada/treeprs.ads.
(update-sources): Remove obsolete target.
(ada_generated_files): Rename to...
(ADA_GENERATED_FILES): ... this. Add new source files. Add
comment.
* gcc-interface/trans.c: Remove obsolete Nodes_Ptr and
Flags_ptr. Add Node_Offsets_Ptr and Slots_Ptr, which point to
the corresponding tables in Atree.
* gcc-interface/gigi.h (gigi): New parameters for initializing
Node_Offsets_Ptr and Slots_Ptr.
* gcc-interface/decl.c: Numeric_Kind,
Discrete_Or_Fixed_Point_Kind, and Record_Kind were
nonhierarchical, and were therefore removed for simplicity.
Replace uses with calls to Is_In_... functions.
gnattools/
* Makefile.in (GENERATED_FILES_FOR_TOOLS): New variable.
($(GCC_DIR)/stamp-tools): Walk it for the first copy operation.
Ed Schonberg [Tue, 2 Feb 2021 15:13:52 +0000 (10:13 -0500)]
[Ada] Spurious error with component of unchecked_union type
gcc/ada/
* exp_ch4.adb (Unconstrained_UU_In_Component_Declaration): A
component declaration whose subtype indication is an entity name
without an explicit constraint is an Unchecked_Union type only
if the entity has an unconstrained nominal subtype (record type
or private type) whose parent type is an Unchecked_Union.
Piotr Trojanek [Fri, 29 Jan 2021 11:16:17 +0000 (12:16 +0100)]
[Ada] Attribute Address is not an interfering context in SPARK
gcc/ada/
* sem_res.adb (Flag_Object): Ignore prefixes of attribute
Address.
Yannick Moy [Tue, 2 Feb 2021 11:31:04 +0000 (12:31 +0100)]
[Ada] Generate warning for negative literal of a modular type
gcc/ada/
* opt.ads: Update comment for Warn_On_Suspicious_Modulus_Value.
* sem_res.adb (Resolve_Unary_Op): Generate warning.
* usage.adb: Refine doc for -gnatw.m/M switch.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Update doc on -gnatw.m switch.
* gnat_ugn.texi: Regenerate.
Piotr Trojanek [Fri, 29 Jan 2021 10:45:36 +0000 (11:45 +0100)]
[Ada] Cleanup code for flagging object references in interfering contexts
gcc/ada/
* sem_res.adb (Flag_Object): Replace chained IF with a CASE;
remove repeated calls to Entity; do not traverse into
N_Identifier and N_Expanded_Name, because only need to examine
their Entity field anyway.
Piotr Trojanek [Fri, 29 Jan 2021 18:34:39 +0000 (19:34 +0100)]
[Ada] Remove End_Interp_List from the overloaded resolution API
gcc/ada/
* sem_ch4.adb (Analyze_Call): Remove call to End_Interp_List.
(Process_Overloaded_Indexed_Component): Remove call to
End_Interp_List.
* sem_util.adb (Insert_Explicit_Dereference): Remove call to
End_Interp_List.
* sem_type.ads (End_Interp_List): Remove.
* sem_type.adb (Add_Entry): The guard against duplicate entries
is now checked before other conditions, so that EXIT statements
do not bypass this guard.
(End_Interp_List): Remove.
Ed Schonberg [Mon, 1 Feb 2021 18:12:57 +0000 (13:12 -0500)]
[Ada] Crash on imported object with deep initialization and No_Aborts
gcc/ada/
* exp_util.adb (Remove_Init_Call): If a simple initialization
call is present, and the next statement is an initialization
block (that contains a call to a Deep_ Initialize routine),
remove the block as well, and insert the first initialization
call in it, in case it is needed for later relocation.
Gary Dismukes [Sat, 30 Jan 2021 01:03:34 +0000 (20:03 -0500)]
[Ada] Remove some ??? comments
gcc/ada/
* errout.ads (Size_Too_Small_Message): Remove low-value ???
comment.
* exp_util.ads: Remove ??? in part of overall package comments
and restructure comment to clarify.
(Duplicate_Subexpr): Remove ??? comment that seems unnecessary.
* sem_ch3.ads (Analyze_Declarations): Remove two parenthesized
??? comments and add more description of the procedure's
actions.
(Get_Discriminant_Value): Remove ??? comment requesting more
documentation, expanding description of the function's actions.
* sem_disp.ads (Check_Operation_From_Incomplete_Type): Add more
semantic description of the procedure and remove ??? comment
requesting such.
(Propagate_Tag): Refine comment to indicate meaning of formal
parameters and generally improve the spec comment (and remove
??? comment asking about the parameters).
Arnaud Charlet [Fri, 29 Jan 2021 15:57:39 +0000 (10:57 -0500)]
[Ada] Computation of Shift_Left and large signed values
gcc/ada/
* sem_eval.adb (Fold_Shift): Fix computation of Shift_Left
resulting in negative signed values.
Eric Botcazou [Tue, 26 Jan 2021 11:10:45 +0000 (12:10 +0100)]
[Ada] Fix signature mismatch for Defining_Entity
gcc/ada/
* sem_util.ads (Defining_Entity): Remove Empty_On_Errors parameter.
(Defining_Entity_Or_Empty): New function.
* sem_util.adb (Defining_Entity): Move bulk of implementation to...
(Defining_Entity_Or_Empty): ...here. Do not raise Program_Error.
(Innermost_Master_Scope_Depth): Call Defining_Entity_Or_Empty.
Justin Squirek [Wed, 20 Jan 2021 17:09:19 +0000 (12:09 -0500)]
[Ada] Implement aspect No_Controlled_Parts
gcc/ada/
* aspects.ads: Add entries to register
Aspect_No_Controlled_Parts.
* freeze.adb (Check_No_Controlled_Parts_Violations): Added to
check requirements of aspect No_Controlled_Parts after a type
has been frozen.
(Freeze_Entity): Add call to
Check_No_Controlled_Parts_Violations.
(Find_Aspect_No_Controlled_Parts): Created to obtain the aspect
specification for No_Controlled_Parts on a given type when
present.
(Find_Aspect_No_Controlled_Parts_Value): Protect against invalid
value.
(Has_Aspect_No_Controlled_Parts): Created as a prediate function
to check if No_Controlled_Parts has been specified on a type for
Get_Anacestor_Types_With_Specification.
(Get_Aspect_No_Controlled_Parts_Value): Created to obtain the
value of the aspect No_Controlled_Parts when specified on a
given type.
(Get_Generic_Formal_Types_In_Hierarchy): Created to collect
formal types in a given type's hierarchy.
(Get_Types_With_Aspect_In_Hierarchy): Created to collect types
in a given type's hierarchy with No_Controlled_Parts specified.
* sem_ch13.adb (Analyze_One_Aspect): Add processing for
No_Controlled_Parts, and fix error in check for allowed pragmas
for formal types.
(Check_Expr_Is_OK_Static_Expression): Created to enforce
checking of static expressions in the same vein as
Analyze_Pragma.Check_Expr_OK_Static_Expression.
* sem_util.adb (Collect_Types_In_Hierarchy): Created to collect
types in a given type's hierarchy that match a given predicate
function.
* sem_util.ads: Fix typo.
* snames.ads-tmpl: Add entry for No_Controlled_Parts.
Eric Botcazou [Mon, 25 Jan 2021 18:22:39 +0000 (19:22 +0100)]
[Ada] Raise Constraint_Error for Compose and Scaling if Machine_Overflows
gcc/ada/
* libgnat/s-fatgen.adb (Scaling): Raise Constraint_Error in the
overflow case when T'Machine_Overflows is True.
Bob Duff [Mon, 25 Jan 2021 15:18:08 +0000 (10:18 -0500)]
[Ada] Minor efficiency improvement in containers
gcc/ada/
* libgnat/a-conhel.adb (TC_Check): Move the Assert into the
'if'.
Frederic Konrad [Fri, 6 Nov 2020 18:59:51 +0000 (19:59 +0100)]
[Ada] sigtramp: fix powerpc64 against -fPIC
gcc/ada/
* sigtramp-vxworks-target.inc: Use a local label for the TOC.
Claire Dross [Mon, 25 Jan 2021 14:30:22 +0000 (15:30 +0100)]
[Ada] Move Has_Inferable_Discriminants to Sem_Util
gcc/ada/
* exp_ch4.adb (Has_Inferable_Discriminants): Moved to Sem_Util.
* sem_util.ads, sem_util.adb (Has_Inferable_Discriminants):
Moved from Exp_Ch4.
Ed Schonberg [Sun, 24 Jan 2021 18:18:28 +0000 (13:18 -0500)]
[Ada] Spurious error on protected call in inherited postcondition
gcc/ada/
* exp_util.adb (Build_Class_Wide_Expression, Replace_Entity):
Add guard to verify that the enclosing pragma is a precondition.
Uros Bizjak [Fri, 7 May 2021 09:15:07 +0000 (11:15 +0200)]
i386: Do not emit mask compares for mode sizes < 16 [PR100445]
Recent addition of v*cond* patterns for MMXMODEI modes allows 64bit MMX
modes to enter ix86_expand_sse_cmp. ix86_use_mask_cmp_p was not prepared
to reject mode sizes < 16, resulting in ICE due to unavailability of 64bit
masked PCOM instructions.
2021-05-07 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100445
* config/i386/i386-expand.c (ix86_use_mask_cmp_p):
Return false for mode sizes < 16.
gcc/testsuite/
PR target/100445
* gcc.target/i386/pr100445-1.c: New test.
Jakub Jelinek [Fri, 7 May 2021 08:37:52 +0000 (10:37 +0200)]
i386: Fix up 8-byte vcond* with -mxop [PR100445]
ix86_expand_sse_movcc has special TARGET_XOP handling and the recent
addition of support of v*cond* patterns for MMXMODEI modes results in
ICEs because the expected pattern doesn't exist. We can handle it
using 128-bit vpcmov (if we ignore the upper 64 bits like we ignore in
other TARGET_MMX_WITH_SSE support).
2021-05-07 Jakub Jelinek <jakub@redhat.com>
PR target/100445
* config/i386/mmx.md (*xop_pcmov_<mode>): New define_insn.
* gcc.target/i386/pr100445.c: New test.
GCC Administrator [Fri, 7 May 2021 00:16:33 +0000 (00:16 +0000)]
Daily bump.
Joseph Myers [Thu, 6 May 2021 23:20:35 +0000 (23:20 +0000)]
preprocessor: Fix pp-number lexing of digit separators [PR83873, PR97604]
When the preprocessor lexes preprocessing numbers in lex_number, it
accepts digit separators in more cases than actually permitted in
pp-numbers by the standard syntax.
One thing this accepts is adjacent digit separators; there is some
code to reject those later, but as noted in bug 83873 it fails to
cover the case of adjacent digit separators within a floating-point
exponent. Accepting adjacent digit separators only results in a
missing diagnostic, not in valid code being rejected or being accepted
with incorrect semantics, because the correct lexing in such a case
would have '' start the following preprocessing tokens, and no valid
preprocessing token starts '' while ' isn't valid on its own as a
preprocessing token either. So this patch fixes that case by moving
the error for adjacent digit separators to lex_number (allowing a more
specific diagnostic than if '' were excluded from the pp-number
completely).
Other cases inappropriately accepted involve digit separators before
'.', 'e+', 'e-', 'p+' or 'p-' (or corresponding uppercase variants).
In those cases, as shown by the test digit-sep-pp-number.C added, this
can result in valid code being wrongly rejected as a result of too
many characters being included in the pp-number. So this case is
fixed by terminating the pp-number at the correct character according
to the standard. That test also covers the case where a digit
separator was followed by an identifier-nondigit that is not a
nondigit (e.g. a UCN); that case was already handled correctly.
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
libcpp/
PR c++/83873
PR preprocessor/97604
* lex.c (lex_number): Reject adjacent digit separators here. Do
not allow digit separators before '.' or an exponent with sign.
* expr.c (cpp_classify_number): Do not check for adjacent digit
separators here.
gcc/testsuite/
PR c++/83873
PR preprocessor/97604
* g++.dg/cpp1y/digit-sep-neg-2.C,
g++.dg/cpp1y/digit-sep-pp-number.C: New tests.
* g++.dg/cpp1y/digit-sep-line-neg.C, g++.dg/cpp1y/digit-sep-neg.C:
Adjust expected messages.
Jonathan Wakely [Thu, 6 May 2021 14:28:55 +0000 (15:28 +0100)]
libstdc++: Improve static assert messages
The message used for static assertions should be phrased so that it's
unambiguous whether the condition should be true or false. The message
should definitely not state the negative condition.
libstdc++-v3/ChangeLog:
* include/bits/stl_algobase.h (__copy_move, __copy_move_backward):
Improve static_assert messages.
* testsuite/25_algorithms/copy/58982.cc: Adjust expected output.
* testsuite/25_algorithms/copy_n/58982.cc: Likewise.
Martin Jambor [Wed, 5 May 2021 08:41:41 +0000 (10:41 +0200)]
ipa-sra: Do not bail out when callers cannot be cloned
IPA-SRA fails to produce (very simple) edge summaries when a caller
cannot be cloned or its signature cannot be changed which makes it
less powerful for no good reason. This patch fixes that problem.
gcc/ChangeLog:
2021-04-12 Martin Jambor <mjambor@suse.cz>
* ipa-sra.c (ipa_sra_dump_all_summaries): Dump edge summaries even
when there is no function summary.
(ipa_sra_summarize_function): produce edge summaries even when
bailing out early.
gcc/testsuite/ChangeLog:
2021-04-12 Martin Jambor <mjambor@suse.cz>
* gcc.dg/ipa/ipa-sra-1.c (main): Revert change done by
05193687dde, make the argv again pointer to an array.
Tom Tromey [Thu, 29 Apr 2021 00:47:15 +0000 (18:47 -0600)]
go: use htab_eq_string in godump
This changes godump to use the new htab_eq_string function.
gcc
* godump.c (string_hash_eq): Remove.
(go_finish): Use htab_eq_string.
Tom Tromey [Thu, 29 Apr 2021 00:46:44 +0000 (18:46 -0600)]
gcc: use htab_eq_string
This changes one spot in GCC to use the new htab_eq_string function.
gcc
* gengtype-state.c (read_state): Use htab_eq_string.
(string_eq): Remove.
Tom Tromey [Thu, 29 Apr 2021 00:44:48 +0000 (18:44 -0600)]
libiberty: add htab_eq_string
The libiberty hash table includes a helper function for strings, but
no equality function. Consequently, this equality function has been
reimplemented a number of times in both the gcc and binutils-gdb
source trees. This patch adds the function to the libiberty hash
table, as a step toward the goal of removing all the copies.
One change to gcc is included here. Normally I would have put this in
the next patch, but gensupport.c used the most natural name for its
reimplementation of this function, and this can't coexist with the
extern function in libiberty.
include
* hashtab.h (htab_eq_string): Declare.
libiberty
* hashtab.c (htab_eq_string): New function.
gcc
* gensupport.c (htab_eq_string): Remove.
Bernd Edlinger [Tue, 12 Jan 2021 15:27:53 +0000 (16:27 +0100)]
Add line debug info for virtual thunks
There is no debug info when the DECL_IGNORED_P flag
is set. But sometimes we have the line info of the
function decl, as in the case of on virtual thunks.
So instead of no line info at all, we emit at least
the location of the function decl.
On the other side, there are DECL_IGNORED_P functions
which do not have any source line info at all.
Remove those from the debug_range info, to make it
clear for the debugger that the line info for these
functions is invalid. This has the effect that the
debugger will not step into the function without
debug info.
2021-05-06 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR ipa/97937
* debug.h (gcc_debug_hooks): Add set_ignored_loc function pointer.
* dwarf2out.h (dw_fde_node::ignored_debug): New data item.
* dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Add dummy
set_ignored_loc callbacks.
* debug.c (do_nothing_debug_hooks): Likewise.
* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
* dwarf2out.c (text_section_used, cold_text_section_used): Remove.
(in_text_section_p, last_text_label, last_cold_label,
switch_text_ranges, switch_cold_ranges): New data items.
(dwarf2out_note_section_used): Remove.
(dwarf2out_begin_prologue): Set fde->ignored_debug and
in_text_section_p.
(mark_ignored_debug_section): New helper function.
(dwarf2out_end_epilogue, dwarf2out_switch_text_section): Call
mark_ignored_debug_section.
(dwarf2_debug_hooks): Use dwarf2out_set_ignored_loc.
(dwarf2_lineno_debug_hooks): Use dummy for set_ignored_loc.
(size_of_aranges): Adjust formula for multi-part text ranges size.
(output_aranges): Output multi-part text ranges.
(dwarf2out_set_ignored_loc): New callback function.
(dwarf2out_finish): Output multi-part text ranges.
(dwarf2out_c_finalize): Clear new data items.
* final.c (final_start_function_1): Call set_ignored_loc callback.
(final_scan_insn_1): Likewise.
* ggc-page.c (gt_ggc_mx): New helper function.
* stringpool.c (gt_pch_nx): Likewise.
Eric Botcazou [Thu, 6 May 2021 14:26:55 +0000 (16:26 +0200)]
Fix PR testsuite/100454
gcc/testsuite/
* gnat.dg/opt93.adb: Compile only for LP64 targets.
Robin Dapp [Thu, 6 May 2021 13:55:47 +0000 (15:55 +0200)]
testsuite: Add s390 to vect_*_cvt checks.
This patch adds s390 to vect_*_cvt checks in target-supports.exp.
gcc/testsuite/ChangeLog:
* lib/target-supports.exp: Add s390 checks for vect conversions.
Robin Dapp [Thu, 6 May 2021 13:52:48 +0000 (15:52 +0200)]
testsuite: Add vect_floatint_cvt to gcc.dg/vect/pr56541.c
pr56541.c converts a float vector to an int (bool) vector. Add
vect_floatint_cvt in order to select the right targets.
gcc/testsuite/ChangeLog:
* gcc.dg/vect/pr56541.c: Add vect_floatint_cvt.
Paul Thomas [Thu, 6 May 2021 13:41:33 +0000 (14:41 +0100)]
Fortran: Assumed and explicit size class arrays [PR46691/99819].
2021-05-06 Paul Thomas <pault@gcc.gnu.org>
gcc/fortran/ChangeLog
PR fortran/46691
PR fortran/99819
* class.c (gfc_build_class_symbol): Remove the error that
disables assumed size class arrays. Class array types that are
not deferred shape or assumed rank are given a unique name and
placed in the procedure namespace.
* trans-array.c (gfc_trans_g77_array): Obtain the data pointer
for class arrays.
(gfc_trans_dummy_array_bias): Suppress the runtime error for
extent violations in explicit shape class arrays because it
always fails.
* trans-expr.c (gfc_conv_procedure_call): Handle assumed size
class actual arguments passed to non-descriptor formal args by
using the data pointer, stored as the symbol's backend decl.
gcc/testsuite/ChangeLog
PR fortran/46691
PR fortran/99819
* gfortran.dg/class_dummy_6.f90: New test.
* gfortran.dg/class_dummy_7.f90: New test.
Patrick Palka [Thu, 6 May 2021 13:11:44 +0000 (09:11 -0400)]
libstdc++: Implement LWG 3533 changes to foo_view::iterator::base()
libstdc++-v3/ChangeLog:
* include/std/ranges (filter_view::_Iterator::base): Make the
const& overload unconstrained and return a const reference as
per LWG 3533. Make unconditionally noexcept.
(transform_view::_Iterator::base): Likewise.
(elements_view::_Iterator::base): Likewise.
Patrick Palka [Thu, 6 May 2021 13:11:42 +0000 (09:11 -0400)]
libstdc++: Implement LWG 3391 changes to move/counted_iterator::base()
libstdc++-v3/ChangeLog:
* include/bits/stl_iterator.h (move_iterator::base): Make the
const& overload unconstrained and return a const reference as
per LWG 3391. Make unconditionally noexcept.
(counted_iterator::base): Likewise.
* testsuite/24_iterators/move_iterator/lwg3391.cc: New test.
* testsuite/24_iterators/move_iterator/move_only.cc: Adjust
has_member_base concept to decay-copy the result of base().
Richard Biener [Thu, 6 May 2021 09:17:58 +0000 (11:17 +0200)]
refactor SSA rewriting timevars
This avoids too deep stacks of timevars during incremental
SSA rewrite and basically use TV_TREE_INTO_SSA for all into-SSA
rewrite work and TV_TREE_SSA_INCREMENTAL for update_ssa.
2021-05-06 Richard Biener <rguenther@suse.de>
* timevar.def (TV_TREE_INSERT_PHI_NODES): Remove.
(TV_TREE_SSA_REWRITE_BLOCKS): Likewise.
(TV_TREE_INTO_SSA): New.
* tree-into-ssa.c (insert_phi_nodes): Do not account separately.
(rewrite_blocks): Likewise.
(pass_data_build_ssa): Account to TV_TREE_INTO_SSA.
Jonathan Wakely [Thu, 6 May 2021 12:40:53 +0000 (13:40 +0100)]
libstdc++: Fix definition of std::remove_cvref_t
I originally defined std::remove_cvref_t in terms of the internal
__remove_cvref_t trait, to avoid instantiating the remove_cvref class
template. However, as described in P1715R0 that is observable by users
and is thus non-conforming.
This defines remove_cvref_t as specified in the standard.
libstdc++-v3/ChangeLog:
* include/std/type_traits (remove_cvref_t): Define in terms of
remove_cvref.
* testsuite/20_util/remove_cvref/value.cc: Check alias.
Jonathan Wakely [Thu, 6 May 2021 08:33:41 +0000 (09:33 +0100)]
Revert "libstdc++: Use unsigned char argument to std::isdigit"
This reverts commit
d0d6ca019717305df0ef41e3fe1da48f7f561fac.
Jakub Jelinek [Thu, 6 May 2021 12:05:06 +0000 (14:05 +0200)]
phiopt: Use gphi *phi instead of gimple *phi some more
Various functions in phiopt are also called with a gphi * but use
gimple * argument for it.
2021-05-06 Jakub Jelinek <jakub@redhat.com>
* tree-ssa-phiopt.c (value_replacement, minmax_replacement,
abs_replacement, xor_replacement,
cond_removal_in_popcount_clz_ctz_pattern,
replace_phi_edge_with_variable): Change type of phi argument from
gimple * to gphi *.
Richard Biener [Thu, 6 May 2021 09:29:25 +0000 (11:29 +0200)]
Avoid update_ssa quadraticness in loop splitting
We already take care to not apply loop splitting to IL produced
by splitting so we should be able to delay updating SSA and
loop-closed SSA that was left broken after loop versioning
until after we processed all opportunities.
2021-05-06 Richard Biener <rguenther@suse.de>
* tree-ssa-loop-split.c (split_loop): Delay updating SSA form.
Output an opt-info message.
(do_split_loop_on_cond): Likewise.
(tree_ssa_split_loops): Update SSA form here.
Richard Biener [Thu, 6 May 2021 07:44:49 +0000 (09:44 +0200)]
Fix IPA SRA removal of DECL_BY_REFERENCE return
While doing bogus call LHS removal I noticed that cloning with
dropping a return value creates a bogus replacement for a
DECL_BY_REFERENCE DECL_RESULT, resulting in MEM_REFs of
aggregates rather than pointers. The following fixes this
latent issue.
2021-05-06 Richard Biener <rguenther@suse.de>
* tree-inline.c (tree_function_versioning): Fix DECL_BY_REFERENCE
return variable removal.
Christophe Lyon [Thu, 6 May 2021 09:05:52 +0000 (09:05 +0000)]
testsuite: gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl
The new test gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl(),
which may not be available, for instance on aarch64-elf with newlib.
As discussed in the PR, requiring c99_runtime enables to skip the test
in this case.
2021-05-06 Christophe Lyon <christophe.lyon@linaro.org>
PR testsuite/100355
gcc/testsuite/
* gcc.c-torture/execute/ieee/cdivchkld.x: New.
Marius Hillenbrand [Tue, 4 May 2021 11:30:05 +0000 (13:30 +0200)]
IBM Z: Fix error checking for builtin vec_permi
The builtin vec_permi is peculiar in that its immediate operand is
encoded differently than the immediate operand that is backing the
builtin. This fixes the check for the immediate operand, adding a
regression test in the process.
This partially reverts commit
3191c1f4488d1f7563b563d7ae2a102a26f16d82
2021-05-06 Marius Hillenbrand <mhillen@linux.ibm.com>
gcc/ChangeLog:
* config/s390/s390-builtins.def (O_M5, O1_M5, ...): Remove unused macros.
(s390_vec_permi_s64, s390_vec_permi_b64, s390_vec_permi_u64)
(s390_vec_permi_dbl, s390_vpdi): Use the O3_U2 type for the immediate
operand.
* config/s390/s390.c (s390_const_operand_ok): Remove unused
values.
gcc/testsuite/ChangeLog:
* gcc.target/s390/zvector/imm-range-error-1.c: Fix test for
__builtin_s390_vpdi.
* gcc.target/s390/zvector/vec-permi.c: New test for builtin
vec_permi.