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.
Justin Squirek [Fri, 9 Jul 2021 00:33:05 +0000 (20:33 -0400)]
[Ada] Spurious dynamic accessibility check on allocator
gcc/ada/
* sem_util.adb (Accessibility_Level): Remove spurious special
case for protected type components.
* exp_ch4.adb (Generate_Accessibility_Check): Use general
Accessibility_Level instead of the low-level function
Type_Access_Level.
Eric Botcazou [Fri, 9 Jul 2021 15:53:12 +0000 (17:53 +0200)]
[Ada] Regenerate gnat_ugn.texi
gcc/ada/
* gnat_ugn.texi: Regenerate.
Matthieu Eyraud [Wed, 7 Jul 2021 17:33:25 +0000 (19:33 +0200)]
[Ada] SCOs: generate 'P' decisions for [Type_]Invariant pragmas
gcc/ada/
* par_sco.adb (Traverse_One): Add support for pragma Invariant /
Type_Invariant.
Bob Duff [Thu, 8 Jul 2021 17:26:53 +0000 (13:26 -0400)]
[Ada] Add "optional" node subtypes that allow Empty
gcc/ada/
* gen_il-gen.adb (Put_Opt_Subtype): Print out subtypes of the
form:
subtype Opt_N_Declaration is
Node_Id with Predicate =>
Opt_N_Declaration = Empty or else
Opt_N_Declaration in N_Declaration_Id;
One for each node or entity type, with the predicate allowing
Empty.
* atree.adb (Parent, Set_Parent): Remove unnecessary "Atree.".
Patrick Bernardi [Fri, 9 Jul 2021 10:29:04 +0000 (20:29 +1000)]
[Ada] bindgen: support additional features on targets suppressing the standard lib
gcc/ada/
* bindgen.adb (Gen_Adainit): For targets that suppress the
standard library: set the default stack size global variable if
a value is provided via the -d switch, and generate a call to
__gnat_initialize_stack_limit if stack checking using stack
limits is enabled.
Bob Duff [Thu, 8 Jul 2021 16:55:38 +0000 (12:55 -0400)]
[Ada] Fix regression in ACATS bdd2006 and bdd2007
gcc/ada/
* sem_ch13.adb (Stream_Size): Print message about allowed stream
sizes even if other error were already found. This avoids
falling into the 'else', which prints "Stream_Size cannot be
given for...", which is misleading -- the Size COULD be given if
it were correct.
Daniel Mercier [Fri, 2 Jul 2021 10:57:53 +0000 (12:57 +0200)]
[Ada] Set related expression for external DISCR symbols in Build_Temporary
gcc/ada/
* exp_util.adb (Build_Temporary): In case of an external DISCR
symbol, set the related expression for CodePeer so that a more
comprehensible message can be emitted to the user.
Eric Botcazou [Thu, 8 Jul 2021 07:54:14 +0000 (09:54 +0200)]
[Ada] Minor tweaks to System.Dwarf_Line
gcc/ada/
* libgnat/s-dwalin.adb (Parse_Header): Tweak comments.
(Read_Entry_Format_Array): Tweak exception message.
(Symbolic_Address.Set_Result): Likewise.
Ed Schonberg [Wed, 7 Jul 2021 14:56:48 +0000 (10:56 -0400)]
[Ada] Crash on build of Initialization procedure for derived container
gcc/ada/
* exp_ch7.adb (Make_Init_Call): Add guard to protect against a
missing initialization procedure for a type.
Doug Rupp [Tue, 6 Jul 2021 20:42:31 +0000 (13:42 -0700)]
[Ada] Cleanup old VxWorks in Makefile.rtl
gcc/ada/
* Makefile.rtl: Remove unused VxWorks sections.
* libgnarl/s-vxwext__noints.adb: Remove.
* libgnarl/s-vxwext__vthreads.ads: Remove.
* libgnat/a-elchha__vxworks-ppc-full.adb: Remove.
* libgnat/s-osprim__vxworks.adb: Remove.
* libgnat/s-osvers__vxworks-653.ads: Remove.
* libgnat/system-vxworks-e500-vthread.ads: Remove.
* libgnat/system-vxworks-ppc-vthread.ads: Remove.
* libgnat/system-vxworks-x86-vthread.ads: Remove.
Bob Duff [Tue, 6 Jul 2021 21:12:32 +0000 (17:12 -0400)]
[Ada] Add assertions to Uintp (UI_Is_In_Int_Range)
gcc/ada/
* uintp.ads, uintp.adb (UI_Is_In_Int_Range): Change the type of
the formal parameter to Valid_Uint. Remove code that preserved
the previous behavior, and replace it with an assertion. The
previous behavior is no longer needed given the recent change to
gigi.
(No, Present): Add comment.
Bob Duff [Tue, 6 Jul 2021 20:56:58 +0000 (16:56 -0400)]
[Ada] Remove if_expression
gcc/ada/
* sem_eval.adb (Fold_Shift): Replace an if_expression with an
if_statement.
Bob Duff [Mon, 5 Jul 2021 22:01:22 +0000 (18:01 -0400)]
[Ada] Add assertions to Uintp
gcc/ada/
* uintp.ads, uintp.adb: Add assertions.
(Ubool, Opt_Ubool): New "boolean" subtypes.
(UI_Is_In_Int_Range): The parameter should probably be
Valid_Uint, but we don't change that for now, because it causes
failures in gigi.
* sem_util.ads, sem_util.adb (Is_True, Is_False,
Static_Boolean): Use Opt_Ubool subtype. Document the fact that
Is_True (No_Uint) = True. Implement Is_False in terms of
Is_True. We considered changing Static_Boolean to return Uint_1
in case of error, but that doesn't fit in well with
Static_Integer.
(Has_Compatible_Alignment_Internal): Deal with cases where Offs
is No_Uint. Change one "and" to "and then" to ensure we don't
pass No_Uint to ">", which would violate the new assertions.
* exp_util.adb, freeze.adb, sem_ch13.adb: Avoid violating new
assertions in Uintp.
Eric Botcazou [Tue, 6 Jul 2021 14:47:31 +0000 (16:47 +0200)]
[Ada] Small optimization to DWARF 5 mode in System.Dwarf_Line
gcc/ada/
* libgnat/s-dwalin.adb (To_File_Name): Fetch only the last string
from the .debug_line_str section.
(Symbolic_Address.Set_Result): Likewise.
Eric Botcazou [Tue, 6 Jul 2021 10:18:57 +0000 (12:18 +0200)]
[Ada] Follow-up tweaks to System.Dwarf_Line
gcc/ada/
* libgnat/s-dwalin.adb (Skip_Form): Fix cases of DW_FORM_addrx
and DW_FORM_implicit_const. Replace Constraint_Error with
Dwarf_Error.
Ghjuvan Lacambre [Mon, 5 Jul 2021 15:08:56 +0000 (17:08 +0200)]
[Ada] exp_pakd.adb: work around spurious Codepeer warnings
gcc/ada/
* exp_pakd.adb (Expand_Packed_Not): Replace expression with
statement.
Ghjuvan Lacambre [Fri, 2 Jul 2021 14:09:27 +0000 (16:09 +0200)]
[Ada] Fix ignored dynamic predicates specified through "predicate" aspect
gcc/ada/
* sem_eval.adb (Is_Static_Subtype): Take predicates created
through "predicate" pragma into account.
Frederic Konrad [Tue, 29 Jun 2021 09:21:26 +0000 (11:21 +0200)]
[Ada] rtems: add 128bit support for aarch64
gcc/ada/
* Makefile.rtl (aarch64-rtems*): Add GNATRTL_128BIT_PAIRS to
the LIBGNAT_TARGET_PAIRS list and also GNATRTL_128BIT_OBJS to
the EXTRA_GNATRTL_NONTASKING_OBJS list.
Gary Dismukes [Fri, 2 Jul 2021 20:51:31 +0000 (16:51 -0400)]
[Ada] Presence of abstract operator function causes resolution problems
gcc/ada/
* sem_ch4.adb (Remove_Abstract_Operations): Add condition to
test for an E_Operator as part of criteria for setting
Abstract_Op on interpretations involving predefined operators.
Javier Miranda [Fri, 2 Jul 2021 17:13:12 +0000 (13:13 -0400)]
[Ada] Interface behaves differently from abstract tagged null
gcc/ada/
* exp_ch6.adb (Expand_Simple_Function_Return): For explicit
dereference of type conversion, enable code that ensures that
the tag of the result is that of the result type.
Bob Duff [Fri, 2 Jul 2021 15:41:28 +0000 (11:41 -0400)]
[Ada] Clean up uses of Esize and RM_Size
gcc/ada/
* einfo-utils.adb: Add support (currently disabled) for using
"initial zero" instead of "Uint_0" to represent "unknown". Call
Known_ functions, instead of evilly duplicating their code
inline.
* fe.h (No_Uint_To_0): New function to convert No_Uint to
Uint_0, in order to preserve existing behavior.
(Copy_Esize, Copy_RM_Size): New imports from Einfo.Utils.
* cstand.adb: Set size fields of Standard_Debug_Renaming_Type
and Standard_Exception_Type.
* checks.adb, exp_attr.adb, exp_ch3.adb, exp_ch5.adb,
exp_ch6.adb, exp_pakd.adb, exp_util.adb, freeze.adb, itypes.adb,
layout.adb, repinfo.adb, sem_attr.adb, sem_ch12.adb,
sem_ch13.adb, sem_ch13.ads, sem_ch3.adb, sem_ch7.adb,
sem_util.adb: Protect calls with Known_..., use Copy_... Remove
assumption that Uint_0 represents "unknown".
* types.ads (Nonzero_Int): New subtype.
* gcc-interface/decl.c, gcc-interface/trans.c: Protect calls
with Known_... and use Copy_... as appropriate, to avoid
blowing up in unknown cases. Similarly, call No_Uint_To_0 to
preserve existing behavior.
Steve Baird [Fri, 2 Jul 2021 00:03:25 +0000 (17:03 -0700)]
[Ada] Enforce legality rule for Predicate_Failure aspect specifications
gcc/ada/
* sem_ch13.adb (Analyze_Aspect_Specifications): Add a new nested
function, Directly_Specified, and then use it in the
implementation of the required check.
Steve Baird [Wed, 30 Jun 2021 23:42:54 +0000 (16:42 -0700)]
[Ada] Refactor sort procedures of doubly linked list containers
gcc/ada/
* libgnat/a-costso.ads, libgnat/a-costso.adb: A new library
unit, Ada.Containers.Stable_Sorting, which exports a pair of
generics (one within the other) which are instantiated by each
of the 5 doubly-linked list container generics to implement
their respective Sort procedures. We use a pair of generics,
rather than a single generic, in order to further reduce code
duplication. The outer generic takes a formal private Node_Ref
type representing a reference to a linked list element. For some
instances, the corresponding actual parameter will be an access
type; for others, it will be the index type for an array.
* Makefile.rtl: Include new Ada.Containers.Stable_Sorting unit.
* libgnat/a-cbdlli.adb, libgnat/a-cdlili.adb,
libgnat/a-cfdlli.adb, libgnat/a-cidlli.adb, libgnat/a-crdlli.adb
(Sort): Replace existing Sort implementation with a call to an
instance of
Ada.Containers.Stable_Sorting.Doubly_Linked_List_Sort. Declare
the (trivial) actual parameters needed to declare that instance.
* libgnat/a-cfdlli.ads: Fix a bug encountered during testing in
the postcondition for M_Elements_Sorted. With a partial
ordering, it is possible for all three of (X < Y), (Y < X),
and (X = Y) to be simultaneously false, so that case needs to
handled correctly.
Piotr Trojanek [Thu, 1 Jul 2021 13:42:56 +0000 (15:42 +0200)]
[Ada] Update comment for Error_Msg_Internal
gcc/ada/
* errout.adb (Error_Msg_Internal): Fix references to Sptr and
Optr in comment; fix grammar of "low-level" where it is used as
an adjective.
Piotr Trojanek [Thu, 1 Jul 2021 13:40:00 +0000 (15:40 +0200)]
[Ada] Simplify iteration when printing error message spans
gcc/ada/
* errout.adb (Write_Source_Code_Lines): Use Cur_Loc before
incrementing it, so that we don't need to decrement it.
Yannick Moy [Thu, 1 Jul 2021 07:36:53 +0000 (09:36 +0200)]
[Ada] Exception raised on empty file in GNATprove mode
gcc/ada/
* errout.adb (Get_Line_End): Do not allow the result to go past
the end of the buffer.
Ed Schonberg [Wed, 30 Jun 2021 22:11:11 +0000 (18:11 -0400)]
[Ada] Refine patch for spurious link error involving discriminated types
gcc/ada/
* sem_ch3.adb (Process_Discriminant_Expressions): If the
constraint is for a Component_Definition that appears in a
Component_Declaration, the entity to be used to create the
potentially global symbol is the Defining_Identifier of the
Component_Declaration.
Bob Duff [Wed, 30 Jun 2021 12:33:26 +0000 (08:33 -0400)]
[Ada] Remove "with GNAT.OS_Lib;" from libgnat/a-stbufi.ads
gcc/ada/
* libgnat/a-stbufi.ads, libgnat/a-stbufi.adb: Change all
occurrences of GNAT.OS_Lib to System.OS_Lib.
Thomas Schwinge [Tue, 21 Sep 2021 06:54:49 +0000 (08:54 +0200)]
Evaluate 'random ()' to '0' in 'pass_omp_oacc_neuter_broadcast'
Julian Brown,
<http://mid.mail-archive.com/
20210920134603.
16459021@squid.athome>:
| [...] the randomness shouldn't be necessary for the
| correctness of the patch (i.e. it could just be "base = bounds_lo", or
| indeed folded into the line after).
|
| The "ar.invalid ()" case happens when we fail to allocate a block of
| memory in LDS space for broadcasting a particular set of variables,
| and trigger a fall-back path in the broadcasting code that adds extra
| barriers around the broadcast in question. I imagine I was thinking
| that adding randomness could mean we can "get lucky" sometimes and
| avoid needing those barriers in some cases, but in fact I don't think
| that was implemented, so the randomness is useless. (Or it could just
| have been leftover debug code... oops).
gcc/
PR other/102408
* omp-oacc-neuter-broadcast.cc (oacc_do_neutering): Evaluate
'random ()' to '0'.
Richard Earnshaw [Tue, 21 Sep 2021 10:14:46 +0000 (11:14 +0100)]
arm: pass architecture extensions to assembler if supported
When I originally added the new extended architecture features support
to GCC, the assembler was unable to parse the new feature lists on the
command-line and would throw an error. This has now been fixed in GAS
and the behaviour is the same as GCC.
So this patch adds a configure-time test for the assembler in use to
detect that it is recent enough to support this behaviour and then
enables passing the architecture extensions to the assembler when this
is the case.
Although the assembly output generated by GCC does not rely on this,
this should ease some issues when using GCC as a driver for compiling
source written directly in assembly language when the programmer was
expecting the appropriate options to be passed on the command line.
gcc/ChangeLog:
* configure.ac: Detect when the assembler supports new-style
architecture extensions.
* common/config/arm/arm-common.c (arm_rewrite_mcpu): Return
the full CPU string if the assembler can grok it.
(arm_rewrite_march): Likewise but for the architecture.
* config.in: Regenerate.
* configure: Regenerate.
Richard Biener [Tue, 21 Sep 2021 07:39:12 +0000 (09:39 +0200)]
tree-optimization/102421 - copy alignment info when splitting groups
This makes sure to copy and adjust alignment info when we are splitting
DR groups after alignment analysis.
2021-09-21 Richard Biener <rguenther@suse.de>
PR tree-optimization/102421
* tree-vect-loop.c (vect_dissolve_slp_only_groups): Copy and
adjust alignment info.
* g++.dg/vect/pr102421.cc: New testcase.
Eric Botcazou [Tue, 21 Sep 2021 07:25:47 +0000 (09:25 +0200)]
Fix no_fsanitize_address effective target
The implementation of the no_fsanitize_address effective target was copied
from asan-dg.exp without realizing that it does not work outside of this
context (there is a comment explaining why). As a consequence, it always
returns 0, so for example the directive in gnat.dg/asan1.adb:
{ dg-skip-if "no address sanitizer" { no_fsanitize_address } }
does not work. This led some people to add the nonsensical:
{ dg-require-effective-target no_fsanitize_address }
to sanitizer tests, e.g. g++.dg/warn/uninit-pr93100.C, thus disabling them
everywhere instead of just for the problematic targets.
gcc/testsuite/
* lib/target-supports.exp (no_fsanitize_address): Add missing bits.
* gcc.dg/uninit-pr93100.c: Skip if no_fsanitize_address.
* gcc.dg/pr91441.c: Likewise.
* gcc.dg/pr96260.c: Likewise.
* gcc.dg/pr96307.c: Likewise.
* g++.dg/warn/uninit-pr93100.C: Likewise.
* gnat.dg/asan1.adb: Likewise.
* gcc.dg/Wstringop-overflow-70.c: Adjust for SPARC.
* g++.dg/abi/anon4.C: Likewise.
Tobias Burnus [Tue, 21 Sep 2021 06:27:00 +0000 (08:27 +0200)]
Fortran: Fix -Wno-missing-include-dirs handling [PR55534]
gcc/fortran/ChangeLog:
PR fortran/55534
* cpp.c: Define GCC_C_COMMON_C for #include "options.h" to make
cpp_reason_option_codes available.
(gfc_cpp_register_include_paths): Make static, set pfile's
warn_missing_include_dirs and move before caller.
(gfc_cpp_init_cb): New, cb code moved from ...
(gfc_cpp_init_0): ... here.
(gfc_cpp_post_options): Call gfc_cpp_init_cb.
(cb_cpp_diagnostic_cpp_option): New. As implemented in c-family
to match CppReason flags to -W... names.
(cb_cpp_diagnostic): Use it to replace single special case.
* cpp.h (gfc_cpp_register_include_paths): Remove as now static.
* gfortran.h (gfc_check_include_dirs): New prototype.
(gfc_add_include_path): Add new bool arg.
* options.c (gfc_init_options): Don't set -Wmissing-include-dirs.
(gfc_post_options): Set it here after commandline processing. Call
gfc_add_include_path with defer_warn=false.
(gfc_handle_option): Call it with defer_warn=true.
* scanner.c (gfc_do_check_include_dir, gfc_do_check_include_dirs,
gfc_check_include_dirs): New. Diagnostic moved from ...
(add_path_to_list): ... here, which came before cmdline processing.
Take additional bool defer_warn argument.
(gfc_add_include_path): Take additional defer_warn arg.
* scanner.h (struct gfc_directorylist): Reorder for alignment issues,
add new 'bool warn'.
libgfortran/ChangeLog:
PR fortran/55534
* configure.ac (AM_FCFLAGS): Add -Wno-missing-include-dirs.
* configure: Regenerate.
libgomp/ChangeLog:
PR fortran/55534
* testsuite/libgomp.fortran/fortran.exp: Add -Wno-missing-include-dirs
to ALWAYS_CFLAGS.
* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
gcc/testsuite/ChangeLog:
* gfortran.dg/include_6.f90: Change dg-error to
dg-warning and update pattern.
* gfortran.dg/include_14.f90: New test.
* gfortran.dg/include_15.f90: New test.
* gfortran.dg/include_16.f90: New test.
* gfortran.dg/include_17.f90: New test.
* gfortran.dg/include_18.f90: New test.
* gfortran.dg/include_19.f90: New test.
* gfortran.dg/include_20.f90: New test.
* gfortran.dg/include_21.f90: New test.
Kewen Lin [Tue, 21 Sep 2021 02:00:04 +0000 (21:00 -0500)]
ipa-fnsummary: Remove inconsistent bp_pack_value
There is one inconsistent bit-field streaming out and in.
On the side of streaming in:
bp_pack_value (&bp, info->inlinable, 1);
bp_pack_value (&bp, false, 1);
bp_pack_value (&bp, info->fp_expressions, 1);
while on the side of the streaming out:
info->inlinable = bp_unpack_value (&bp, 1);
info->fp_expressions = bp_unpack_value (&bp, 1)
The removal of Cilk Plus support r8-4956 missed to remove
the streaming out of the bit, instead just change the value
for streaming out to be always false.
By hacking fp_expression_p to always return true, I can see
it reads the wrong fp_expressions value (false) out in wpa.
gcc/ChangeLog:
* ipa-fnsummary.c (ipa_fn_summary_write): Remove inconsistent
bitfield stream out.
wangpc [Sat, 18 Sep 2021 05:53:09 +0000 (13:53 +0800)]
C++: add type checking for static local vector variable in template
This patch moves verify_type_context from start_decl_1 to cp_finish_decl to
do more type checking such as static local vector variable in C++ template.
2021-08-06 wangpc <pc.wang@linux.alibaba.com>
gcc/cp/ChangeLog
* decl.c (start_decl_1): Move verify_type_context to ...
(cp_finish_decl): ... to here.
gcc/testsuite/ChangeLog
* g++.target/aarch64/sve/static-var-in-template.C: New test.
GCC Administrator [Tue, 21 Sep 2021 00:16:31 +0000 (00:16 +0000)]
Daily bump.
Andrew MacLeod [Tue, 24 Aug 2021 16:13:24 +0000 (12:13 -0400)]
Use EDGE_EXECUTABLE in ranger and return UNDEFINED for those edges.
If an incoming edge is UNDEFINED, don't process it. Track if other edges
equate to a single value, and add an equivalence if appropriate.
gcc/
* gimple-range-fold.cc (fold_using_range::range_of_phi): Ignore
undefined edges, apply an equivalence if appropriate.
* gimple-range-gori.cc (gori_compute::outgoing_edge_range_p): Return
UNDEFINED if EDGE_EXECUTABLE is not set.
* gimple-range.cc (gimple_ranger::gimple_ranger): Set all edges
as EXECUTABLE upon startup.
(gimple_ranger::range_on_edge): Return UNDEFINED for edges without
EDGE_EXECUTABLE set.
* vr-values.c (set_and_propagate_unexecutable): New.
(simplify_using_ranges::fold_cond): Call set_and_propagate.
(simplify_using_ranges::simplify_switch_using_ranges): Ditto.
* vr-values.h: Add prototype.
gcc/testsuite/
* gcc.dg/tree-ssa/evrp-ignore.c: New.
Andrew MacLeod [Fri, 17 Sep 2021 18:58:06 +0000 (14:58 -0400)]
Make each def a new equivalency record.
Create a new equivalency set at each def point killing any equivalencies
coming into the block from back edges. Do not add equivalences for PHI
arguments defined in this block.
* value-relation.cc (equiv_oracle::register_initial_def): New.
(equiv_oracle::register_relation): Call register_initial_def.
(equiv_oracle::add_equiv_to_block): New. Split register_relation.
(relation_oracle::register_stmt): Check def block of PHI arguments.
* value-relation.h (equiv_oracle): Add new prototypes.
Harald Anlauf [Mon, 20 Sep 2021 20:16:18 +0000 (22:16 +0200)]
MAINTAINERS: add myself as Fortran reviewer
ChangeLog:
* MAINTAINERS (Reviewers): Add myself as Fortran reviewer.
Matthias Kretz [Wed, 30 Jun 2021 08:41:33 +0000 (10:41 +0200)]
c-family: Add more predefined macros for math flags
Library code, especially in headers, sometimes needs to know how the
compiler interprets / optimizes floating-point types and operations.
This information can be used for additional optimizations or for
ensuring correctness. This change makes -freciprocal-math,
-fno-signed-zeros, -fno-trapping-math, -fassociative-math, and
-frounding-math report their state via corresponding pre-defined macros.
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
gcc/testsuite/ChangeLog:
* gcc.dg/associative-math-1.c: New test.
* gcc.dg/associative-math-2.c: New test.
* gcc.dg/no-signed-zeros-1.c: New test.
* gcc.dg/no-signed-zeros-2.c: New test.
* gcc.dg/no-trapping-math-1.c: New test.
* gcc.dg/no-trapping-math-2.c: New test.
* gcc.dg/reciprocal-math-1.c: New test.
* gcc.dg/reciprocal-math-2.c: New test.
* gcc.dg/rounding-math-1.c: New test.
* gcc.dg/rounding-math-2.c: New test.
gcc/c-family/ChangeLog:
* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Define or
undefine __RECIPROCAL_MATH__, __NO_SIGNED_ZEROS__,
__NO_TRAPPING_MATH__, __ASSOCIATIVE_MATH__, and
__ROUNDING_MATH__ according to the new optimization flags.
gcc/ChangeLog:
* cppbuiltin.c (define_builtin_macros_for_compilation_flags):
Define __RECIPROCAL_MATH__, __NO_SIGNED_ZEROS__,
__NO_TRAPPING_MATH__, __ASSOCIATIVE_MATH__, and
__ROUNDING_MATH__ according to their corresponding flags.
* doc/cpp.texi: Document __RECIPROCAL_MATH__,
__NO_SIGNED_ZEROS__, __NO_TRAPPING_MATH__, __ASSOCIATIVE_MATH__,
and __ROUNDING_MATH__.
Piotr Trojanek [Mon, 28 Jun 2021 20:34:10 +0000 (22:34 +0200)]
[Ada] Remove redundant checks for non-empty list of aspects
gcc/ada/
* inline.adb (Has_Excluded_Declaration): Remove redundant guard;
the guarded code will call First on a No_List, which is
well-defined and gives Empty.
Piotr Trojanek [Mon, 28 Jun 2021 20:30:40 +0000 (22:30 +0200)]
[Ada] Fix shadowing in conditions for inlining
gcc/ada/
* inline.adb (Has_Excluded_Declaration): Rename and reduce scope
of a local variable.
Bob Duff [Tue, 29 Jun 2021 00:02:20 +0000 (20:02 -0400)]
[Ada] Present and No functions for type Uint
gcc/ada/
* uintp.ads, uintp.adb (Present, No): New functions for
comparing with No_Uint.
* checks.adb, einfo-utils.adb, exp_aggr.adb, exp_attr.adb,
exp_ch3.adb, exp_ch4.adb, exp_dbug.adb, exp_disp.adb,
exp_util.adb, repinfo.adb, repinfo-input.adb, scn.adb,
sem_attr.adb, sem_ch13.adb, sem_eval.adb, sem_util.adb,
sinfo-utils.adb, treepr.adb: Use Present (...) instead of "...
/= No_Uint", and No (...) instead of "... = No_Uint".
Claire Dross [Tue, 29 Jun 2021 08:38:31 +0000 (10:38 +0200)]
[Ada] Add SPARK_Mode => Off to System.File_Control_Block
gcc/ada/
* libgnat/s-ficobl.ads: The entire package has a SPARK_Mode =>
Off aspect.
Doug Rupp [Tue, 22 Jun 2021 15:31:50 +0000 (08:31 -0700)]
[Ada] Use OS_Time for interface to TZ functions.
gcc/ada/
* libgnat/a-calend.adb: Remove time_t, replace with OS_Time.
* libgnat/s-os_lib.ads: Fix comments regarding time_t conversion
functions to reflect the use of To_Ada in in Ada.Calendar
package body.
* sysdep.c (__gnat_localtime_tzoff): Use OS_Time instead of
time_t.
Piotr Trojanek [Mon, 28 Jun 2021 12:20:34 +0000 (14:20 +0200)]
[Ada] Accept volatile expressions as non-scalar actual parameters
gcc/ada/
* sem_res.adb (Resolve_Actual): Remove
Bob Duff [Sun, 27 Jun 2021 15:03:20 +0000 (11:03 -0400)]
[Ada] Clean up Uint fields, remove unused routines
gcc/ada/
* einfo-utils.ads, einfo-utils.adb, fe.h, einfo.ads,
gen_il-fields.ads: Remove unused and no-longer-used routines.
Move related routines together. Rewrite incorrect
documentation, and documentation that will be incorrect when
e.g. Esize-related routines are fixed. Remove unused field
Normalized_Position_Max.
* cstand.adb, exp_pakd.adb, freeze.adb,
gen_il-gen-gen_entities.adb, itypes.adb, layout.adb,
sem_ch10.adb, sem_ch12.adb, sem_ch13.adb, sem_ch3.adb,
sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_prag.adb,
sem_util.adb, ttypes.ads: Update calls to routines removed from
or renamed in Einfo.Utils.
* uintp.ads (Upos): Fix this subtype, which was unintentionally
declared to include Uint_0.
Piotr Trojanek [Fri, 25 Jun 2021 14:10:30 +0000 (16:10 +0200)]
[Ada] Cleanups related to building of dispatch tables
gcc/ada/
* exp_ch7.adb (Expand_N_Package_Declaration): Fix wording in
comment.
* exp_disp.adb (Mark_DT): Remove unnecessary initialization of
I_Depth.
Piotr Trojanek [Mon, 21 Jun 2021 10:08:29 +0000 (12:08 +0200)]
[Ada] Accept volatile properties on constant objects
gcc/ada/
* contracts.adb (Add_Contract_Item): Accept volatile-related
properties on constants.
(Analyze_Object_Contract): Check external properties on
constants; accept volatile constants.
(Check_Type_Or_Object_External_Properties): Replace "variable"
with "object" in error messages; replace Decl_Kind with a local
constant.
* sem_prag.adb (Analyze_Pragma): Accept volatile-related
properties on constants.
Pierre-Alexandre Bazin [Fri, 18 Jun 2021 10:09:48 +0000 (12:09 +0200)]
[Ada] SPARK proof of the Ada.Strings.Fixed library
gcc/ada/
* libgnat/a-strfix.adb ("*"): Added loop invariants and lemmas
for proof.
(Delete): Added assertions for proof, and conditions to avoid
overflow.
(Head): Added loop invariant.
(Insert): Same as Delete.
(Move): Declared with SPARK_Mode Off.
(Overwrite): Added assertions for proof, and conditions to avoid
overflow.
(Replace_Slice): Added assertions for proof, and conditions to
avoid overflow.
(Tail): Added loop invariant and avoided overflows.
(Translate): Added loop invariants.
(Trim): Ensured empty strings returned start at 1.
* libgnat/a-strfix.ads (Index): Rewrote contract cases for
easier proof.
(Index_Non_Blank): Separated the null string case.
(Count): Specified Mapping shouldn't be null.
(Find_Token): Specified Source'First should be Positive when no
From is given.
(Translate): Specified Mapping shouldn't be null.
("*"): Rewrote postcondition for easier proof.
* libgnat/a-strsea.adb (Belongs): Added postcondition.
(Count): Rewrote loops and added loop invariants to avoid
overflows.
(Find_Token): Added loop invariants.
(Index): Rewrote loops to avoid overflows and added loop
invariants for proof.
(Index_Non_Blank): Added loop invariants.
(Is_Identity): New function isolated without SPARK_Mode.
* libgnat/a-strsea.ads: Fix starting comment as package is no
longer private.
(Match): Declared ghost expression function Match.
(Is_Identity): Described identity in the postcondition.
(Index, Index_Non_Blank, Count, Find_Token): Added contract from
a-strfix.ads.
Piotr Trojanek [Fri, 27 Nov 2020 14:36:36 +0000 (15:36 +0100)]
[Ada] Minor style fixes in Resolve_Aspect_Aggregate
gcc/ada/
* sem_ch13.adb (Resolve_Aspect_Aggregate): Move comments after
specs; fix typo in header box; cleanup whitespace.
Eric Botcazou [Sat, 26 Jun 2021 18:50:58 +0000 (20:50 +0200)]
[Ada] Adjust latest change for ELF platforms
gcc/ada/
* libgnat/s-objrea.adb (Get_Load_Address): Return 0 for ELF.
Eric Botcazou [Thu, 24 Jun 2021 10:19:36 +0000 (12:19 +0200)]
[Ada] Add support for PE-COFF PIE to System.Dwarf_Line
gcc/ada/
* adaint.c (__gnat_get_executable_load_address): Add Win32 support.
* libgnat/s-objrea.ads (Get_Xcode_Bounds): Fix typo in comment.
(Object_File): Minor reformatting.
(ELF_Object_File): Uncomment predicate.
(PECOFF_Object_File): Likewise.
(XCOFF32_Object_File): Likewise.
* libgnat/s-objrea.adb: Minor reformatting throughout.
(Get_Load_Address): Implement for PE-COFF.
* libgnat/s-dwalin.ads: Remove clause for System.Storage_Elements
and use consistent wording in comments.
(Dwarf_Context): Set type of Low, High and Load_Address to Address.
* libgnat/s-dwalin.adb (Get_Load_Displacement): New function.
(Is_Inside): Call Get_Load_Displacement.
(Low_Address): Likewise.
(Open): Adjust to type change.
(Aranges_Lookup): Change type of Addr to Address.
(Read_Aranges_Entry): Likewise for Start and adjust.
(Enable_Cach): Adjust to type change.
(Symbolic_Address): Change type of Addr to Address.
(Symbolic_Traceback): Call Get_Load_Displacement.
Piotr Trojanek [Fri, 25 Jun 2021 10:45:57 +0000 (12:45 +0200)]
[Ada] Fix repeated generation of dispatch tables in CodePeer mode
gcc/ada/
* exp_disp.adb (Make_DT): Move call to Set_Has_Dispatch_Table,
so it is executed regardless of the Generate_SCIL mode.
Ed Schonberg [Fri, 25 Jun 2021 13:54:17 +0000 (06:54 -0700)]
[Ada] Spurious link error with child unit and different Assertion modes.
gcc/ada/
* exp_util.ads (Force_Evaluation): Add formal parameter
Discr_Number, to indicate discriminant expression for which an
external name must be created.
(Remove_Side_Effects): Ditto.
* exp_util.adb (Force_Evaluation): Call Remove_Side_Effects with
added parameter.
(Remove_Side_Effects, Build_Temporary): If Discr_Number is
positive, create an external name with suffix DISCR and the
given discriminant number, analogous to what is done for
temporaries for array type bounds.
* sem_ch3.adb (Process_Discriminant_Expressions): If the
constraint is for an object or component declaration and the
corresponding entity may be visible in another unit, invoke
Force_Evaluation with the new parameter.
Arnaud Charlet [Thu, 24 Jun 2021 08:00:35 +0000 (08:00 +0000)]
[Ada] Clean up Uint fields (continued)
gcc/ada/
* gen_il-internals.ads (Invalid_Val): Remove, unused and
generates warnings.
Piotr Trojanek [Fri, 11 Jun 2021 14:04:13 +0000 (16:04 +0200)]
[Ada] Refine types of local constants that store Etype results
gcc/ada/
* exp_aggr.adb, exp_ch4.adb, exp_ch5.adb, sprint.adb: Refine
types of local constants.
Gary Dismukes [Tue, 22 Jun 2021 04:47:00 +0000 (00:47 -0400)]
[Ada] Implementation of Preelaborable_Initialization attribute for AI12-0409
gcc/ada/
* exp_attr.adb (Expand_N_Attribute_Reference): Fold
Preelaborable_Initialization attribute in cases where it hasn't
been folded by the analyzer.
* exp_disp.adb (Original_View_In_Visible_Part): This function is
removed and moved to sem_util.adb.
* sem_attr.adb (Attribute_22): Add
Attribute_Preelaborable_Initialization as an Ada 2022 attribute.
(Analyze_Attribute, Attribute_Preelaborable_Initialization):
Check that the prefix of the attribute is either a formal
private or derived type, or a composite type declared within the
visible part of a package or generic package.
(Eval_Attribute): Perform folding of
Preelaborable_Initialization attribute based on
Has_Preelaborable_Initialization applied to the prefix type.
* sem_ch3.adb (Resolve_Aspects): Add specialized code for
Preelaborable_Initialization used at the end of a package
visible part for setting Known_To_Have_Preelab_Init on types
that are specified with True or that have a conjunction of one
or more P_I attributes applied to formal types.
* sem_ch7.adb (Analyze_Package_Specification): On call to
Has_Preelaborable_Initialization, pass True for new formal
Formal_Types_Have_Preelab_Init, so that error checking treats
subcomponents that are declared within types in generics as
having preelaborable initialization when the subcomponents are
of formal types.
* sem_ch13.adb (Analyze_Aspects_At_Freeze_Point): Add test for
P_I to prevent calling Make_Pragma_From_Boolean_Aspect, since
this aspect is handled specially and the
Known_To_Have_Preelab_Init flag will get set on types that have
the aspect by other means.
(Analyze_Aspect_Specifications.Analyze_One_Aspect): Add test for
Aspect_Preelaborable_Initialization for allowing the aspect to
be specified on formal type declarations.
(Is_Operational_Item): Treat Attribute_Put_Image as an
operational attribute. The need for this was encountered while
working on these changes.
* sem_util.ads (Has_Preelaborable_Initialization): Add
Formal_Types_Have_Preelab_Init as a new formal parameter that
defaults to False.
(Is_Conjunction_Of_Formal_Preelab_Init_Attributes): New
function.
(Original_View_In_Visible_Part): Moved here from exp_disp.adb,
so it can be called by Analyze_Attribute.
* sem_util.adb (Has_Preelaborable_Initialization): Return True
for formal private and derived types when new formal
Formal_Types_Have_Preelab_Init is True, and pass along the
Formal_Types_Have_Preelab_Init flag in the array component case.
(Check_Components): Pass along Formal_Types_Have_Preelab_Init
flag on call to Has_Preelaborable_Initialization.
(Is_Conjunction_Of_Formal_Preelab_Init_Attributes): New function
that returns True when passed an expression that includes one or
more attributes for Preelaborable_Initialization applied to
prefixes that denote formal types.
(Is_Formal_Preelab_Init_Attribute): New utility function nested
within Is_Conjunction_Of_Formal_Preelab_Init_Attributes that
determines whether a node is a P_I attribute applied to a
generic formal type.
(Original_View_In_Visible_Part): Moved here from exp_util.adb,
so it can be called by Analyze_Attribute.
* snames.ads-tmpl: Add note near the start of spec giving
details about what needs to be done when adding a name that
corresponds to both an attribute and a pragma. Delete existing
occurrence of Name_Preelaborable_Initialization, and add a note
comment in the list of Name_* constants at that place,
indicating that it's included in type Pragma_Id, etc., echoing
other such comments for names that are both an attribute and a
pragma. Insert Name_Preelaborable_Initialization in the
alphabetized set of Name_* constants corresponding to
attributes (between First_Attribute_Name and
Last_Attribute_Name).
(type Attribute_Id): Add new literal
Attribute_Preelaborable_Initialization.
(type Pragma_Id): Move Pragma_Preelaborable_Initialization from
its current position to the end of the type, in the special set
of pragma literals that have corresponding atttributes. Add to
accompanying comment, indicating that functions Get_Pragma_Id
and Is_Pragma_Name need to be updated when adding a pragma
literal to the special set.
* snames.adb-tmpl (Get_Pragma_Id): Add case alternative for
Pragma_Preelaborable_Initialization.
(Is_Pragma_Name): Add test for
Name_Preelaborable_Initialization.
Ghjuvan Lacambre [Wed, 23 Jun 2021 17:30:40 +0000 (19:30 +0200)]
[Ada] Fix condition in op interpretation resolution
gcc/ada/
* sem_ch4.adb (Finc_Non_Universal_Interpretations): Fix check.
Piotr Trojanek [Wed, 23 Jun 2021 08:17:24 +0000 (10:17 +0200)]
[Ada] Don't examine all discriminants when looking for the first one
gcc/ada/
* sem_ch3.adb (Build_Discriminant_Constraints): Exit once a
first discriminant is found and the Discrim_Present flag is set.
Bob Duff [Mon, 21 Jun 2021 11:08:03 +0000 (07:08 -0400)]
[Ada] Fix assertion in GNATprove_Mode
gcc/ada/
* gnat1drv.adb (Gnat1drv): Avoid calling List_Rep_Info in
Generate_SCIL and GNATprove_Mode.
* repinfo.adb (List_Common_Type_Info): Fix comment.
Eric Botcazou [Tue, 22 Jun 2021 22:21:00 +0000 (00:21 +0200)]
[Ada] Small cleanup in System.Dwarf_Line
gcc/ada/
* libgnat/s-dwalin.ads: Remove clause for Ada.Exceptions.Traceback,
add clause for System.Traceback_Entries and alphabetize.
(AET): Delete.
(STE): New package renaming.
(Symbolic_Traceback): Adjust.
* libgnat/s-dwalin.adb: Remove clauses for Ada.Exceptions.Traceback
and System.Traceback_Entries.
(Symbolic_Traceback): Adjust.
Ghjuvan Lacambre [Fri, 18 Jun 2021 15:18:41 +0000 (17:18 +0200)]
[Ada] Only assign type to op if compatible
gcc/ada/
* sem_ch4.adb (Find_Non_Universal_Interpretations): Check if
types are compatible before adding interpretation.
Justin Squirek [Tue, 22 Jun 2021 21:31:55 +0000 (17:31 -0400)]
[Ada] Spurious accessibility error on allocator in generic instance
gcc/ada/
* exp_ch4.adb (Expand_N_Type_Conversion): Add guard to protect
against calculating accessibility levels against internal
compiler-generated types.
Ghjuvan Lacambre [Tue, 22 Jun 2021 12:35:16 +0000 (14:35 +0200)]
[Ada] Capitalize comment
gcc/ada/
* sem_dim.adb (Dimensions_Msg_Of): Capitalize comment.
Ghjuvan Lacambre [Mon, 21 Jun 2021 09:47:59 +0000 (11:47 +0200)]
[Ada] Refactor scan_backend_switch to share logic across backends
gcc/ada/
* adabkend.adb (Scan_Back_End_Switches): Replace switch-scanning
logic with call to Backend_Utils.Scan_Common_Back_End_Switches.
* back_end.adb (Scan_Back_End_Switches): Replace switch-scanning
logic with call to Backend_Utils.Scan_Common_Back_End_Switches.
* backend_utils.adb: New file.
* backend_utils.ads: New file.
* gcc-interface/Make-lang.in: Add ada/backend_utils.o.
Ghjuvan Lacambre [Tue, 22 Jun 2021 08:15:36 +0000 (10:15 +0200)]
[Ada] Work around CodePeer bug by declaring variable
gcc/ada/
* atree.adb (Get_32_Bit_Field): Declare result before returning.
Ghjuvan Lacambre [Wed, 16 Jun 2021 13:17:13 +0000 (15:17 +0200)]
[Ada] Move Build_And_Insert_Cuda_Initialization to Expand_CUDA_Package
gcc/ada/
* exp_ch7.adb (Expand_N_Package_Body): Replace
Build_And_Insert_Cuda_Initialization with Expand_CUDA_Package.
* gnat_cuda.adb (Expand_CUDA_Package): New procedure.
(Build_And_Insert_Cuda_Initialization): Make internal.
* gnat_cuda.ads (Expand_CUDA_Package): New procedure.
(Build_And_Insert_Cuda_Initialization): Remove from spec.
Ghjuvan Lacambre [Mon, 21 Jun 2021 11:32:45 +0000 (13:32 +0200)]
[Ada] usage.adb: make -gnatw.c description clearer
gcc/ada/
* usage.adb (Usage): Update -gnatw.c messages.
Eric Botcazou [Mon, 21 Jun 2021 14:13:25 +0000 (16:13 +0200)]
[Ada] Remove inappropriate test from Is_By_Reference_Type
gcc/ada/
* sem_aux.adb (Is_By_Reference_Type): Do not test Error_Posted.
Richard Biener [Fri, 17 Sep 2021 10:35:36 +0000 (12:35 +0200)]
Use the proper vectype
The following uses the SLP node vectype rather than the vectype
stored in the DR group.
2021-09-17 Richard Biener <rguenther@suse.de>
* tree-vect-stmts.c (vectorizable_load): Use the vectype
from the SLP node.
Tobias Burnus [Mon, 20 Sep 2021 10:13:31 +0000 (12:13 +0200)]
Fortran/OpenMP: unconstrained/reproducible ordered modifier
gcc/fortran/ChangeLog:
* gfortran.h (gfc_omp_clauses): Add order_unconstrained.
* dump-parse-tree.c (show_omp_clauses): Dump it.
* openmp.c (gfc_match_omp_clauses): Match unconstrained/reproducible
modifiers to ordered(concurrent).
(OMP_DISTRIBUTE_CLAUSES): Accept ordered clause.
(resolve_omp_clauses): Reject ordered + order on same directive.
* trans-openmp.c (gfc_trans_omp_clauses, gfc_split_omp_clauses): Pass
on unconstrained modifier of ordered(concurrent).
gcc/testsuite/ChangeLog:
* gfortran.dg/gomp/order-5.f90: New test.
* gfortran.dg/gomp/order-6.f90: New test.
* gfortran.dg/gomp/order-7.f90: New test.
* gfortran.dg/gomp/order-8.f90: New test.
* gfortran.dg/gomp/order-9.f90: New test.
Richard Biener [Mon, 20 Sep 2021 09:20:19 +0000 (11:20 +0200)]
Avoid premature alignment setting in vect_duplicate_ssa_name_ptr_info
This removes adjusting alignment based on the vectorized accesses
and instead keeps what was set on the original access. The
code generating the actual accesses make sure to properly align
the vectorized accesses based on the generated pointer already
and the vectorizers alignment is always based of the desired
alignment of a vector type and thus will reset alignment to
unknown this way for example when doing strided accesses.
2021-09-20 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_duplicate_ssa_name_ptr_info):
Do not compute alignment of the vectorized access here.
Richard Biener [Mon, 20 Sep 2021 09:17:49 +0000 (11:17 +0200)]
vect alignmet enhance TLC
This properly marks the loop as for a runtime alias peel rather
than (pointlessly) going through DR_MISALIGNMENT.
2021-09-20 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_enhance_data_refs_alignment):
Store -1 for runtime alias peeling iterations.
Richard Biener [Mon, 20 Sep 2021 06:57:01 +0000 (08:57 +0200)]
Obsolete hppa[12]*-*-hpux10* and hppa[12]*-*-hpux11*
This obsoletes the 32bit hppa-hpux configurations which only support
STABS as debuginfo format.
2021-09-20 Richard Biener <rguenther@suse.de>
gcc/
* config.gcc: Obsolete hppa[12]*-*-hpux10* and hppa[12]*-*-hpux11*.
contrib/
* config-list.mk: --enable-obsolete for hppa2.0-hpux10.1 and
hppa2.0-hpux11.9.
Christophe Lyon [Wed, 8 Sep 2021 08:31:05 +0000 (08:31 +0000)]
testsuite: Remove .exe suffix in prune_gcc_output
When running the testsuite under Windows, we noticed failures in
testcase which attempt to match compiler error messages containing the
name of the executable.
For instance, gcc.dg/analyzer/signal-4a.c tries to match 'cc1:' which
obviously fails when the executable is called cc1.exe.
This patch removes the .exe suffix from various toolchain executables
to avoid this problem.
2021-09-08 Christophe Lyon <christophe.lyon@foss.st.com>
Torbjörn SVENSSON <torbjorn.svensson@st.com>
gcc/testsuite/
* lib/prune.exp (prune_gcc_output): Remove .exe suffix from
toolchain executables names.
Thomas Schwinge [Fri, 3 Sep 2021 16:25:10 +0000 (18:25 +0200)]
Don't record string concatenation data for 'RESERVED_LOCATION_P'
'RESERVED_LOCATION_P' means 'UNKNOWN_LOCATION' or 'BUILTINS_LOCATION'.
We're using 'UNKNOWN_LOCATION' as a spare value for 'Empty', so should
ascertain that we don't use it as a key additionally. Similarly for
'BUILTINS_LOCATION' that we'd later like to use as a spare value for
'Deleted'.
As discussed in the source code comment added, for these we didn't have
stable behavior anyway.
Follow-up to r239175 (commit
88fa5555a309e5d6c6171b957daaf2f800920869)
"On-demand locations within string-literals".
gcc/
* input.c (string_concat_db::record_string_concatenation)
(string_concat_db::get_string_concatenation): Skip for
'RESERVED_LOCATION_P'.
gcc/testsuite/
* gcc.dg/plugin/diagnostic-test-string-literals-1.c: Adjust
expected error diagnostics.
Richard Biener [Wed, 8 Sep 2021 12:42:31 +0000 (14:42 +0200)]
tree-optimization/65206 - dependence analysis on mixed pointer/array
This adds the capability to analyze the dependence of mixed
pointer/array accesses. The example is from where using a masked
load/store creates the pointer-based access when an otherwise
unconditional access is array based. Other examples would include
accesses to an array mixed with accesses from inlined helpers
that work on pointers.
The idea is quite simple and old - analyze the data-ref indices
as if the reference was pointer-based. The following change does
this by changing dr_analyze_indices to work on the indices
sub-structure and storing an alternate indices substructure in
each data reference. That alternate set of indices is analyzed
lazily by initialize_data_dependence_relation when it fails to
match-up the main set of indices of two data references.
initialize_data_dependence_relation is refactored into a head
and a tail worker and changed to work on one of the indices
structures and thus away from using DR_* access macros which
continue to reference the main indices substructure.
There are quite some vectorization and loop distribution opportunities
unleashed in SPEC CPU 2017, notably 520.omnetpp_r, 548.exchange2_r,
510.parest_r, 511.povray_r, 521.wrf_r, 526.blender_r, 527.cam4_r and
544.nab_r see amendments in what they report with -fopt-info-loop while
the rest of the specrate set sees no changes there. Measuring runtime
for the set where changes were reported reveals nothing off-noise
besides 511.povray_r which seems to regress slightly for me
(on a Zen2 machine with -Ofast -march=native).
2021-09-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/65206
* tree-data-ref.h (struct data_reference): Add alt_indices,
order it last.
* tree-data-ref.c (free_data_ref): Release alt_indices.
(dr_analyze_indices): Work on struct indices and get DR_REF as tree.
(create_data_ref): Adjust.
(initialize_data_dependence_relation): Split into head
and tail. When the base objects fail to match up try
again with pointer-based analysis of indices.
* tree-vectorizer.c (vec_info_shared::check_datarefs): Do
not compare the lazily computed alternate set of indices.
* gcc.dg/torture/
20210916.c: New testcase.
* gcc.dg/vect/pr65206.c: Likewise.
Iain Sandoe [Mon, 20 Sep 2021 06:41:49 +0000 (07:41 +0100)]
Driver: Fix bootstrap with DEFAULT_{ASSEMBLER,LINKER,DSYMUTIL}.
The patch at r12-3662-g5fee8a0a9223d factored the code for
printing the names of programes into a separate function.
However the moved editions that print out the names of the
assembler, linker (and dsymutil on Darwin) when those are
specified at configure-time were not adjusted accordingly,
leading to a bootstrap fail.
Fixed by testing specifically for execute OK, since we know
these are programs.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
* gcc.c: Test for execute OK when we find the
programs for assembler linker and dsymutil and those
were specified at configure-time.
GCC Administrator [Mon, 20 Sep 2021 00:16:21 +0000 (00:16 +0000)]
Daily bump.
Martin Sebor [Sun, 19 Sep 2021 23:18:48 +0000 (17:18 -0600)]
Correct a function pre/postcondition [PR102403].
Resolves:
PR middle-end/102403 - ICE in init_from_control_deps, at gimple-predicate-analysis.cc:2364
gcc/ChangeLog:
PR middle-end/102403
* gimple-predicate-analysis.cc (predicate::init_from_control_deps):
Correct a function pre/postcondition.
gcc/testsuite/ChangeLog:
PR middle-end/102403
* gcc.dg/uninit-pr102403.c: New test.
* gcc.dg/uninit-pr102403-c2.c: New test.
Martin Sebor [Sun, 19 Sep 2021 23:16:26 +0000 (17:16 -0600)]
Handle null cfun [PR102243].
Resolves:
PR middle-end/102243 - ICE on placement new at global scope
gcc/ChangeLog:
PR middle-end/102243
* tree-ssa-strlen.c (get_range): Handle null cfun.
gcc/testsuite/ChangeLog:
PR middle-end/102243
* g++.dg/warn/Wplacement-new-size-10.C: New test.
Iain Sandoe [Sat, 18 Sep 2021 22:38:53 +0000 (23:38 +0100)]
libgcc, Darwin: Remove unused symlinks.
These were used on older systems to equate the FAT libgcc_s
library to single-slice equivalents. Unused for any current
system and never emitted by GCC.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libgcc/ChangeLog:
* config/t-slibgcc-darwin: Delete unused code.
Iain Sandoe [Sat, 18 Sep 2021 19:17:06 +0000 (20:17 +0100)]
libgcc, X86, Darwin: Handle symbols for HF cases.
This reorganises the Darwin symbol vers files to include
the generic ones at the top level; allowing for arch ports
to override (via either exclusion or inclusion as needed).
We add an X86-specific vers file containing the new HF
symbols. Note that although Darwin does not use ELF-style
symbol versioning - the parser that produces the map can
consume it. Using the ELF-style description will help us
know at which rev the symbols were introduced.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libgcc/ChangeLog:
* config/i386/t-darwin: Add in a vers file for X86-specific
symbols.
* config/t-darwin: Add the generic symbol maps here...
* config/t-slibgcc-darwin: ... removing from here.
* config/i386/libgcc-darwin.ver: New file.
Iain Sandoe [Sat, 18 Sep 2021 18:55:19 +0000 (19:55 +0100)]
libgcc, X86: Exclude rules for libgcc2 __{div,mul}hc3.
We want to override the libgcc2 generic version of these functions
for X86. First exclude the original and the add in the replacements.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
libgcc/ChangeLog:
* config/i386/t-softfp: Exclude libgcc2 versions of __divhc3
and __mulhc3.
Iain Sandoe [Sat, 18 Sep 2021 16:08:42 +0000 (17:08 +0100)]
Darwin, crts: Build Darwin10 unwinder shim as a library.
We have a small unwinder shim that is only used for Darwin10
(and only then in quite specific cases). To avoid linking
this code for every executable or DSO, we can present the crt
as a convenience library (rather than a .o file).
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/ChangeLog:
* config/darwin.h (LINK_COMMAND_SPEC_A): Use Darwin10
unwinder shim as a convenience library.
libgcc/ChangeLog:
* config.host: Use convenience library for Darwin10
unwinder shim.
* config/t-darwin: Build Darwin10 unwinder shim as a
convenience library.
Jeff Law [Sun, 19 Sep 2021 17:31:32 +0000 (13:31 -0400)]
[committed] Make test names unique for a couple of goacc tests
gcc/testsuite
* gfortran.dg/goacc/privatization-1-compute.f90: Make test names
unique.
* gfortran.dg/goacc/routine-external-level-of-parallelism-2.f:
Likewise.
Andrew Pinski [Sat, 18 Sep 2021 01:11:27 +0000 (01:11 +0000)]
Update the section on binutils version
LTO usage requires binutils 2.35 or newer due to
https://sourceware.org/PR25355.
This adds a note in the prerequisites page about it.
Ok?
gcc/ChangeLog:
* doc/install.texi: Add note about
binutils 2.35 is required for LTO usage.
Andrew Pinski [Sat, 18 Sep 2021 01:08:17 +0000 (01:08 +0000)]
Fix PR bootstrap/102389: --with-build-config=bootstrap-lto is broken
So the problem here is that now the lto-plugin requires NM that works
with LTO to work so we need to pass down NM just like we do for ranlib
and ar.
OK? Bootstrapped and tested with --with-build-config=bootstrap-lto on aarch64-linux-gnu.
Note you need to use binutils 2.35 or later too due to ttps://sourceware.org/PR25355
(I will submit another patch to improve the installation instructions too).
config/ChangeLog:
PR bootstrap/102389
* bootstrap-lto-lean.mk: Handle NM like RANLIB AND AR.
* bootstrap-lto.mk: Likewise.
Aldy Hernandez [Sun, 19 Sep 2021 15:21:45 +0000 (17:21 +0200)]
Minor cleanups to forward threader.
Every time we allocate a threading edge we push it onto the path in a
distinct step. There's no need to do this in two steps, and avoiding
this, keeps us from exposing the internals of the registry.
I've also did some tiny cleanups in thread_across_edge, most importantly
removing the bitmap in favor of an auto_bitmap.
There are no functional changes.
gcc/ChangeLog:
* tree-ssa-threadbackward.c
(back_threader_registry::register_path): Use push_edge.
* tree-ssa-threadedge.c
(jump_threader::thread_around_empty_blocks): Same.
(jump_threader::thread_through_normal_block): Same.
(jump_threader::thread_across_edge): Same. Also, use auto_bitmap.
Tidy up code.
* tree-ssa-threadupdate.c
(jt_path_registry::allocate_thread_edge): Remove.
(jt_path_registry::push_edge): New.
(dump_jump_thread_path): Make static.
* tree-ssa-threadupdate.h (allocate_thread_edge): Remove.
(push_edge): New.
Iain Sandoe [Thu, 19 Aug 2021 12:01:14 +0000 (13:01 +0100)]
Jit, testsuite: Amend expect processing to tolerate more platforms.
The current 'fixed_host_execute' implementation fails on Darwin
platforms for a number of reasons:
1/ If the sub-process spawn fails (e.g. because of missing or mal-
formed params); rather than reporting the fail output into the
match stream, as indicated by the expect manual, it terminates
the script.
- We fix this by (a) checking that the executable is valid as well
as existing (b) we put the spawn into a catch block and report
a failure.
2/ There is no recovery path at all for a buffer-full case (and we
do see buffer-full events with the default sizes).
- Added by the patch here, however it is not as sophisticated as
the methods used by dejagnu internally. Here we set the process
to be "nowait" and then close the connection - with the intent
that this will terminate the spawned process.
3/ The expect logic assumes that 'Totals:' is a valid indicator
for the end of the spawned process output. This is not true
even for the default dejagnu header (there are a number of
additional reporting lines after). In addition to this, there
are some tests that intentionally produce more output after
the totals report (and there are tests that do not use that
mechanism at all).
The effect is the we might arrive at the "wait" for the spawned
process to finish - but that process might not have completed
all its output. For Darwin, at least that causes a deadlock
between expect and the spawnee - the latter is doing a non-
cancellable write and the former is waiting for the latter to
terminate. For some reason this does not seem to affect Linux
perhaps the pty implementation allows the write(s) are able to
proceed even though there is no reader.
- This is fixed by modifying the loop termination condition to be
either EOF (which will be the 'correct' condition) or a timeout
which would represent an error either in the runtime or in the
parsing of the output. As added precautions, we only try to
wait if there is a correcly-spawned process, and we are also
specific about which process we are waiting for.
4/ Darwin appears to have a bug in either the tcl or termios
'cooking' code that ocassionally inserts an additional CR char
into the stream - thus '\n' => '\r\r\n' instead of '\r\n'. The
original program output is correct (it only contains a single
\n) - the additional character is being inserted somewhere in
the translations applied before the output reaches expect.
The logic of this expect implementation does not tolerate single
\r or \n characters (it will fail with a timeout or buffer-full
if that occurs).
- This is fixed by having a line-end match that is adjusted for
Darwin.
5/ The default buffer size does seem to be too small in some cases
noting that GCC uses 10000 as the match buffer size and the
default is 2000.
- Fixed by increasing the size to 8192.
6/ There is a somewhat arbitrary dumping of output where we match
^$prefix\tSOMETHING... and then process the something. This
essentially allows the match to start at any place in the buffer
following any collection of non-line-end chars.
- Fixed by amending the match for 'general' lines to accommodate
these cases, and reporting such lines to the log. At least this
should allow debugging of any cases where output that should be
recognized is being dropped.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/testsuite/ChangeLog:
* jit.dg/jit.exp (fixed_local_execute): Amend the match and
exit conditions to cater for more platforms.