Eric Botcazou [Tue, 3 Aug 2021 10:37:38 +0000 (12:37 +0200)]
[Ada] Adjust documentation of gnatsymbolize
gcc/ada/
* doc/gnat_ugn/gnat_utility_programs.rst (gnatsymbolize):
Document new --load option and -g1 as minimal compilation
requirement.
Piotr Trojanek [Tue, 27 Jul 2021 13:00:39 +0000 (15:00 +0200)]
[Ada] Tune detection of internally generated positional aggregates
gcc/ada/
* sem_aggr.adb (Resolve_Array_Aggregate): Only keep the bounds
for internally generated attributes; otherwise, compute them
anew.
Javier Miranda [Mon, 26 Jul 2021 08:55:39 +0000 (04:55 -0400)]
[Ada] Wrappers of access-to-subprograms with pre/post conditions
gcc/ada/
* sem_ch3.adb (Build_Access_Subprogram_Wrapper): Decorate the
wrapper with attribute Is_Wrapper, and move its declaration to
the freezing actions of its type declaration; done to facilitate
identifying it at later stages to avoid handling it as a
primitive operation of a tagged type; otherwise it may be
handled as a dispatching operation and erroneously registered in
a dispatch table.
(Make_Index): Add missing decoration of field Parent.
* sem_disp.adb (Check_Dispatching_Operation): Complete
decoration of late-overriding dispatching primitives.
(Is_Access_To_Subprogram_Wrapper): New subprogram.
(Inherited_Subprograms): Prevent cascaded errors; adding missing
support for private types.
* sem_type.adb (Add_One_Interp): Add missing support for the
first interpretation of a primitive of an inmediate ancestor
interface.
* sem_util.adb (Check_Result_And_Post_State_In_Pragma): Do not
report missing reference in postcondition placed in internally
built wrappers.
* exp_disp.adb (Expand_Dispatching_Call): Adding assertion.
Ed Schonberg [Tue, 27 Jul 2021 14:55:07 +0000 (10:55 -0400)]
[Ada] Ada2022: implementation of AI12-0212 : iterator specs in array aggregates
gcc/ada/
* sem_aggr.adb (Resolve_Array_Aggregate): Check the validity of
an array aggregate all of whose components are iterated
component associations.
* exp_aggr.adb (Expand_Array_Aggregate,
Two_Pass_Aggregate_Expansion): implement two-pass algorithm and
replace original aggregate with resulting temporary, to ensure
that a proper length check is performed if context is
constrained. Use attributes Pos and Val to handle index types of
any discrete type.
Bob Duff [Fri, 30 Jul 2021 20:49:37 +0000 (16:49 -0400)]
[Ada] Follow-on efficiency improvements
gcc/ada/
* gen_il-gen.adb: Set the number of concrete nodes that have the
Homonym field to a higher number than any other field. This
isn't true, but it forces Homonym's offset to be chosen first,
so it will be at offset zero and hence slot zero.
Richard Kenner [Tue, 27 Jul 2021 16:23:23 +0000 (12:23 -0400)]
[Ada] If unnesting and relocating subprogram call, make new Parameter_Associations
gcc/ada/
* atree.adb (Relocate_Node): If relocating a subprgram call and
we're doing unnesting, make a new Parameter_Associations, if
any.
Piotr Trojanek [Wed, 28 Jul 2021 13:16:09 +0000 (15:16 +0200)]
[Ada] Remove Initializes contracts from Ada.Strings.Bounded
gcc/ada/
* libgnat/a-strbou.ads (Generic_Bounded_Length): Remove explicit
Initializes contract.
Bob Duff [Thu, 29 Jul 2021 15:15:46 +0000 (11:15 -0400)]
[Ada] Cleanup and efficiency improvements
gcc/ada/
* gen_il-gen.adb: Generate getters and setters with much of the
code inlined. Generate code for storing a few fields in the node
header, to avoid the extra level of indirection for those
fields. We generate the header type, so we don't have to
duplicate hand-written Ada and C code to depend on the number of
header fields. Declare constants for slot size. Use short names
because these are used all over. Remove
Put_Low_Level_Accessor_Instantiations, Put_Low_Level_C_Getter,
which are no longer needed. Rename
Put_High_Level_C_Getter-->Put_C_Getter.
* atree.ads, atree.adb: Take into account the header slots.
Take into account the single Node_Or_Entity_Field type. Remove
"pragma Assertion_Policy (Ignore);", because the routines in
this package are no longer efficiency critical.
* atree.h: Remove low-level getters, which are no longer used by
sinfo.h and einfo.h.
* einfo-utils.adb: Avoid crash in Known_Alignment.
* live.adb, sem_eval.adb: Remove code that prevents Node_Id from
having a predicate. We don't actually add a predicate to
Node_Id, but we want to be able to for temporary debugging.
* sinfo-utils.adb: Remove code that prevents Node_Id from having
a predicate. Take into account the single Node_Or_Entity_Field
type.
* sinfo-utils.ads: Minor.
* table.ads (Table_Type): Make the components aliased, because
low-level setters in Atree need to take 'Access.
* treepr.adb: Take into account the single Node_Or_Entity_Field
type. Make some code more robust, so we can print out
half-baked nodes.
* types.ads: Move types here for visibility purposes.
* gcc-interface/gigi.h, gcc-interface/trans.c: Take into account
the Node_Header change in the GNAT front end.
* gcc-interface/cuintp.c, gcc-interface/targtyps.c: Add because
gigi.h now refers to type Node_Header, which is in sinfo.h.
Yannick Moy [Mon, 26 Jul 2021 10:21:02 +0000 (12:21 +0200)]
[Ada] Minimize parts of Ada.Strings.Fixed marked SPARK_Mode => Off
gcc/ada/
* libgnat/a-strfix.adb (Delete, Insert, Overwrite,
Replace_Slice): Remove SPARK_Mode Off.
* libgnat/a-strfix.ads (Insert, Overwrite, Replace_Slice):
Strengthen precondition.
Piotr Trojanek [Wed, 28 Jul 2021 12:13:58 +0000 (14:13 +0200)]
[Ada] Remove global parameter in Global contracts of Ada.Strings.Bounded
gcc/ada/
* libgnat/a-strbou.ads (Generic_Bounded_Length): Remove non-null
Global contracts.
Steve Baird [Fri, 23 Jul 2021 18:09:05 +0000 (11:09 -0700)]
[Ada] Update "Implementation Defined Characteristics" documentation.
gcc/ada/
* doc/gnat_rm/implementation_defined_characteristics.rst: Update
this section to reflect the current version of Ada RM M.2.
* gnat_rm.texi: Regenerate.
Bill Schmidt [Thu, 23 Sep 2021 12:35:42 +0000 (07:35 -0500)]
rs6000: Add psabi diagnostic for C++ zero-width bit field ABI change
Previously zero-width bit fields were removed from structs, so that otherwise
homogeneous aggregates were treated as such and passed in FPRs and VSRs.
This was incorrect behavior per the ELFv2 ABI. Now that these fields are no
longer being removed, we generate the correct parameter passing code. Alert
the unwary user in the rare cases where this behavior changes.
2021-09-23 Bill Schmidt <wschmidt@linux.ibm.com>
gcc/
PR target/102024
* config/rs6000/rs6000-call.c (rs6000_aggregate_candidate): Detect
zero-width bit fields and return indicator.
(rs6000_discover_homogeneous_aggregate): Diagnose when the
presence of a zero-width bit field changes parameter passing in
GCC 12.
gcc/testsuite/
PR target/102024
* g++.target/powerpc/pr102024.C: New.
Aldy Hernandez [Thu, 23 Sep 2021 07:40:59 +0000 (09:40 +0200)]
Remove dominator check in fold_using_range::range_of_phi.
Revert the following patch, as it was an artifact of diagnostic code
being run with improper IL.
commit
64b80b8819f9ea74712625bceb0ec4388e25f67d
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Sep 21 08:28:28 2021 +0200
Do not query SCEV in range_of_phi unless dominators are available.
SCEV won't work without dominators and we can get called without
dominators from debug_ranger.
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_phi):
Remove dominator check.
Aldy Hernandez [Thu, 23 Sep 2021 07:37:00 +0000 (09:37 +0200)]
Hoist edge calculations in precompute_relations.
Tested on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::precompute_relations):
Hoist edge calculations before using EDGE_SUCC.
Jonathan Wakely [Thu, 23 Sep 2021 10:30:14 +0000 (11:30 +0100)]
configure: Update --help output for --with-multilib-list
The list of architectures that support the option is incomplete.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
Reviewed-by: Jim Wilson <jimw@sifive.com>
gcc/ChangeLog:
* configure.ac: Fix --with-multilib-list description.
* configure: Regenerate.
Richard Biener [Thu, 23 Sep 2021 08:27:01 +0000 (10:27 +0200)]
tree-optimization/102448 - clear copied alignment info from vect
This fixes the previous change which removed setting alignment info
from the vectorizers idea of how a pointer is being used but left
in place the copied info from DR_PTR_INFO without realizing that this
is in fact _not_ the alignment of the access but the alignment of
a base pointer contained in it.
The following makes sure to not use that info.
2021-09-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/102448
* tree-vect-data-refs.c (vect_duplicate_ssa_name_ptr_info):
Clear alignment info copied from DR_PTR_INFO.
Hongyu Wang [Fri, 16 Jul 2021 02:01:17 +0000 (10:01 +0800)]
AVX512FP16: Enable vec_cmpmn/vcondmn expanders for HF modes.
gcc/ChangeLog:
* config/i386/i386-expand.c (ix86_use_mask_cmp_p): Enable
HFmode mask_cmp.
* config/i386/sse.md (sseintvecmodelower): Add HF vector modes.
(<avx512>_store<mode>_mask): Extend to support HF vector modes.
(vec_cmp<mode><avx512fmaskmodelower>): Likewise.
(vcond_mask_<mode><avx512fmaskmodelower>): Likewise.
(vcond<mode><mode>): New expander.
(vcond<mode><sseintvecmodelower>): Likewise.
(vcond<sseintvecmodelower><mode>): Likewise.
(vcondu<mode><sseintvecmodelower>): Likewise.
gcc/testsuite/ChangeLog:
* g++.target/i386/avx512fp16-vcondmn-vec.C: New test.
* g++.target/i386/avx512fp16-vcondmn-minmax.C: Ditto.
* gcc.target/i386/avx512fp16-vcondmn-loop-1.c: Ditto.
* gcc.target/i386/avx512fp16-vcondmn-loop-2.c: Ditto.
* gcc.target/i386/avx512fp16-vec_cmpmn.c: Ditto.
Hongyu Wang [Mon, 12 Jul 2021 06:02:10 +0000 (14:02 +0800)]
AVX512FP16: add truncmn2/extendmn2 expanders
gcc/ChangeLog:
* config/i386/sse.md (extend<ssePHmodelower><mode>2):
New expander.
(extendv4hf<mode>2): Likewise.
(extendv2hfv2df2): Likewise.
(trunc<mode><ssePHmodelower>2): Likewise.
(avx512fp16_vcvt<castmode>2ph_<mode>): Rename to ...
(trunc<mode>v4hf2): ... this, and drop constraints.
(avx512fp16_vcvtpd2ph_v2df): Rename to ...
(truncv2dfv2hf2): ... this, and likewise.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-trunc-extendvnhf.c: New test.
Hongyu Wang [Mon, 12 Jul 2021 01:45:33 +0000 (09:45 +0800)]
AVX512FP16: Add float(uns)?mn2 expander
gcc/ChangeLog:
* config/i386/sse.md (float<floatunssuffix><mode><ssePHmodelower>2):
New expander.
(avx512fp16_vcvt<floatsuffix><sseintconvert>2ph_<mode>):
Rename to ...
(float<floatunssuffix><mode>v4hf2): ... this, and drop constraints.
(avx512fp16_vcvt<floatsuffix>qq2ph_v2di): Rename to ...
(float<floatunssuffix>v2div2hf2): ... this, and likewise.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-floatvnhf.c: New test.
Hongyu Wang [Thu, 1 Jul 2021 05:17:32 +0000 (13:17 +0800)]
AVX512FP16: Add fix(uns)?_truncmn2 for HF scalar and vector modes
NB: 64bit/32bit vectorize for HFmode is not supported for now, will
adjust this patch when V2HF/V4HF operations supported.
gcc/ChangeLog:
* config/i386/i386.md (fix<fixunssuffix>_trunchf<mode>2): New expander.
(fixuns_trunchfhi2): Likewise.
(*fixuns_trunchfsi2zext): New define_insn.
* config/i386/sse.md (ssePHmodelower): New mode_attr.
(fix<fixunssuffix>_trunc<ssePHmodelower><mode>2):
New expander for same element vector fix_truncate.
(fix<fixunssuffix>_trunc<ssePHmodelower><mode>2):
Likewise for V4HF to V4SI/V4DI fix_truncate.
(fix<fixunssuffix>_truncv2hfv2di2):
Likeise for V2HF to V2DI fix_truncate.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-trunchf.c: New test.
* gcc.target/i386/avx512fp16-truncvnhf.c: Ditto.
Hongyu Wang [Sat, 18 Sep 2021 05:56:37 +0000 (13:56 +0800)]
AVX512FP16: Add expander for smin/maxhf3.
gcc/ChangeLog:
* config/i386/i386.md (<code>hf3): New expander.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-builtin-minmax-1.c: New test.
liuhongt [Tue, 14 Jul 2020 06:45:32 +0000 (14:45 +0800)]
AVX512FP16: Add expander for fmahf4
gcc/ChangeLog:
* config/i386/sse.md (FMAMODEM): extend to handle FP16.
(VFH_SF_AVX512VL): Extend to handle HFmode.
(VF_SF_AVX512VL): Deleted.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-fma-1.c: New test.
* gcc.target/i386/avx512fp16vl-fma-1.c: New test.
* gcc.target/i386/avx512fp16vl-fma-vectorize-1.c: New test.
liuhongt [Wed, 22 Sep 2021 07:03:36 +0000 (15:03 +0800)]
AVX512FP16: Add expander for rint/nearbyinthf2.
gcc/ChangeLog:
* config/i386/i386.md (rinthf2): New expander.
(nearbyinthf2): New expander.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-builtin-round-1.c: Add new testcase.
Jakub Jelinek [Thu, 23 Sep 2021 08:07:49 +0000 (10:07 +0200)]
openmp: Diagnose omp::directive attribute without balanced token argument [PR102413]
If omp::directive attribute argument starting with the opening ( is not a balanced
token sequence, then cp_parser_skip_balanced_tokens (parser, 1) returns 1,
but the code was subtracting 2 from it and iterating until it was 0, so for the
non-balanced case it iterated from (size_t) -1 down to 0.
The following patch just diagnoses that as an error.
2021-09-23 Jakub Jelinek <jakub@redhat.com>
PR c++/102413
* parser.c (cp_parser_omp_directive_args): Diagnose if omp::directive
is not followed by a balanced token sequence starting with open paren.
* g++.dg/gomp/attrs-14.C: New test.
Aldy Hernandez [Wed, 22 Sep 2021 16:10:43 +0000 (18:10 +0200)]
Overhaul jump thread state in forward threader.
I've been pulling state from across the forward jump threader into the
jt_state class, but it it still didn't feel right. The ultimate goal
was to keep track of candidate threading paths so that the simplifier
could simplify statements with the path as context. This patch completes
the transition, while cleaning up a lot of things in the process.
I've revamped both state and the simplifier such that a base state class
contains only the blocks as they're registered, and any pass specific
knowledge is where it belongs... in the pass. This allows VRP to keep
its const and copies business, and DOM to keep this as well as its evrp
client. This makes the threader cleaner, as it will now have no knowledge
of either const/copies or evrp.
This also paves the wave for the upcoming hybrid threader, which will
just derive the state class and provide almost nothing, since the ranger
doesn't need to register any equivalences or ranges as it folds.
There is some code duplication in the simplifier, since both the DOM and
VRP clients use a vr_values based simplifier, but this is temporary as
the VRP client is about to be replaced with a hybrid ranger.
For a better view of what this patch achieves, here are the base
classes:
class jt_state
{
public:
virtual ~jt_state () { }
virtual void push (edge);
virtual void pop ();
virtual void register_equiv (tree dest, tree src, bool update_range =
false);
virtual void register_equivs_edge (edge e);
virtual void register_equivs_stmt (gimple *, basic_block,
class jt_simplifier *);
virtual void record_ranges_from_stmt (gimple *stmt, bool temporary);
void get_path (vec<basic_block> &);
void append_path (basic_block);
void dump (FILE *);
void debug ();
private:
auto_vec<basic_block> m_blocks;
};
class jt_simplifier
{
public:
virtual ~jt_simplifier () { }
virtual tree simplify (gimple *, gimple *, basic_block, jt_state *) =
0;
};
There are no functional changes.
gcc/ChangeLog:
* tree-ssa-dom.c (class dom_jump_threader_simplifier): Rename...
(class dom_jt_state): ...this and provide virtual overrides.
(dom_jt_state::register_equiv): New.
(class dom_jt_simplifier): Rename from
dom_jump_threader_simplifier.
(dom_jump_threader_simplifier::simplify): Rename...
(dom_jt_simplifier::simplify): ...to this.
(pass_dominator::execute): Use dom_jt_simplifier and
dom_jt_state.
* tree-ssa-threadedge.c (jump_threader::jump_threader):
Clean-up.
(jt_state::register_equivs_stmt): Abstract out...
(jump_threader::record_temporary_equivalences_from_stmts_at_dest):
...from here.
(jump_threader::thread_around_empty_blocks): Update state.
(jump_threader::thread_through_normal_block): Same.
(jt_state::jt_state): Remove.
(jt_state::push): Remove pass specific bits. Keep block vector
updated.
(jt_state::append_path): New.
(jt_state::pop): Remove pass specific bits.
(jt_state::register_equiv): Same.
(jt_state::record_ranges_from_stmt): Same.
(jt_state::register_equivs_on_edge): Same. Rename...
(jt_state::register_equivs_edge): ...to this.
(jt_state::dump): New.
(jt_state::debug): New.
(jump_threader_simplifier::simplify): Remove.
(jt_state::get_path): New.
* tree-ssa-threadedge.h (class jt_simplifier): Make into a base
class. Expose common functionality as virtual methods.
(class jump_threader_simplifier): Same. Rename...
(class jt_simplifier): ...to this.
* tree-vrp.c (class vrp_jump_threader_simplifier): Rename...
(class vrp_jt_simplifier): ...to this. Provide pass specific
overrides.
(class vrp_jt_state): New.
(vrp_jump_threader_simplifier::simplify): Rename...
(vrp_jt_simplifier::simplify): ...to this. Inline code from
what used to be the base class.
(vrp_jump_threader::vrp_jump_threader): Use vrp_jt_state and
vrp_jt_simplifier.
GCC Administrator [Thu, 23 Sep 2021 00:16:29 +0000 (00:16 +0000)]
Daily bump.
Sandra Loosemore [Wed, 22 Sep 2021 14:49:17 +0000 (07:49 -0700)]
Fortran: diagnostic for argument w/type parameters for assumed-type dummy
2021-09-22 Sandra Loosemore <sandra@codesourcery.com>
PR fortran/101319
gcc/fortran/
* interface.c (gfc_compare_actual_formal): Extend existing
assumed-type diagnostic to also check for argument with type
parameters.
gcc/testsuite/
* gfortran.dg/c-interop/assumed-type-dummy.f90: Remove xfail.
Sandra Loosemore [Mon, 20 Sep 2021 00:32:03 +0000 (17:32 -0700)]
Fortran: Fixes for F2018 C838 (PR fortran/101334)
The compiler was failing to diagnose the error required by F2018 C838
when passing an assumed-rank array argument to a non-assumed-rank dummy.
It was also incorrectly giving an error for calls to the 2-argument form
of the ASSOCIATED intrinsic, which is supposed to be permitted by C838.
2021-09-19 Sandra Loosemore <sandra@codesourcery.com>
PR fortran/101334
gcc/fortran/
* check.c (gfc_check_associated): Allow an assumed-rank
array for the pointer argument.
* interface.c (compare_parameter): Also give rank mismatch
error on assumed-rank array.
gcc/testsuite/
* gfortran.dg/c-interop/c535b-2.f90: Remove xfails.
* gfortran.dg/c-interop/c535b-3.f90: Likewise.
Sandra Loosemore [Mon, 20 Sep 2021 00:23:58 +0000 (17:23 -0700)]
Fortran: Fix testcases that violate C838, + revealed ICE
The three test cases fixed in this patch violated F2018 C838, which
only allows passing an assumed-rank argument to an assumed-rank dummy.
Wrapping the call in "select rank" revealed a null pointer dereference
which is fixed by guarding the use of the result of
GFC_DECL_SAVED_DESCRIPTOR similar to what is already done elsewhere.
2021-09-19 Sandra Loosemore <sandra@codesourcery.com>
gcc/fortran/
* trans-stmt.c (trans_associate_var): Check that result of
GFC_DECL_SAVED_DESCRIPTOR is not null before using it.
gcc/testsuite/
* gfortran.dg/assumed_rank_18.f90 (g): Wrap call to h in
select rank.
* gfortran.dg/assumed_type_10.f90 (test_array): Likewise for
call to test_lib.
* gfortran.dg/assumed_type_11.f90 (test_array): Likewise.
Tobias Burnus [Wed, 22 Sep 2021 18:58:35 +0000 (20:58 +0200)]
Fortran: Improve -Wmissing-include-dirs warnings [PR55534]
It turned out that enabling the -Wmissing-include-dirs for libcpp did output
too many warnings – at least as run with -B and similar options during the
GCC build and warning for internal include dirs like finclude, unlikely of
relevance to for a real-world user.
This patch now only warns for -I and -J by default but permits to get the
full warnings including libcpp ones with -Wmissing-include-dirs. It
additionally documents this in the manual.
With that change, the -Wno-missing-include-dirs could be removed
from libgfortran's configure and libgomp's testsuite always cflags.
This reverts those bits of the previous
commit r12-3722-g417ea5c02cef7f000e66d1af22b066c2c1cda047
Additionally, it turned out that all call to load_file called exit
explicitly - except for the main file via gfc_init -> gfc_new_file. The
latter also output a file not existing fatal error, such that two errors
where printed. Now exit is called in line with the other users of
load_file.
Finally, when compileing with "nonexisting/file.f90", first a warning that
"nonexisting" does not exist as include path was printed before the file
not found error was printed. Now the directory in which the physical file
is located is added silently, relying on the file-not-found diagnostic for
those.
PR fortran/55534
gcc/ChangeLog:
* doc/invoke.texi (-Wno-missing-include-dirs.): Document Fortran
behavior.
gcc/fortran/ChangeLog:
* cpp.c (gfc_cpp_register_include_paths, gfc_cpp_post_options):
Add new bool verbose_missing_dir_warn argument.
* cpp.h (gfc_cpp_post_options): Update prototype.
* f95-lang.c (gfc_init): Remove duplicated file-not found diag.
* gfortran.h (gfc_check_include_dirs): Takes bool
verbose_missing_dir_warn arg.
(gfc_new_file): Returns now void.
* options.c (gfc_post_options): Update to warn for -I and -J,
only, by default but for all when user requested.
* scanner.c (gfc_do_check_include_dir):
(gfc_do_check_include_dirs, gfc_check_include_dirs): Take bool
verbose warn arg and update to avoid printing the same message
twice or never.
(load_file): Fix indent.
(gfc_new_file): Return void and exit when load_file failed
as all other load_file users do.
libgfortran/ChangeLog:
* configure.ac (AM_FCFLAGS): Revert r12-3722 by removing
-Wno-missing-include-dirs.
* configure: Regenerate.
libgomp/ChangeLog:
* testsuite/libgomp.fortran/fortran.exp (ALWAYS_CFLAGS): Revert
r12-3722 by removing -Wno-missing-include-dirs.
* testsuite/libgomp.oacc-fortran/fortran.exp (ALWAYS_CFLAGS): Likewise.
gcc/testsuite/ChangeLog:
* gfortran.dg/include_14.f90: Add -J testcase and update dg-output.
* gfortran.dg/include_15.f90: Likewise.
* gfortran.dg/include_16.f90: Likewise.
* gfortran.dg/include_17.f90: Likewise.
* gfortran.dg/include_18.f90: Likewise.
* gfortran.dg/include_19.f90: Likewise.
Roger Sayle [Wed, 22 Sep 2021 18:17:49 +0000 (19:17 +0100)]
More NEGATE_EXPR folding in match.pd
As observed by Jakub in comment #2 of PR 98865, the expression -(a>>63)
is optimized in GENERIC but not in GIMPLE. Investigating further it
turns out that this is one of a few transformations performed by
fold_negate_expr in fold-const.c that aren't yet performed by match.pd.
This patch moves/duplicates them there, and should be relatively safe
as these transformations are already performed by the compiler, but
just in different passes.
This revised patch adds a Boolean simplify argument to tree-ssa-sccvn.c's
vn_nary_build_or_lookup_1 to control whether simplification should be
performed before value numbering, updating the callers, but then
avoiding simplification when constructing/value-numbering NEGATE_EXPR.
This avoids the regression of gcc.dg/tree-ssa/ssa-free-88.c, and enables
the new test case(s) to pass.
2021-09-22 Roger Sayle <roger@nextmovesoftware.com>
Richard Biener <rguenther@suse.de>
gcc/ChangeLog
* match.pd (negation simplifications): Implement some negation
folding transformations from fold-const.c's fold_negate_expr.
* tree-ssa-sccvn.c (vn_nary_build_or_lookup_1): Add a SIMPLIFY
argument, to control whether the op should be simplified prior
to looking up/assigning a value number.
(vn_nary_build_or_lookup): Update call to vn_nary_build_or_lookup_1.
(vn_nary_simplify): Likewise.
(visit_nary_op): Likewise, but when constructing a NEGATE_EXPR
now call vn_nary_build_or_lookup_1 disabling simplification.
gcc/testsuite/ChangeLog
* gcc.dg/fold-negate-1.c: New test case.
H.J. Lu [Mon, 20 Sep 2021 14:48:05 +0000 (07:48 -0700)]
x86: Clean up gcc.target/i386/auto-init-* tests
1. Replace ia32 with { ! lp64 } to enable ILP32 tests for -mx32.
2. Replace lp64 with { ! ia32 } to enable x86-64 ISA tests for -mx32.
3. For auto-init-3.c, add -msse and -mfpmath=387 for ia32.
* gcc.target/i386/auto-init-2.c: Replace ia32 with { ! lp64 }.
* gcc.target/i386/auto-init-3.c (dg-options): Add -msse.
(dg-additional-options): Add -mfpmath=387 for ia32.
Replace lp64 with { ! ia32 }. Add a space after ia32.
* gcc.target/i386/auto-init-4.c: Replace lp64 with { ! ia32 }.
* gcc.target/i386/auto-init-5.c: Likewise.
* gcc.target/i386/auto-init-padding-3.c: Likewise.
* gcc.target/i386/auto-init-padding-7.c: Likewise.
* gcc.target/i386/auto-init-padding-8.c: Likewise.
* gcc.target/i386/auto-init-padding-9.c: Likewise.
Patrick Palka [Wed, 22 Sep 2021 15:16:53 +0000 (11:16 -0400)]
c++: concept-ids and value-dependence [PR102412]
The problem here is that uses_template_parms returns true for all
concept-ids (even those with non-dependent arguments), so when a concept-id
is used as a default template argument then during deduction the default
argument is considered dependent even after substituting into it, which
leads to deduction failure (from type_unification_real).
This patch fixes this by implementing the resolution of CWG 2446 which
says a concept-id is dependent only if its arguments are.
DR 2446
PR c++/102412
gcc/cp/ChangeLog:
* constexpr.c (cxx_eval_constant_expression)
<case TEMPLATE_ID_EXPR>: Check value_dependent_expression_p
instead of processing_template_decl.
* pt.c (value_dependent_expression_p) <case TEMPLATE_ID_EXPR>:
Return true only if any_dependent_template_arguments_p.
(instantiation_dependent_r) <case CALL_EXPR>: Remove this case.
<case TEMPLATE_ID_EXPR>: Likewise.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-nondep2.C: New test.
* g++.dg/cpp2a/concepts-nondep3.C: New test.
Yannick Moy [Tue, 27 Jul 2021 13:57:04 +0000 (15:57 +0200)]
[Ada] Simplify contract of Ada.Strings.Fixed.Trim for proof
gcc/ada/
* libgnat/a-strfix.ads (Trim): Simplify contracts.
* libgnat/a-strfix.adb (Trim): Remove white space.
Piotr Trojanek [Mon, 26 Jul 2021 21:16:13 +0000 (23:16 +0200)]
[Ada] Reuse routines for detecting attributes Old and Result
gcc/ada/
* exp_ch4.adb (Expand_N_Op_Eq): Reuse Is_Attribute_Result.
* exp_prag.adb (Expand_Attributes): Reuse Is_Attribute_Old.
Yannick Moy [Tue, 27 Jul 2021 10:20:41 +0000 (12:20 +0200)]
[Ada] Spurious error on deferred constant with predicate
gcc/ada/
* sem_ch3.adb (Analyze_Object_Declaration): Do not insert a
predicate check after a deferred constant declaration.
Bob Duff [Mon, 26 Jul 2021 19:26:28 +0000 (15:26 -0400)]
[Ada] Fix conformance errors and erroneous code
gcc/ada/
* contracts.adb, einfo-utils.adb, einfo-utils.ads, exp_ch7.adb,
exp_ch9.adb, exp_disp.adb, exp_prag.adb, exp_smem.adb,
exp_util.adb, freeze.adb, sem_aggr.adb, sem_attr.adb,
sem_ch8.adb, sem_prag.ads, sem_util.adb, sem_util.ads: Fix
conformance errors.
* errout.adb, erroutc.adb: Remove pragmas Suppress.
* err_vars.ads: Initialize variables that were previously being
read uninitialized.
Yannick Moy [Mon, 26 Jul 2021 14:56:27 +0000 (16:56 +0200)]
[Ada] Clarify parts of Ada.Strings.Unbounded in SPARK or not
gcc/ada/
* libgnat/a-strunb.ads: Mark package in SPARK with private part
not in SPARK.
(Free): Mark not in SPARK.
Arnaud Charlet [Mon, 26 Jul 2021 10:08:46 +0000 (06:08 -0400)]
[Ada] Update status of some attributes
gcc/ada/
* snames.ads-tmpl: Update status of some attributes.
Doug Rupp [Fri, 23 Jul 2021 19:00:04 +0000 (12:00 -0700)]
[Ada] VxWorks inconsistent use of return type (STATUS)
gcc/ada/
* libgnarl/s-interr__vxworks.adb (Interfaces.C): Remove as
unused.
(System.VxWorks.Ext): Import.
(System.VxWorks.Ext.STATUS): use type.
(STATUS): New subtype.
(OK): New constant.
(Interrupt_Connector): Return STATUS type vice int.
(Interrupt_Connect, Notify_Interrupt, Unbind_Handler,
Interrupt_Server_Task): Rename Status to Result. Assert Result =
OK.
* libgnarl/s-osinte__vxworks.adb (To_Clock_Ticks): Define constant
IERR, and return it vice ERROR.
(Binary_Semaphore_Delete): Return STATUS type vice int.
(Binary_Semaphore_Obtain): Likewise.
(Binary_Semaphore_Release): Likewise.
(Binary_Semaphore_Flush): Likewise.
* libgnarl/s-osinte__vxworks.ads (SVE): Renaming of
System.VxWorks.Ext.
(STATUS): Use SVE in declaration of subtype.
(BOOL): Likewise.
(vx_freq_t): Likewise.
(t_id): Likewise.
(gitpid): Use SVE in renaming of subprogram
(Task_Stop): Likewise.
(Task_Cont): Likewise.
(Int_Lock): Likewise.
(Int_Unlock): Likewise.
(Set_Time_Slice): Likewise.
(semDelete): Likewise.
(taskCpuAffinitySet): Likewise.
(taskMaskAffinitySet): Likewise.
(sigset_t): Use SVE in declaration of type.
(OK): Remove as unused.
(ERROR): Likewise.
(taskOptionsGet): return STATUS vice int.
(taskSuspend): Likewise.
(taskResume): Likewise.
(taskDelay): Likewise.
(taskVarAdd): Likewise.
(taskVarDelete): Likewise.
(taskVarSet): Likewise.
(tlkKeyCreate): Likewise.
(taskPrioritySet): Likewise.
(semGive): Likewise.
(semTake): Likewise.
(Binary_Semaphore_Delete): Likewise.
(Binary_Semaphore_Obtain): Likewise.
(Binary_Semaphore_Release): Likewise.
(Binary_Semaphore_Flush): Likewise.
(Interrupt_Connect): Likewise.
* libgnarl/s-taprop__vxworks.adb
(System.VxWorks.Ext.STATUS): use type.
(int): Syntactically align subtype.
(STATUS): New subtype.
(OK): New constant.
(Finalize_Lock): Check STATUS vice int. Assert OK.
(Finalize_Lock): Likewise.
(Write_Lock): Likewise.
(Write_Lock): Likewise.
(Write_Lock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Unlock): Likewise.
(Sleep): Likewise.
(Sleep): Likewise.
(Sleep): Likewise.
(Timed_Sleep): Likewise and test Result.
(Timed_Delay): Likewise and test Result.
(Wakeup): Likewise.
(Yield): Likewise.
(Finalize_TCB): Likewise.
(Suspend_Until_True): Check OK.
(Stop_All_Tasks): Declare Dummy STATUS vice in. Check OK.
(Is_Task_Context): Use OSI renaming.
(Initialize): Use STATUS vice int.
* libgnarl/s-vxwext.adb
(IERR): Renamed from ERROR.
(taskCpuAffinitySet): Return IERR (int).
(taskMaskAffinitySet): Likewise.
* libgnarl/s-vxwext.ads
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
* libgnarl/s-vxwext__kernel-smp.adb
(IERR): Renamed from ERROR.
(Int_Lock): Return IERR.
(semDelete): Return STATUS.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
* libgnarl/s-vxwext__kernel.adb
(IERR): Renamed from ERROR.
(semDelete): Return STATUS.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(taskCpuAffinitySet): Return IERR (int)
(taskMaskAffinitySet): Likewise.
* libgnarl/s-vxwext__kernel.ads
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
(Interrupt_Connect): Return STATUS
(semDelete): Likewise.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(Set_Time_Slice): Likewise.
* libgnarl/s-vxwext__rtp-smp.adb
(IERR): Renamed from ERROR.
(Int_Lock): return IERR constant vice ERROR.
(Interrupt_Connect): Return STATUS.
(semDelete): Likewise.
(Set_Time_Slice): Likewise.
* libgnarl/s-vxwext__rtp.adb
(IERR): Renamed from ERROR.
(Int_Lock): return IERR constant vice ERROR.
(Int_Unlock): Return STATUS.
(semDelete): Likewise.
(Set_Time_Slice): Likewise.
(taskCpuAffinitySet): Return IERR (int)
(taskMaskAffinitySet): Likewise.
* libgnarl/s-vxwext__rtp.ads
(STATUS): New subtype.
(OK): New STATUS constant.
(ERROR): Likewise.
(Interrupt_Connect): Return STATUS
(semDelete): Likewise.
(Task_Cont): Likewise.
(Task_Stop): Likewise.
(Set_Time_Slice): Likewise.
Arnaud Charlet [Mon, 26 Jul 2021 08:16:06 +0000 (04:16 -0400)]
[Ada] More flexibility in preprocessor
gcc/ada/
* prep.adb (Preprocess): Allow for more flexibility when
Relaxed_RM_Semantics is set.
Pierre-Alexandre Bazin [Fri, 2 Jul 2021 13:43:44 +0000 (15:43 +0200)]
[Ada] Contracts written for the Ada.Strings.Bounded library
gcc/ada/
* libgnat/a-strbou.adb: Turn SPARK_Mode on.
* libgnat/a-strbou.ads: Write contracts.
* libgnat/a-strfix.ads (Index): Fix grammar error in a comment.
* libgnat/a-strsea.ads (Index): Likewise.
* libgnat/a-strsup.adb: Rewrite the body to take into account
the new definition of Super_String using Relaxed_Initialization
and a predicate.
(Super_Replicate, Super_Translate, Times): Added loop
invariants, and ghost lemmas for Super_Replicate and Times.
(Super_Trim): Rewrite the body using search functions to
determine the cutting points.
(Super_Element, Super_Length, Super_Slice, Super_To_String):
Remove (now written as expression functions in a-strsup.ads).
* libgnat/a-strsup.ads: Added contracts.
(Super_Element, Super_Length, Super_Slice, Super_To_String):
Rewrite as expression functions.
Yannick Moy [Fri, 23 Jul 2021 08:52:51 +0000 (10:52 +0200)]
[Ada] Add adequate guard before calling First_Rep_Item
gcc/ada/
* sem_ch13.adb (Build_Predicate_Functions): Add guard.
Doug Rupp [Mon, 12 Jul 2021 20:21:45 +0000 (13:21 -0700)]
[Ada] VxWorks inconsistent use of return type (BOOL)
gcc/ada/
* libgnarl/s-vxwext.ads (BOOL): New int type.
(Interrupt_Context): Change return type to BOOL.
* libgnarl/s-vxwext__kernel.ads: Likewise.
* libgnarl/s-vxwext__rtp-smp.adb: Likewise.
* libgnarl/s-vxwext__rtp.adb: Likewise.
* libgnarl/s-vxwext__rtp.ads: Likewise.
* libgnarl/s-osinte__vxworks.adb (Interrupt_Context): Change
return type to BOOL.
* libgnarl/s-osinte__vxworks.ads (BOOL) New subtype.
(taskIsSuspended): Change return type to BOOL.
(Interrupt_Context): Change return type to BOOL. Adjust comments
accordingly.
* libgnarl/s-taprop__vxworks.adb (System.VxWorks.Ext.BOOL):
use type.
(Is_Task_Context): Test Interrupt_Context against 0.
* libgnat/i-vxwork.ads (BOOL): New int.
(intContext): Change return type to BOOL. Adjust comments.
* libgnat/i-vxwork__x86.ads: Likewise.
Piotr Trojanek [Thu, 22 Jul 2021 13:33:16 +0000 (15:33 +0200)]
[Ada] Add Package_Body helper routine to be used in GNATprove
gcc/ada/
* sem_aux.adb, sem_aux.ads (Package_Body): Moved from GNATprove.
* sem_elab.adb (Spec_And_Body_From_Entity): Refine type of parameter.
Arnaud Charlet [Thu, 22 Jul 2021 07:27:41 +0000 (03:27 -0400)]
[Ada] Minor doc improvement
gcc/ada/
* doc/gnat_ugn/platform_specific_information.rst: Improve doc
on permission and containers.
* gnat_ugn.texi: Regenerate.
Yannick Moy [Tue, 20 Jul 2021 11:59:19 +0000 (13:59 +0200)]
[Ada] Fix infinite loop in compilation of illegal code
gcc/ada/
* atree.adb (Rewrite): Fix parent node of shared aspects.
* atree.ads (Rewrite): Add ??? comment on incorrect
documentation.
* einfo-utils.adb (Known_Esize): Fix logic.
* sem_ch13.adb (Alignment_Check_For_Size_Change,
Analyze_Attribute_Definition_Clause): Protect against unset
Size.
Yannick Moy [Fri, 16 Jul 2021 14:35:19 +0000 (16:35 +0200)]
[Ada] More precise analysis of function renamings in GNATprove
gcc/ada/
* freeze.adb (Build_Renamed_Body): Special case for GNATprove.
* sem_ch6.adb (Analyze_Expression_Function): Remove useless test
for a node to come from source, which becomes harmful otherwise.
Justin Squirek [Mon, 19 Jul 2021 19:13:49 +0000 (15:13 -0400)]
[Ada] Removal of technical debt
gcc/ada/
* ali.adb, ali.ads (Scan_ALI): Remove use of deprecated
parameter Ignore_ED, and all specification for Lower in call to
Get_File_Name.
* ali-util.adb (Read_Withed_ALIs): Modify call to Scan_ALI.
* clean.adb (Clean_Executables): Likewise.
* gnatbind.adb (Add_Artificial_ALI_File, Executable section):
Likewise.
* gnatlink.adb (Executable section): Likewise.
* gnatls.adb (Executable section): Likewise.
* make.adb (Check, Wait_For_Available_Slot): Likewise.
* aspects.ads: Add Aspect_No_Controlled_Parts to
Nonoverridable_Aspect_Id
* opt.ads: Remove function pointers used as a workaround for
ASIS.
* osint-c.adb (Executable section): Remove setting of function
pointer workarounds needed for ASIS.
* osint.adb (Read_Default_Search_Dirs): Correct behavior to
detect EOL characters.
* par_sco.adb (Output_Header): Remove comment regarding use of
First_Sloc.
(Traverse_Sync_Definition): Renamed to
Traverse_Protected_Or_Task_Definition.
* pprint.adb (Interal_List_Name): Add description about purpose,
and refactor conditional statement.
(Prepend): Removed.
* repinfo.adb (List_Rep_Info, Write_Info_Line): Remove use of
subprogram pointer.
* scng.adb (Scan): Remove CODEFIX question, and minor comment
change.
* sem_attr.adb (Analyze_Image_Attribute): Remove special
processing for 'Img.
* sem_ch6.adb (Check_Untagged_Equality): Add RM reference.
(FCE): Add comment describing behavior.
(Is_Non_Overriding_Operation): Minor comment formatting change.
* sem_type.adb (Is_Actual_Subprogram): Add comment about
Comes_From_Source test.
(Matching_Types): Describe non-matching cases.
* sem_util.adb (Is_Confirming): Add stub case for
No_Controlled_Parts.
Yannick Moy [Thu, 15 Jul 2021 12:31:29 +0000 (14:31 +0200)]
[Ada] Fix access to predicated parent in Itype
gcc/ada/
* sem_ch13.adb (Build_Predicate_Functions): Access
Predicated_Parent only on subtypes.
Arnaud Charlet [Thu, 15 Jul 2021 17:31:11 +0000 (17:31 +0000)]
[Ada] Allow more cases of import with Relaxed_RM_Semantics
gcc/ada/
* sem_prag.adb (Process_Import_Or_Interface): Relax error when
Relaxed_RM_Semantics.
Steve Baird [Wed, 14 Jul 2021 23:55:28 +0000 (16:55 -0700)]
[Ada] Improve performance for case-insensitive regular expressions
gcc/ada/
* libgnat/s-regpat.adb (Match): Handle the case where Self.First
is not NUL (so we know the first character we are looking for),
but case-insensitive matching has
been specified.
(Optimize): In the case of an EXACTF Op, set Self.First as is
done in the EXACT case, except with the addition of a call to
Lower_Case.
Eric Botcazou [Thu, 15 Jul 2021 15:55:19 +0000 (17:55 +0200)]
[Ada] Remove System.Img_Enum_New unit
gcc/ada/
* libgnat/s-imenne.ads, libgnat/s-imenne.adb: Delete.
* gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Remove s-imenne.o.
(GNATBIND_OBJS): Likewise.
Yannick Moy [Thu, 15 Jul 2021 08:40:05 +0000 (10:40 +0200)]
[Ada] Fix obsolete comments/name referring to girder discriminants
gcc/ada/
* einfo.ads: Fix comments.
* exp_aggr.adb: Fix variable name.
* exp_util.adb: Fix comments.
* sem_ch13.adb: Fix comments.
* sem_ch3.adb: Fix comments and variable name.
Doug Rupp [Mon, 12 Jul 2021 18:47:53 +0000 (11:47 -0700)]
[Ada] VxWorks inconsistent use of return type (Int_Unlock)
gcc/ada/
* libgnarl/s-osinte__vxworks.ads: Make procedure vice function.
* libgnarl/s-vxwext.ads: Likewise.
* libgnarl/s-vxwext__kernel-smp.adb: Likewise.
* libgnarl/s-vxwext__kernel.adb: Likewise.
* libgnarl/s-vxwext__kernel.ads: Likewise.
* libgnarl/s-vxwext__rtp-smp.adb: Likewise.
* libgnarl/s-vxwext__rtp.adb: Likewise.
* libgnarl/s-vxwext__rtp.ads: Likewise.
* libgnarl/s-taprop__vxworks.adb (Stop_All_Tasks): Call
Int_Unlock as a procedure.
Doug Rupp [Mon, 12 Jul 2021 17:52:32 +0000 (10:52 -0700)]
[Ada] VxWorks inconsistent use of return type (vx_freq_t)
gcc/ada/
* libgnarl/s-osinte__vxworks.ads (SVE): New package renaming
(vx_freq_t): New subtype.
(sysClkRateGet): Return vx_freq_t.
* libgnarl/s-vxwext.ads (vx_freq_t): New type.
* libgnarl/s-vxwext__kernel.ads: Likewise.
* libgnarl/s-vxwext__rtp.ads: Likewise.
Ghjuvan Lacambre [Thu, 15 Jul 2021 09:11:00 +0000 (11:11 +0200)]
[Ada] Replace use of 'Image with use of Error_Msg_Uint
gcc/ada/
* sem_case.adb (Composite_Case_Ops): Replace 'Image with
Error_Msg_Uint.
Eric Botcazou [Thu, 15 Jul 2021 09:18:02 +0000 (11:18 +0200)]
[Ada] Generate temporary for if-expression with -fpreserve-control-flow
gcc/ada/
* exp_ch4.adb (Expand_N_If_Expression): Generate an intermediate
temporary when the expression is a condition in an outer decision
and control-flow optimizations are suppressed.
Steve Baird [Fri, 9 Jul 2021 19:04:09 +0000 (12:04 -0700)]
[Ada] Add -gnatX support for casing on array values
gcc/ada/
* exp_ch5.adb (Expand_General_Case_Statement.Pattern_Match): Add
new function Indexed_Element to handle array element
comparisons. Handle case choices that are array aggregates,
string literals, or names denoting constants.
* sem_case.adb (Composite_Case_Ops.Array_Case_Ops): New package
providing utilities needed for casing on arrays.
(Composite_Case_Ops.Choice_Analysis): If necessary, include
array length as a "component" (like a discriminant) when
traversing components. We do not (yet) partition choice analysis
to deal with unequal length choices separately. Instead, we
embed everything in the minimum-dimensionality Cartesian product
space needed to handle all choices properly; this is determined
by the length of the longest choice pattern.
(Composite_Case_Ops.Choice_Analysis.Traverse_Discrete_Parts):
Include length as a "component" in the traversal if necessary.
(Composite_Case_Ops.Choice_Analysis.Parse_Choice.Traverse_Choice):
Add support for case choices that are string literals or names
denoting constants.
(Composite_Case_Ops.Choice_Analysis): Include length as a
"component" in the analysis if necessary.
(Check_Choices.Check_Case_Pattern_Choices.Ops.Value_Sets.Value_Index_Count):
Improve error message when capacity exceeded.
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
documentation to reflect current implementation status.
* gnat_rm.texi: Regenerate.
Eric Botcazou [Tue, 13 Jul 2021 09:23:38 +0000 (11:23 +0200)]
[Ada] Fix imprecise wording for error on scalar storage order
gcc/ada/
* freeze.adb (Check_Component_Storage_Order): Give a specific error
message for non-byte-aligned component in the packed case. Replace
"composite" with "record" in both cases.
Arnaud Charlet [Mon, 12 Jul 2021 10:14:15 +0000 (06:14 -0400)]
[Ada] Make Ada.Task_Initialization compatible with No_Elaboration_Code_All
gcc/ada/
* libgnarl/a-tasini.ads, libgnarl/a-tasini.adb: Make compatible
with No_Elaboration_Code_All.
* libgnarl/s-taskin.ads, libgnarl/s-tassta.adb: Adjust
accordingly.
Arnaud Charlet [Mon, 12 Jul 2021 09:33:26 +0000 (05:33 -0400)]
[Ada] Change message format on missing return
gcc/ada/
* sem_ch6.adb (Check_Returns): Change message on missing return.
Arnaud Charlet [Mon, 12 Jul 2021 10:33:29 +0000 (06:33 -0400)]
[Ada] Mark gnatfind and gnatxref obsolete
gcc/ada/
* gnatfind.adb, gnatxref.adb: Mark these tools as obsolete
before removing them completely.
Jiufu Guo [Wed, 22 Sep 2021 05:20:29 +0000 (13:20 +0800)]
Set bound/cmp/control for until wrap loop.
In patch r12-3136, niter->control, niter->bound and niter->cmp are
derived from number_of_iterations_lt. While for 'until wrap condition',
the calculation in number_of_iterations_lt is not align the requirements
on the define of them and requirements in determine_exit_conditions.
This patch calculate niter->control, niter->bound and niter->cmp in
number_of_iterations_until_wrap.
gcc/ChangeLog:
2021-09-22 Jiufu Guo <guojiufu@linux.ibm.com>
PR tree-optimization/102087
* tree-ssa-loop-niter.c (number_of_iterations_until_wrap):
Update bound/cmp/control for niter.
gcc/testsuite/ChangeLog:
2021-09-22 Jiufu Guo <guojiufu@linux.ibm.com>
* gcc.dg/pr102087.c: New test.
PR tree-optimization/102087
Aldy Hernandez [Wed, 22 Sep 2021 07:30:21 +0000 (09:30 +0200)]
Check for BB before calling register_outgoing_edges.
We may be asked to fold an artificial statement not in the CFG. Since
there are no outgoing edges from those, avoid calling
register_outgoing_edges.
Tested on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_range_op):
Move check for non-empty BB here.
(fur_source::register_outgoing_edges): ...from here.
Aldy Hernandez [Wed, 22 Sep 2021 07:34:15 +0000 (09:34 +0200)]
path solver: Use range_on_path_entry instead of looking at equivalences.
Cycling through equivalences to improve a range is nowhere near as
efficient as asking the ranger what the range on entry is.
Testing on a hybrid VRP threader, shows that this improves our VRP
threading benefit from 14.5% to 18.5% and our overall jump threads from
0.85% to 1.28%.
Tested on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::internal_range_of_expr):
Remove call to improve_range_with_equivs.
(path_range_query::improve_range_with_equivs): Remove
* gimple-range-path.h: Remove improve_range_with_equivs.
dianhong xu [Tue, 22 Jun 2021 12:33:24 +0000 (20:33 +0800)]
AVX512FP16: Add permutation and mask blend intrinsics.
gcc/ChangeLog:
* config/i386/avx512fp16intrin.h:
(_mm512_mask_blend_ph): New intrinsic.
(_mm512_permutex2var_ph): Ditto.
(_mm512_permutexvar_ph): Ditto.
* config/i386/avx512fp16vlintrin.h:
(_mm256_mask_blend_ph): New intrinsic.
(_mm256_permutex2var_ph): Ditto.
(_mm256_permutexvar_ph): Ditto.
(_mm_mask_blend_ph): Ditto.
(_mm_permutex2var_ph): Ditto.
(_mm_permutexvar_ph): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-14.c: New test.
dianhong xu [Tue, 22 Jun 2021 12:33:24 +0000 (20:33 +0800)]
AVX512FP16: Add complex conjugation intrinsic instructions.
gcc/ChangeLog:
* config/i386/avx512fp16intrin.h: Add new intrinsics.
(_mm512_conj_pch): New intrinsic.
(_mm512_mask_conj_pch): Ditto.
(_mm512_maskz_conj_pch): Ditto.
* config/i386/avx512fp16vlintrin.h: Add new intrinsics.
(_mm256_conj_pch): New intrinsic.
(_mm256_mask_conj_pch): Ditto.
(_mm256_maskz_conj_pch): Ditto.
(_mm_conj_pch): Ditto.
(_mm_mask_conj_pch): Ditto.
(_mm_maskz_conj_pch): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-conjugation-1.c: New test.
* gcc.target/i386/avx512fp16vl-conjugation-1.c: New test.
dianhong xu [Mon, 21 Jun 2021 08:11:23 +0000 (16:11 +0800)]
AVX512FP16: Add reduce operators(add/mul/min/max).
gcc/ChangeLog:
* config/i386/avx512fp16intrin.h (_MM512_REDUCE_OP): New macro
(_mm512_reduce_add_ph): New intrinsic.
(_mm512_reduce_mul_ph): Ditto.
(_mm512_reduce_min_ph): Ditto.
(_mm512_reduce_max_ph): Ditto.
* config/i386/avx512fp16vlintrin.h
(_MM256_REDUCE_OP/_MM_REDUCE_OP): New macro.
(_mm256_reduce_add_ph): New intrinsic.
(_mm256_reduce_mul_ph): Ditto.
(_mm256_reduce_min_ph): Ditto.
(_mm256_reduce_max_ph): Ditto.
(_mm_reduce_add_ph): Ditto.
(_mm_reduce_mul_ph): Ditto.
(_mm_reduce_min_ph): Ditto.
(_mm_reduce_max_ph): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-reduce-op-1.c: New test.
* gcc.target/i386/avx512fp16vl-reduce-op-1.c: Ditto.
dianhong xu [Tue, 15 Jun 2021 09:00:35 +0000 (17:00 +0800)]
AVX512FP16: Support load/store/abs intrinsics.
gcc/ChangeLog:
* config/i386/avx512fp16intrin.h (__m512h_u, __m256h_u,
__m128h_u): New typedef.
(_mm512_load_ph): New intrinsic.
(_mm256_load_ph): Ditto.
(_mm_load_ph): Ditto.
(_mm512_loadu_ph): Ditto.
(_mm256_loadu_ph): Ditto.
(_mm_loadu_ph): Ditto.
(_mm512_store_ph): Ditto.
(_mm256_store_ph): Ditto.
(_mm_store_ph): Ditto.
(_mm512_storeu_ph): Ditto.
(_mm256_storeu_ph): Ditto.
(_mm_storeu_ph): Ditto.
(_mm512_abs_ph): Ditto.
* config/i386/avx512fp16vlintrin.h
(_mm_abs_ph): Ditto.
(_mm256_abs_ph): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-13.c: New test.
Eric Botcazou [Wed, 22 Sep 2021 10:18:48 +0000 (12:18 +0200)]
Small tweak to comments in range_cannot_be_superflat
gcc/ada/
* gcc-interface/decl.c (range_cannot_be_superflat): Tweak comments.
Andreas Krebbel [Wed, 22 Sep 2021 10:13:05 +0000 (12:13 +0200)]
IBM Z: TPF: Add cc clobber to profiling expanders
The code sequence emitted uses CC internally.
gcc/ChangeLog:
* config/s390/tpf.md (prologue_tpf, epilogue_tpf): Add cc clobber.
Tobias Burnus [Wed, 22 Sep 2021 09:11:00 +0000 (11:11 +0200)]
Fortran: Add gfc_simple_for_loop aux function
Function to generate a simple loop (to be used internally).
Callers will be added in follow-up commits.
gcc/fortran/
* trans-expr.c (gfc_simple_for_loop): New.
* trans.h (gfc_simple_for_loop): New prototype.
Alan Modra [Wed, 1 Sep 2021 23:35:05 +0000 (09:05 +0930)]
obstack.h __PTR_ALIGN vs. ubsan
Current ubsan complains on every use of __PTR_ALIGN (when ptrdiff_t is
as large as a pointer), due to making calculations relative to a NULL
pointer. This patch avoids the problem by extracting out and
simplifying __BPTR_ALIGN for the usual case. I've continued to use
ptrdiff_t here, where it might be better to throw away __BPTR_ALIGN
entirely and just assume uintptr_t exists.
* obstack.h (__PTR_ALIGN): Expand and simplify __BPTR_ALIGN
rather than calculating relative to a NULL pointer.
Andreas Krebbel [Wed, 22 Sep 2021 07:32:21 +0000 (09:32 +0200)]
IBM Z: Fix PR102222
Avoid emitting a strict low part move if the insv target actually
affects the whole target reg.
gcc/ChangeLog:
PR target/102222
* config/s390/s390.c (s390_expand_insv): Emit a normal move if it
is actually a full copy of the source operand into the target.
Don't emit a strict low part move if source and target mode match.
gcc/testsuite/ChangeLog:
* gcc.target/s390/pr102222.c: New test.
Jakub Jelinek [Wed, 22 Sep 2021 07:32:32 +0000 (09:32 +0200)]
openmp: Fix OpenMP expansion of scope with non-fallthrugh body [PR102415]
I've used function for omp single expansion also for omp scope. That is
mostly ok, but as the testcase shows, there is one important difference.
The omp single expansion always has a fallthru body, because it during
omp lowering expands the body as if wrapped in an if to simulate that
one thread runs the body and others wait (unless nowait) until it completes
and continue. omp scope is invoked by all threads and so if the body
is non-fallthru, the barrier (unless nowait) at the end will not be reached
by any of the threads.
The following patch fixes that by handling the case where cfg pass optimizes
away the exit bb of it gracefully.
2021-09-22 Jakub Jelinek <jakub@redhat.com>
PR middle-end/102415
* omp-expand.c (expand_omp_single): If region->exit is NULL,
assert region->entry is GIMPLE_OMP_SCOPE region and return.
* c-c++-common/gomp/scope-3.c: New test.
Jakub Jelinek [Wed, 22 Sep 2021 07:29:13 +0000 (09:29 +0200)]
openmp: Add support for allocator and align modifiers on allocate clauses
As the allocate-2.c testcase shows, this change isn't 100% backwards compatible,
one could have allocate and/or align functions that return an OpenMP allocator
handle and previously it would call those functions and now would use those
names as keywords for the modifiers. But it allows specify extra alignment
requirements for the allocations.
2021-09-22 Jakub Jelinek <jakub@redhat.com>
gcc/
* tree.h (OMP_CLAUSE_ALLOCATE_ALIGN): Define.
* tree.c (omp_clause_num_ops): Change number of OMP_CLAUSE_ALLOCATE
arguments from 2 to 3.
* tree-pretty-print.c (dump_omp_clause): Print allocator() around
allocate clause allocator and print align if present.
* omp-low.c (scan_sharing_clauses): Force allocate_map entry even
for omp_default_mem_alloc if align modifier is present. If align
modifier is present, use TREE_LIST to encode both allocator and
align.
(lower_private_allocate, lower_rec_input_clauses, create_task_copyfn):
Handle align modifier on allocator clause if present.
gcc/c-family/
* c-omp.c (c_omp_split_clauses): Copy over OMP_CLAUSE_ALLOCATE_ALIGN.
gcc/c/
* c-parser.c (c_parser_omp_clause_allocate): Parse allocate clause
modifiers.
gcc/cp/
* parser.c (cp_parser_omp_clause_allocate): Parse allocate clause
modifiers.
* semantics.c (finish_omp_clauses) <OMP_CLAUSE_ALLOCATE>: Perform
semantic analysis of OMP_CLAUSE_ALLOCATE_ALIGN.
* pt.c (tsubst_omp_clauses) <case OMP_CLAUSE_ALLOCATE>: Handle
also OMP_CLAUSE_ALLOCATE_ALIGN.
gcc/testsuite/
* c-c++-common/gomp/allocate-6.c: New test.
* c-c++-common/gomp/allocate-7.c: New test.
* g++.dg/gomp/allocate-4.C: New test.
libgomp/
* testsuite/libgomp.c-c++-common/allocate-2.c: New test.
* testsuite/libgomp.c-c++-common/allocate-3.c: New test.
Iain Sandoe [Wed, 22 Sep 2021 06:42:21 +0000 (07:42 +0100)]
libgcc, X86: Adjust guard for Mach-O code.
Existing code in the sfp-machine header has been using __MACH__
as a guard for Mach-O, where currently symbols aliases are not
supported.
__MACH__ is not a sufficient guard for this, since the define
is also emitted for HURD, at least.
Fixed by amending the guard to use __APPLE__ instead.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libgcc/ChangeLog:
* config/i386/sfp-machine.h: Guard Mach-O-specific code
using __APPLE__.
liuhongt [Wed, 22 Sep 2021 01:54:08 +0000 (09:54 +0800)]
Support 64bit fma/fms/fnma/fnms under avx512vl.
gcc/ChangeLog:
* config/i386/i386.md (define_attr "isa"): Add
fma_or_avx512vl.
(define_attr "enabled"): Correspond fma_or_avx512vl to
TARGET_FMA || TARGET_AVX512VL.
* config/i386/mmx.md (fmav2sf4): Extend to AVX512 fma.
(fmsv2sf4): Ditto.
(fnmav2sf4): Ditto.
(fnmsv2sf4): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512vl-pr95046.c: New test.
liuhongt [Wed, 22 Sep 2021 05:14:42 +0000 (13:14 +0800)]
Adjust testcase.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr92658-avx512f.c: Refine testcase.
* gcc.target/i386/pr92658-avx512vl.c: Adjust scan-assembler,
only v2di->v2qi truncate is not supported, v4di->v4qi should
be supported.
liuhongt [Mon, 13 Jul 2020 08:04:05 +0000 (16:04 +0800)]
AVX512FP16: Add expander for cstorehf4.
gcc/ChangeLog:
* config/i386/i386.md (cstorehf3): New define_expand.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-builtin-fpcompare-1.c: New test.
* gcc.target/i386/avx512fp16-builtin-fpcompare-2.c: New test.
liuhongt [Mon, 13 Jul 2020 06:19:21 +0000 (14:19 +0800)]
AVX512FP16: Add expander for ceil/floor/trunc/roundeven.
gcc/ChangeLog:
* config/i386/i386.md (<rounding_insn>hf2): New expander.
(sse4_1_round<mode>2): Extend from MODEF to MODEFH.
* config/i386/sse.md (*sse4_1_round<ssescalarmodesuffix>):
Extend from VF_128 to VFH_128.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-builtin-round-1.c: New test.
liuhongt [Fri, 10 Jul 2020 07:22:30 +0000 (15:22 +0800)]
AVX512FP16: Add expander for sqrthf2.
gcc/ChangeLog:
* config/i386/i386-features.c (i386-features.c): Handle
E_HFmode.
* config/i386/i386.md (sqrthf2): New expander.
(*sqrthf2): New define_insn.
* config/i386/sse.md
(*<sse>_vmsqrt<mode>2<mask_scalar_name><round_scalar_name>):
Extend to VFH_128.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-builtin-sqrt-1.c: New test.
* gcc.target/i386/avx512fp16vl-builtin-sqrt-1.c: New test.
liuhongt [Mon, 2 Mar 2020 10:00:49 +0000 (18:00 +0800)]
AVX512FP16: Add testcases for vfcmaddcsh/vfmaddcsh/vfcmulcsh/vfmulcsh.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-vfcmaddcsh-1a.c: New test.
* gcc.target/i386/avx512fp16-vfcmaddcsh-1b.c: Ditto.
* gcc.target/i386/avx512fp16-vfcmulcsh-1a.c: Ditto.
* gcc.target/i386/avx512fp16-vfcmulcsh-1b.c: Ditto.
* gcc.target/i386/avx512fp16-vfmaddcsh-1a.c: Ditto.
* gcc.target/i386/avx512fp16-vfmaddcsh-1b.c: Ditto.
* gcc.target/i386/avx512fp16-vfmulcsh-1a.c: Ditto.
* gcc.target/i386/avx512fp16-vfmulcsh-1b.c: Ditto.
* gcc.target/i386/avx512fp16-complex-constraints.c: Ditto.
liuhongt [Mon, 2 Mar 2020 09:58:04 +0000 (17:58 +0800)]
AVX512FP16: Add vfcmaddcsh/vfmaddcsh/vfcmulcsh/vfmulcsh.
gcc/ChangeLog:
* config/i386/avx512fp16intrin.h (_mm_mask_fcmadd_sch):
New intrinsic.
(_mm_mask3_fcmadd_sch): Likewise.
(_mm_maskz_fcmadd_sch): Likewise.
(_mm_fcmadd_sch): Likewise.
(_mm_mask_fmadd_sch): Likewise.
(_mm_mask3_fmadd_sch): Likewise.
(_mm_maskz_fmadd_sch): Likewise.
(_mm_fmadd_sch): Likewise.
(_mm_mask_fcmadd_round_sch): Likewise.
(_mm_mask3_fcmadd_round_sch): Likewise.
(_mm_maskz_fcmadd_round_sch): Likewise.
(_mm_fcmadd_round_sch): Likewise.
(_mm_mask_fmadd_round_sch): Likewise.
(_mm_mask3_fmadd_round_sch): Likewise.
(_mm_maskz_fmadd_round_sch): Likewise.
(_mm_fmadd_round_sch): Likewise.
(_mm_fcmul_sch): Likewise.
(_mm_mask_fcmul_sch): Likewise.
(_mm_maskz_fcmul_sch): Likewise.
(_mm_fmul_sch): Likewise.
(_mm_mask_fmul_sch): Likewise.
(_mm_maskz_fmul_sch): Likewise.
(_mm_fcmul_round_sch): Likewise.
(_mm_mask_fcmul_round_sch): Likewise.
(_mm_maskz_fcmul_round_sch): Likewise.
(_mm_fmul_round_sch): Likewise.
(_mm_mask_fmul_round_sch): Likewise.
(_mm_maskz_fmul_round_sch): Likewise.
* config/i386/i386-builtin.def: Add corresponding new builtins.
* config/i386/sse.md
(avx512fp16_fmaddcsh_v8hf_maskz<round_expand_name>): New expander.
(avx512fp16_fcmaddcsh_v8hf_maskz<round_expand_name>): Ditto.
(avx512fp16_fma_<complexopname>sh_v8hf<mask_scalarcz_name><round_scalarcz_name>):
New define insn.
(avx512fp16_<complexopname>sh_v8hf_mask<round_name>): Ditto.
(avx512fp16_<complexopname>sh_v8hf<mask_scalarc_name><round_scalarcz_name>):
Ditto.
* config/i386/subst.md (mask_scalarcz_name): New.
(mask_scalarc_name): Ditto.
(mask_scalarc_operand3): Ditto.
(mask_scalarcz_operand4): Ditto.
(round_scalarcz_name): Ditto.
(round_scalarc_mask_operand3): Ditto.
(round_scalarcz_mask_operand4): Ditto.
(round_scalarc_mask_op3): Ditto.
(round_scalarcz_mask_op4): Ditto.
(round_scalarcz_constraint): Ditto.
(round_scalarcz_nimm_predicate): Ditto.
(mask_scalarcz): Ditto.
(mask_scalarc): Ditto.
(round_scalarcz): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx-1.c: Add test for new builtins.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/sse-14.c: Add test for new intrinsics.
* gcc.target/i386/sse-22.c: Ditto.
liuhongt [Mon, 2 Mar 2020 09:59:20 +0000 (17:59 +0800)]
AVX512FP16: Add testcases for vfcmaddcph/vfmaddcph/vfcmulcph/vfmulcph.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx512fp16-helper.h
(init_src): Adjust init value.
(NET_CMASK): New net mask for complex input.
* gcc.target/i386/avx512fp16-vfcmaddcph-1a.c: New test.
* gcc.target/i386/avx512fp16-vfcmaddcph-1b.c: Ditto.
* gcc.target/i386/avx512fp16-vfcmulcph-1a.c: Ditto.
* gcc.target/i386/avx512fp16-vfcmulcph-1b.c: Ditto.
* gcc.target/i386/avx512fp16-vfmaddcph-1a.c: Ditto.
* gcc.target/i386/avx512fp16-vfmaddcph-1b.c: Ditto.
* gcc.target/i386/avx512fp16-vfmulcph-1a.c: Ditto.
* gcc.target/i386/avx512fp16-vfmulcph-1b.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfcmaddcph-1a.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfcmaddcph-1b.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfcmulcph-1a.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfcmulcph-1b.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfmaddcph-1a.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfmaddcph-1b.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfmulcph-1a.c: Ditto.
* gcc.target/i386/avx512fp16vl-vfmulcph-1b.c: Ditto.
liuhongt [Mon, 2 Mar 2020 09:49:32 +0000 (17:49 +0800)]
AVX512FP16: Add vfcmaddcph/vfmaddcph/vfcmulcph/vfmulcph
gcc/ChangeLog:
* config/i386/avx512fp16intrin.h (_mm512_fcmadd_pch):
New intrinsic.
(_mm512_mask_fcmadd_pch): Likewise.
(_mm512_mask3_fcmadd_pch): Likewise.
(_mm512_maskz_fcmadd_pch): Likewise.
(_mm512_fmadd_pch): Likewise.
(_mm512_mask_fmadd_pch): Likewise.
(_mm512_mask3_fmadd_pch): Likewise.
(_mm512_maskz_fmadd_pch): Likewise.
(_mm512_fcmadd_round_pch): Likewise.
(_mm512_mask_fcmadd_round_pch): Likewise.
(_mm512_mask3_fcmadd_round_pch): Likewise.
(_mm512_maskz_fcmadd_round_pch): Likewise.
(_mm512_fmadd_round_pch): Likewise.
(_mm512_mask_fmadd_round_pch): Likewise.
(_mm512_mask3_fmadd_round_pch): Likewise.
(_mm512_maskz_fmadd_round_pch): Likewise.
(_mm512_fcmul_pch): Likewise.
(_mm512_mask_fcmul_pch): Likewise.
(_mm512_maskz_fcmul_pch): Likewise.
(_mm512_fmul_pch): Likewise.
(_mm512_mask_fmul_pch): Likewise.
(_mm512_maskz_fmul_pch): Likewise.
(_mm512_fcmul_round_pch): Likewise.
(_mm512_mask_fcmul_round_pch): Likewise.
(_mm512_maskz_fcmul_round_pch): Likewise.
(_mm512_fmul_round_pch): Likewise.
(_mm512_mask_fmul_round_pch): Likewise.
(_mm512_maskz_fmul_round_pch): Likewise.
* config/i386/avx512fp16vlintrin.h (_mm_fmadd_pch):
New intrinsic.
(_mm_mask_fmadd_pch): Likewise.
(_mm_mask3_fmadd_pch): Likewise.
(_mm_maskz_fmadd_pch): Likewise.
(_mm256_fmadd_pch): Likewise.
(_mm256_mask_fmadd_pch): Likewise.
(_mm256_mask3_fmadd_pch): Likewise.
(_mm256_maskz_fmadd_pch): Likewise.
(_mm_fcmadd_pch): Likewise.
(_mm_mask_fcmadd_pch): Likewise.
(_mm_mask3_fcmadd_pch): Likewise.
(_mm_maskz_fcmadd_pch): Likewise.
(_mm256_fcmadd_pch): Likewise.
(_mm256_mask_fcmadd_pch): Likewise.
(_mm256_mask3_fcmadd_pch): Likewise.
(_mm256_maskz_fcmadd_pch): Likewise.
(_mm_fmul_pch): Likewise.
(_mm_mask_fmul_pch): Likewise.
(_mm_maskz_fmul_pch): Likewise.
(_mm256_fmul_pch): Likewise.
(_mm256_mask_fmul_pch): Likewise.
(_mm256_maskz_fmul_pch): Likewise.
(_mm_fcmul_pch): Likewise.
(_mm_mask_fcmul_pch): Likewise.
(_mm_maskz_fcmul_pch): Likewise.
(_mm256_fcmul_pch): Likewise.
(_mm256_mask_fcmul_pch): Likewise.
(_mm256_maskz_fcmul_pch): Likewise.
* config/i386/i386-builtin-types.def (V8HF_FTYPE_V8HF_V8HF_V8HF,
V8HF_FTYPE_V16HF_V16HF_V16HF, V16HF_FTYPE_V16HF_V16HF_V16HF_UQI,
V32HF_FTYPE_V32HF_V32HF_V32HF_INT,
V32HF_FTYPE_V32HF_V32HF_V32HF_UHI_INT): Add new builtin types.
* config/i386/i386-builtin.def: Add new builtins.
* config/i386/i386-expand.c: Handle new builtin types.
* config/i386/subst.md (SUBST_CV): New.
(maskc_name): Ditto.
(maskc_operand3): Ditto.
(maskc): Ditto.
(sdc_maskz_name): Ditto.
(sdc_mask_op4): Ditto.
(sdc_mask_op5): Ditto.
(sdc_mask_mode512bit_condition): Ditto.
(sdc): Ditto.
(round_maskc_operand3): Ditto.
(round_sdc_mask_operand4): Ditto.
(round_maskc_op3): Ditto.
(round_sdc_mask_op4): Ditto.
(round_saeonly_sdc_mask_operand5): Ditto.
* config/i386/sse.md (unspec): Add complex fma unspecs.
(avx512fmaskcmode): New.
(UNSPEC_COMPLEX_F_C_MA): Ditto.
(UNSPEC_COMPLEX_F_C_MUL): Ditto.
(complexopname): Ditto.
(<avx512>_fmaddc_<mode>_maskz<round_expand_name>): New expander.
(<avx512>_fcmaddc_<mode>_maskz<round_expand_name>): Ditto.
(fma_<complexopname>_<mode><sdc_maskz_name><round_name>): New
define insn.
(<avx512>_<complexopname>_<mode>_mask<round_name>): Ditto.
(<avx512>_<complexopname>_<mode><maskc_name><round_name>): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/avx-1.c: Add test for new builtins.
* gcc.target/i386/sse-13.c: Ditto.
* gcc.target/i386/sse-23.c: Ditto.
* gcc.target/i386/sse-14.c: Add test for new intrinsics.
* gcc.target/i386/sse-22.c: Ditto.
Kewen Lin [Wed, 22 Sep 2021 03:25:54 +0000 (22:25 -0500)]
rs6000: Parameterize some const values for density test
This patch follows the discussion here[1], where Segher suggested
parameterizing those exact magic constants for density heuristics,
to make it easier to tweak if need.
The change here should be "No Functional Change". But I verified
it with SPEC2017 at option sets O2-vect and Ofast-unroll on Power8,
the result is neutral as expected.
[1]https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579121.html
gcc/ChangeLog:
* config/rs6000/rs6000.opt (rs6000-density-pct-threshold,
rs6000-density-size-threshold, rs6000-density-penalty,
rs6000-density-load-pct-threshold,
rs6000-density-load-num-threshold): New parameter.
* config/rs6000/rs6000.c (rs6000_density_test): Adjust with
corresponding parameters.
Barrett Adair [Wed, 15 Sep 2021 20:26:22 +0000 (15:26 -0500)]
c++: fix template instantiation comparison in redeclarations
This change fixes a primordial c++11 frontend defect where function template
redeclarations with trailing return types that used dependent
sizeof/alignof/noexcept expressions in template value arguments failed to
compare as equivalent to the identical primary template declaration. By
forcing structural AST comparison of the template arguments, we no longer
require TYPE_CANONICAL to match in this case. The new canon-type-{15..18}.C
tests failed with all prior GCC versions, where the redeclarations were
incorrectly reported as ambiguous overloads. The new dependent-name{15,16}.C
tests are regression tests for sneaky problems encountered during
development of this fix. Note that this fix does not address the use of parm
objects' constexpr members as template arguments within a declaration (a
superficially similar longstanding defect).
gcc/cp/ChangeLog:
* pt.c (find_parm_usage_r): New walk_tree callback to find func
parms.
(any_template_arguments_need_structural_equality_p): New special
case.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-52830.C: Remove unwanted dg-ice.
* g++.dg/template/canon-type-15.C: New test.
* g++.dg/template/canon-type-16.C: New test.
* g++.dg/template/canon-type-17.C: New test.
* g++.dg/template/canon-type-18.C: New test.
* g++.dg/template/dependent-name15.C: New regression test.
* g++.dg/template/dependent-name16.C: New regression test.
GCC Administrator [Wed, 22 Sep 2021 00:16:28 +0000 (00:16 +0000)]
Daily bump.
Ian Lance Taylor [Tue, 21 Sep 2021 18:44:26 +0000 (11:44 -0700)]
runtime: set runtime.GOROOT value at build time
In Go 1.17 the gc toolchain changed to set runtime.GOROOT in cmd/link
(previously it was runtime/internal/sys.GOROOT). Do the same in libgo.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/351313
gotools/:
* Makefile.am (check-runtime): Add goroot.go to --extrafiles.
* Makefile.in: Regenerate.
Aldy Hernandez [Tue, 21 Sep 2021 07:24:12 +0000 (09:24 +0200)]
path solver: Use ranger to solve unknowns.
The default behavior for the path solver is to resort to VARYING when
the range for an unknown SSA is outside the given path. This is both
cheap and fast, but fails to get a significant amount of ranges that
traditionally the DOM and VRP threaders could get.
This patch uses the ranger to resolve any unknown names upon entry to
the path. It also uses equivalences to improve ranges.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::defined_outside_path):
New.
(path_range_query::range_on_path_entry): New.
(path_range_query::internal_range_of_expr): Resolve unknowns
with ranger.
(path_range_query::improve_range_with_equivs): New.
(path_range_query::ssa_range_in_phi): Resolve unknowns with
ranger.
* gimple-range-path.h (class path_range_query): Add
defined_outside_path, range_on_path_entry, and
improve_range_with_equivs.
Aldy Hernandez [Tue, 21 Sep 2021 07:21:55 +0000 (09:21 +0200)]
path solver: Add related SSAs to solvable set.
The path solver takes an initial set of SSA names which are deemed
interesting. These are then solved along the path. Adding any copies
of said SSA names to the list of interesting names yields significantly
better results. This patch adds said copies to the already provided
list.
Currently this code is guarded by "m_resolve", which is the more
expensive mode, but it would be reasonable to make it available always,
especially since adding more imports usually has minimal impact on the
processing time. I will investigate and make it universally available
if this is indeed the case.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::add_to_imports): New.
(path_range_query::add_copies_to_imports): New.
(path_range_query::precompute_ranges): Call
add_copies_to_imports.
* gimple-range-path.h (class path_range_query): Add prototypes
for add_copies_to_imports and add_to_imports.
Aldy Hernandez [Tue, 21 Sep 2021 07:17:57 +0000 (09:17 +0200)]
path solver: Remove useless code.
gcc/ChangeLog:
* gimple-range-path.cc (path_range_query::range_defined_in_block):
Remove useless code.
Aldy Hernandez [Tue, 21 Sep 2021 07:04:20 +0000 (09:04 +0200)]
path solver: Add relation support.
This patch adds relational support to the path solver. It uses a
path_oracle that keeps track of relations within a path which are
augmented by relations on entry to the path. With it, range_of_stmt,
range_of_expr, and friends can give relation aware answers.
gcc/ChangeLog:
* gimple-range-fold.h (class fur_source): Make oracle protected.
* gimple-range-path.cc (path_range_query::path_range_query): Add
resolve argument. Initialize oracle.
(path_range_query::~path_range_query): Delete oracle.
(path_range_query::range_of_stmt): Adapt to use relations.
(path_range_query::precompute_ranges): Pre-compute relations.
(class jt_fur_source): New
(jt_fur_source::jt_fur_source): New.
(jt_fur_source::register_relation): New.
(jt_fur_source::query_relation): New.
(path_range_query::precompute_relations): New.
(path_range_query::precompute_phi_relations): New.
* gimple-range-path.h (path_range_query): Add resolve argument.
Add oracle, precompute_relations, precompute_phi_relations.
* tree-ssa-threadbackward.c (back_threader::back_threader): Pass
resolve argument to solver.
Aldy Hernandez [Sun, 19 Sep 2021 16:33:37 +0000 (18:33 +0200)]
Move postfold_gcond_edges into fur_source.
The code registering outgoing edges from a cond is living in
fold_using_range, which makes it difficult to be called from other
places. Also, it refuses to register relations on the outgoing
destinations that have more than one predecessor. This latter issue is
a problem because we would like to register outgoing edges along a path
in the path solver (regardless of single_pred_p).
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_range_op):
Rename postfold_gcond_edges to register_outgoing_edges and
adapt.
(fold_using_range::postfold_gcond_edges): Rename...
(fur_source::register_outgoing_edges): ...to this.
* gimple-range-fold.h (postfold_gcond_edges): Rename to
register_outgoing_edges and move to fur_source.
Aldy Hernandez [Tue, 21 Sep 2021 06:28:28 +0000 (08:28 +0200)]
Do not query SCEV in range_of_phi unless dominators are available.
SCEV won't work without dominators and we can get called without
dominators from debug_ranger.
Another option would be to rename scev_initialized_p to something like
scev_available_p and move the check there. For now, this will do.
gcc/ChangeLog:
* gimple-range-fold.cc (fold_using_range::range_of_phi): Check
dom_info_available_p.
Aldy Hernandez [Tue, 21 Sep 2021 06:26:50 +0000 (08:26 +0200)]
Allocate non_null_ref tables at creation.
Preallocating the space is slightly cheaper than calling
safe_grow_cleared.
gcc/ChangeLog:
* gimple-range-cache.cc (non_null_ref::non_null_ref): Use create
and quick_grow_cleared instead of safe_grow_cleared.
Doug Rupp [Wed, 7 Jul 2021 16:38:34 +0000 (09:38 -0700)]
[Ada] Add some comments in init.c about the lynx178 signal handler
gcc/ada/
* init.c (__gnat_error_handler) [LynxOS]: Add a comment about
missing optional args.
Yannick Moy [Mon, 12 Jul 2021 10:44:36 +0000 (12:44 +0200)]
[Ada] Rename "optional" node subtypes that allow Empty
gcc/ada/
* gen_il-gen.adb (Put_Opt_Subtype): Add suffix.