Eric Botcazou [Wed, 3 Jul 2019 11:58:49 +0000 (11:58 +0000)]
dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location...
* dwarf2out.c (add_scalar_info): Add back refererence to existing DIE
if it has the DW_AT_data_member_location attribute.
From-SVN: r273002
Richard Biener [Wed, 3 Jul 2019 11:01:01 +0000 (11:01 +0000)]
gimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR dumping.
2019-07-03 Richard Biener <rguenther@suse.de>
* gimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR
dumping.
From-SVN: r273001
Sylvia Taylor [Wed, 3 Jul 2019 10:57:28 +0000 (10:57 +0000)]
[aarch64]: force frame pointer setup before tlsdesc call
The operation that sets up the tlsdesc register is really a function
call; as such, the frame pointer should really be correctly set up
before this happens. However, because it does not appear as a
call_insn in the RTL the normal dependencies are not added
automatically. We fix this by adding a USE of FP_REGNUM to prevent
migration of the frame-pointer setup past the call by the scheduler.
If a frame pointer is not being used, this is harmless since it only
represents a scheduling constraint.
2019-07-03 Sylvia Taylor <sylvia.taylor@arm.com>
* config/aarch64/aarch64.md (FP_REGNUM): New constant.
(tlsdesc_small_advsimd_<mode>): Add use of FP_REGNUM.
(tlsdesc_small_sve_<mode>): Likewise.
From-SVN: r273000
Andrea Corallo [Wed, 3 Jul 2019 09:42:05 +0000 (09:42 +0000)]
Fix ChangeLog date for last commit
From-SVN: r272999
Andrea Corallo [Wed, 3 Jul 2019 09:09:26 +0000 (09:09 +0000)]
Add myself to MAINTAINERS
2019-07-02 Andrea Corallo <andrea.corallo@arm.com>
* MAINTAINERS (Write After Approval): Add myself.
From-SVN: r272997
Martin Liska [Wed, 3 Jul 2019 08:36:54 +0000 (10:36 +0200)]
Add zstd support for LTO bytecode compression.
2019-07-03 Martin Liska <mliska@suse.cz>
* Makefile.in: Define ZSTD_LIB.
* common.opt: Adjust compression level
to support also zstd levels.
* config.in: Regenerate.
* configure: Likewise.
* configure.ac: Add --with-zstd and --with-zstd-include options
and detect ZSTD.
* doc/install.texi: Mention zstd dependency.
* gcc.c: Print supported LTO compression algorithms.
* lto-compress.c (lto_normalized_zstd_level): Likewise.
(lto_compression_zstd): Likewise.
(lto_uncompression_zstd): Likewise.
(lto_end_compression): Dispatch in between zlib and zstd.
(lto_compression_zlib): Mark with ATTRIBUTE_UNUSED.
(lto_uncompression_zlib): Make it static.
* lto-compress.h (lto_end_uncompression): Fix GNU coding style.
* lto-section-in.c (lto_get_section_data): Pass info
about used compression.
* lto-streamer-out.c: By default use zstd when possible.
* timevar.def (TV_IPA_LTO_DECOMPRESS): Rename to decompression
(TV_IPA_LTO_COMPRESS): Likewise for compression.
From-SVN: r272996
Martin Liska [Wed, 3 Jul 2019 08:36:35 +0000 (10:36 +0200)]
Add .gnu.lto_.lto section.
2019-07-03 Martin Liska <mliska@suse.cz>
* lto-section-in.c (lto_get_section_data): Add "lto" section.
* lto-section-out.c (lto_destroy_simple_output_block): Never
compress LTO_section_lto section.
* lto-streamer-out.c (produce_asm): Do not set major_version
and minor_version.
(lto_output_toplevel_asms): Likewise.
(produce_lto_section): New function.
(lto_output): Call produce_lto_section.
(lto_write_mode_table): Do not set major_version and
minor_version.
(produce_asm_for_decls): Likewise.
* lto-streamer.h (enum lto_section_type): Add LTO_section_lto
type.
(struct lto_header): Remove.
(struct lto_section): New struct.
(struct lto_simple_header): Do not inherit from lto_header.
(struct lto_file_decl_data): Add lto_section_header field.
2019-07-03 Martin Liska <mliska@suse.cz>
* lto-common.c: Read LTO section and verify header.
From-SVN: r272995
Martin Liska [Wed, 3 Jul 2019 08:34:20 +0000 (10:34 +0200)]
Remove another bunch of dead assignment.
2019-07-03 Martin Liska <mliska@suse.cz>
* lra-eliminations.c (eliminate_regs_in_insn): Remove
dead assignemts.
* reg-stack.c (check_asm_stack_operands): Likewise.
* tree-ssa-structalias.c (create_function_info_for): Likewise.
* tree-vect-generic.c (expand_vector_operations_1): Likewise.
* config/i386/i386-expand.c (ix86_expand_sse2_mulvxdi3): Use
force_expand_binop.
2019-07-03 Martin Liska <mliska@suse.cz>
* c-common.c (try_to_locate_new_include_insertion_point): Remove
dead assignemts.
2019-07-03 Martin Liska <mliska@suse.cz>
* call.c (build_new_op_1): Remove
dead assignemts.
* typeck.c (cp_build_binary_op): Likewise.
2019-07-03 Martin Liska <mliska@suse.cz>
* check.c (gfc_check_c_funloc): Remove
dead assignemts.
* decl.c (variable_decl): Likewise.
* resolve.c (resolve_typebound_function): Likewise.
* simplify.c (gfc_simplify_matmul): Likewise.
(gfc_simplify_scan): Likewise.
* trans-array.c (gfc_could_be_alias): Likewise.
* trans-common.c (add_equivalences): Likewise.
* trans-expr.c (trans_class_vptr_len_assignment): Likewise.
(gfc_trans_array_constructor_copy): Likewise.
(gfc_trans_assignment_1): Likewise.
* trans-intrinsic.c (conv_intrinsic_atomic_op): Likewise.
* trans-openmp.c (gfc_omp_finish_clause): Likewise.
* trans-types.c (gfc_get_array_descriptor_base): Likewise.
* trans.c (gfc_build_final_call): Likewise.
2019-07-03 Martin Liska <mliska@suse.cz>
* line-map.c (linemap_get_expansion_filename): Remove
dead assignemts.
* mkdeps.c (make_write): Likewise.
From-SVN: r272994
Martin Liska [Wed, 3 Jul 2019 08:32:25 +0000 (10:32 +0200)]
Handle '\0' in strcmp in RTL expansion (PR tree-optimization/90892).
2019-07-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/90892
* builtins.c (inline_expand_builtin_string_cmp): Handle '\0'
in string constants.
2019-07-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/90892
* gcc.dg/pr90892.c: New test.
From-SVN: r272993
Martin Liska [Wed, 3 Jul 2019 08:31:35 +0000 (10:31 +0200)]
Add to same comdate group only if set (PR middle-end/90899)
2019-07-03 Martin Liska <mliska@suse.cz>
PR middle-end/90899
* multiple_target.c (create_dispatcher_calls): Add to comdat
group only if set for ifunc.
2019-07-03 Martin Liska <mliska@suse.cz>
PR middle-end/90899
* gcc.target/i386/pr90899.c: New test.
From-SVN: r272992
Martin Liska [Wed, 3 Jul 2019 08:29:48 +0000 (10:29 +0200)]
Fix use-after-scope in host-mingw32.c (PR target/88056).
2019-07-03 Martin Liska <mliska@suse.cz>
PR target/88056
* config/i386/host-mingw32.c (mingw32_gt_pch_use_address):
Define local_object_name in outer scope in order to handle
use-after-scope issue.
From-SVN: r272991
Martin Liska [Wed, 3 Jul 2019 08:29:08 +0000 (10:29 +0200)]
Add -fprofile-note option.
2019-07-03 Martin Liska <mliska@suse.cz>
* common.opt: Add fprofile-note.
* coverage.c (coverage_init): Append the option
to bbg_file_name.
* doc/invoke.texi: Document -fprofile-note.
From-SVN: r272990
Jakub Jelinek [Wed, 3 Jul 2019 08:25:22 +0000 (10:25 +0200)]
re PR tree-optimization/91033 (ICE in vect_analyze_loop, at tree-vect-loop.c:2416)
PR tree-optimization/91033
* tree-vectorizer.h (vect_mark_stmts_to_be_vectorized,
vect_analyze_data_refs): Add bool * arguments.
* tree-vect-data-refs.c (vect_analyze_data_refs): Add fatal argument,
if failure is due to scatter/gather, set *fatal to false if non-NULL.
* tree-vect-stmts.c (vect_mark_stmts_to_be_vectorized): Likewise.
* tree-vect-loop.c (vect_analyze_loop_2): Adjust
vect_mark_stmts_to_be_vectorized and vect_analyze_data_refs callers.
* tree-vect-slp.c (vect_slp_analyze_bb_1): Adjust
vect_analyze_data_refs caller.
* gcc.target/i386/pr91033.c: New test.
From-SVN: r272989
Bob Duff [Wed, 3 Jul 2019 08:16:34 +0000 (08:16 +0000)]
[Ada] Document new flags in GNATpp
2019-07-03 Bob Duff <duff@adacore.com>
gcc/ada/
* doc/gnat_ugn/gnat_utility_programs.rst: Document new flags in
GNATpp.
From-SVN: r272988
Hristian Kirtchev [Wed, 3 Jul 2019 08:16:29 +0000 (08:16 +0000)]
[Ada] Forced elaboration order in Elaboration order v4.0
This patch refactors the forced elaboration order functionality,
reintegrates it in Binde, and impelements it in Bindo.
------------
-- Source --
------------
-- server.ads
package Server is
end Server;
-- client.ads
with Server;
package Client is
end Client;
-- main.adb
with Client;
procedure Main is begin null; end Main;
-- duplicate_1.txt
server (spec)
client (spec)
server (spec)
-- error_unit_1.txt
no such unit
client (spec)
-- error_unit_2.txt
no such unit
client (spec)
-- error_unit_3.txt
no such unit -- comment
client (spec)
-- error_unit_4.txt
no such unit -- comment
client (spec)
-- error_unit_5.txt
no such unit (body)
client (spec)
-- error_unit_6.txt
no such unit (body)
client (spec)
-- error_unit_7.txt
no such unit (body) -- comment
client (spec)
-- error_unit_8.txt
no such unit (body)-- comment
client (spec)
-- error_unit_9.txt
no such unit-- comment
client (spec)
-- no_unit_1.txt
-- no_unit_2.txt
-- no_unit_3.txt
-- comment
-- no_unit_4.txt
-- no_unit_5.txt
-- no_unit_6.txt
-- comment
-- no_unit_7.txt
-- no_unit_8.txt
-- comment
-- comment
-- ok_unit_1.txt
server (spec)
client (spec)
-- ok_unit_2.txt
server (spec)
client (spec)
-- ok_unit_3.txt
server (spec)
client (spec)
-- ok_unit_4.txt
server (spec) -- comment
client (spec)
-- ok_unit_5.txt
server (spec)
client (spec)
-- ok_unit_6.txt
server (spec)
client (spec) -- comment
-- ok_unit_7.txt
server (spec)
client (spec) -- comment
-- ok_unit_8.txt
-- comment
-- comment
server (spec)
-- comment
-- comment
client (spec) -- comment
-- ok_unit_9.txt
server (spec)-- comment
client (spec)
----------------------------
-- Compilation and output --
----------------------------
$ gnatmake -q main.adb
$ gnatbind -fno_unit_1.txt main.ali
$ gnatbind -fno_unit_2.txt main.ali
$ gnatbind -fno_unit_3.txt main.ali
$ gnatbind -fno_unit_4.txt main.ali
$ gnatbind -fno_unit_5.txt main.ali
$ gnatbind -fno_unit_6.txt main.ali
$ gnatbind -fno_unit_7.txt main.ali
$ gnatbind -fno_unit_8.txt main.ali
$ gnatbind -ferror_unit_1.txt main.ali
$ gnatbind -ferror_unit_2.txt main.ali
$ gnatbind -ferror_unit_3.txt main.ali
$ gnatbind -ferror_unit_4.txt main.ali
$ gnatbind -ferror_unit_5.txt main.ali
$ gnatbind -ferror_unit_6.txt main.ali
$ gnatbind -ferror_unit_7.txt main.ali
$ gnatbind -ferror_unit_8.txt main.ali
$ gnatbind -ferror_unit_9.txt main.ali
$ gnatbind -fduplicate_1.txt main.ali
$ gnatbind -fok_unit_1.txt main.ali
$ gnatbind -fok_unit_2.txt main.ali
$ gnatbind -fok_unit_3.txt main.ali
$ gnatbind -fok_unit_4.txt main.ali
$ gnatbind -fok_unit_5.txt main.ali
$ gnatbind -fok_unit_6.txt main.ali
$ gnatbind -fok_unit_7.txt main.ali
$ gnatbind -fok_unit_8.txt main.ali
$ gnatbind -fok_unit_9.txt main.ali
"no such unit": not present; ignored
"no such unit": not present; ignored
"no such unit": not present; ignored
"no such unit": not present; ignored
"no such unit%b": not present; ignored
"no such unit%b": not present; ignored
"no such unit%b": not present; ignored
"no such unit%b": not present; ignored
"no such unit": not present; ignored
server (spec) <-- client (spec)
error: duplicate_1.txt:3: duplicate unit name "server (spec)" from line 1
server (spec) <-- client (spec)
server (spec) <-- client (spec)
server (spec) <-- client (spec)
server (spec) <-- client (spec)
server (spec) <-- client (spec)
server (spec) <-- client (spec)
server (spec) <-- client (spec)
server (spec) <-- client (spec)
server (spec) <-- client (spec)
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* binde.adb: Remove with clause for System.OS_Lib.
(Force_Elab_Order): Refactor the majority of the code in Butil.
Use the new forced units iterator to obtain unit names.
* bindo-builders.adb: Add with and use clauses for Binderr,
Butil, Opt, Output, Types, GNAT, and GNAT.Dynamic_HTables. Add
a hash table which maps units to line number in the forced
elaboration order file.
(Add_Unit): New routine.
(Build_Library_Graph): Create forced edges between pairs of
units listed in the forced elaboration order file.
(Create_Forced_Edge, Create_Forced_Edges, Destroy_Line_Number,
Duplicate_Unit_Error, Hash_Unit, Internal_Unit_Info,
Is_Duplicate_Unit, Missing_Unit_Info): New routines.
* bindo-graphs.adb (Is_Internal_Unit, Is_Predefined_Unit):
Refactor some of the behavior to Bindo-Units.
* bindo-graphs.ads: Enable the enumeration literal for forced
edges.
* bindo-units.adb, bindo-units.ads (Is_Internal_Unit,
Is_Predefined_Unit): New routines.
* butil.adb: Add with and use clauses for Opt, GNAT, and
System.OS_Lib. Add with clause for Unchecked_Deallocation.
(Has_Next, Iterate_Forced_Units, Next, Parse_Next_Unit_Name,
Read_Forced_Elab_Order_File): New routines.
* butil.ads: Add with and use clauses for Types. Add new
iterator over the units listed in the forced elaboration order
file.
(Has_Next, Iterate_Forced_Units, Next): New routine.
* namet.adb, namet.ads (Present): New routine.
From-SVN: r272987
Bob Duff [Wed, 3 Jul 2019 08:16:24 +0000 (08:16 +0000)]
[Ada] Crash on anonymous access-to-class-wide with tasks
This patch fixes a bug in which if an object declaration is of an
anonymous access type whose designated type is a limited class-wide type
(but not an interface), and the object is initialized with an allocator,
and the designated type of the allocator contains tasks, the compiler
would crash.
2019-07-03 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_ch3.adb (Access_Definition): The code was creating a
master in the case where the designated type is a class-wide
interface type. Create a master in the noninterface case as
well. That is, create a master for all limited class-wide types.
gcc/testsuite/
* gnat.dg/task2.adb, gnat.dg/task2_pkg.adb,
gnat.dg/task2_pkg.ads: New testcase.
From-SVN: r272986
Yannick Moy [Wed, 3 Jul 2019 08:16:20 +0000 (08:16 +0000)]
[Ada] Suppress warnings in generic instantiations with pragma Warnings
Warnings issued by GNAT or GNATprove inside generic instantiations can
now be suppressed by using pragma Warnings Off/On around the instance.
This has mostly an effect on GNATprove, since GNAT typically does not
issue warnings on instantiations, only on the generic code itself.
2019-07-03 Yannick Moy <moy@adacore.com>
gcc/ada/
* erroutc.adb (Sloc_In_Range): New function to determine whether
the range of a pragma Warnings covers a location, taking
instantiations into account.
From-SVN: r272985
Johannes Kanig [Wed, 3 Jul 2019 08:16:15 +0000 (08:16 +0000)]
[Ada] New routine to access file on command line
This patch adds a new routine to query the first file argument of the
commandline without moving to the next file. This is needed in SPARK.
There is no impact on compilation.
2019-07-03 Johannes Kanig <kanig@adacore.com>
gcc/ada/
* osint.ads, osint.adb (Get_First_Main_File_Name): New routine
to access the first file provided on the command line.
From-SVN: r272984
Ed Schonberg [Wed, 3 Jul 2019 08:16:11 +0000 (08:16 +0000)]
[Ada] Crash on front-end inlining of subp. with aspect specifications
This patch fixes a gap in the handling of formals when inlining a call
to a subprogram marked Inline_Always. For the inlining, the formals are
replaced by the actuals in the block constructed for inlining, The
traversal that performs this replacement does not apply to aspect
specifications that may appear in the original body, because these
aspects are only indirectly reachable from the nodes to which they
apply: a separate traversal is required to perform the replacement in
the expressions for any aspect specification present in the source.
2019-07-03 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* inline.adb (Process_Formals_In_Aspects): New procedure within
Expand_Inlined_Call, to perform a replacement of references to
formals that appear in aspect specifications within the body
being inlined.
gcc/testsuite/
* gnat.dg/inline16.adb, gnat.dg/inline16_gen.adb,
gnat.dg/inline16_gen.ads, gnat.dg/inline16_types.ads: New
testcase.
From-SVN: r272983
Justin Squirek [Wed, 3 Jul 2019 08:16:06 +0000 (08:16 +0000)]
[Ada] Incorrect expansion on renamings of formal parameters
This patch fixes an issue whereby a renaming of an unconstrained formal
parameter leads to spurious runtime errors; manifesting either as a
storage or constraint error due to incorrect bounds being assumed.
This issue also occurs when the renamings are implicit such as through
generic instantiations.
2019-07-03 Justin Squirek <squirek@adacore.com>
gcc/ada/
* sem_ch8.adb (Analyze_Object_Renaming): Add call to search for
the appropriate actual subtype of the object renaming being
analyzed.
(Check_Constrained_Object): Minor cleanup.
gcc/testsuite/
* gnat.dg/renaming13.adb, gnat.dg/renaming14.adb: New testcases.
From-SVN: r272982
Yannick Moy [Wed, 3 Jul 2019 08:16:01 +0000 (08:16 +0000)]
[Ada] Refine pointer support in SPARK
Refine the implementation of pointer support for SPARK analysis.
There is no impact on compilation.
2019-07-03 Yannick Moy <moy@adacore.com>
gcc/ada/
* sem_spark.adb (Get_Observed_Or_Borrowed_Expr): New function to
return go through traversal function call.
(Check_Type): Consistently use underlying type.
(Get_Perm): Adapt for case of elaboration code where variables
are not declared in the environment. Remove incorrect handling
of borrow and observe.
From-SVN: r272981
Hristian Kirtchev [Wed, 3 Jul 2019 08:15:54 +0000 (08:15 +0000)]
[Ada] Spurious visibility error in inlined function
This patch corrects the use of tree replication when inlining a function
that returns an unconstrained result, and its sole statement is an
extended return statement. The use of New_Copy_Tree ensires that global
references saved in a generic template are properly carried over when
the function is instantiated and inlined.
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* inline.adb (Build_Return_Object_Formal): New routine.
(Can_Split_Unconstrained_Function): Code clean up.
(Copy_Formals,Copy_Return_Object): New routines.
(Split_Unconstrained_Function): Code clean up and refactoring.
gcc/testsuite/
* gnat.dg/inline15.adb, gnat.dg/inline15_gen.adb,
gnat.dg/inline15_gen.ads, gnat.dg/inline15_types.ads: New
testcase.
From-SVN: r272980
Gary Dismukes [Wed, 3 Jul 2019 08:15:39 +0000 (08:15 +0000)]
[Ada] Minor editorial corrections and reformatting
2019-07-03 Gary Dismukes <dismukes@adacore.com>
gcc/ada/
* bindo-augmentors.adb, bindo-augmentors.ads,
bindo-builders.ads, bindo-elaborators.adb, sem_ch12.adb,
sem_ch13.adb, sem_spark.adb, sinfo.ads: Minor editorial
corrections and reformatting.
From-SVN: r272979
Bob Duff [Wed, 3 Jul 2019 08:15:28 +0000 (08:15 +0000)]
[Ada] Improve warnings about infinite loops
The compiler now has fewer false alarms when warning about infinite
loops. For example, a loop of the form "for X of A ...", where A is an
array, cannot be infinite. The compiler no longer warns in this case.
2019-07-03 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_warn.adb (Check_Infinite_Loop_Warning): Avoid the warning
if an Iterator_Specification is present.
gcc/testsuite/
* gnat.dg/warn20.adb, gnat.dg/warn20_pkg.adb,
gnat.dg/warn20_pkg.ads: New testcase.
From-SVN: r272978
Bob Duff [Wed, 3 Jul 2019 08:15:03 +0000 (08:15 +0000)]
[Ada] Document default new-line behavior for GNATpp
2019-07-03 Bob Duff <duff@adacore.com>
gcc/ada/
* doc/gnat_ugn/gnat_utility_programs.rst: Document default
new-line behavior.
From-SVN: r272977
Hristian Kirtchev [Wed, 3 Jul 2019 08:14:57 +0000 (08:14 +0000)]
[Ada] ABE checks v3.0, foundations of Elaboration order v4.0
------------------------
-- Elaboration checks --
------------------------
The dynamic ABE checks model now emits the same diagnostics as those of the
static ABE checks model.
The ABE checks mechanism has been redesigned and refactored in the face of
increasing requirements. Most of the functionality can now be toggled, thus
allowing for various combinations of behavior. The combinations are defined
as "initial states" and may be further altered.
Scenarios and targets have been distinctly separated at the higher level,
instead of directly working with nodes and entitites. Scenarios and targets
now carry a representation which removes the need to constantly recompute
relevant attributes, and offers a common interface for the various processors.
Most processing has now been refactored into "services" which perform a single
ABE-related function.
-----------------------
-- Elaboration order --
-----------------------
A new elaboration order mechanism based on the use of an invocation graph to
provide extra information about the flow of execution at elaboration time has
been introduced.
The ABE checks mechanism has been altered to encode pieces of the invocation
graph in the associated ALI files of units.
The new elaboration order mechanism reconstructs the full invocation graph at
bind time, and coupled with the library item graph, determines the elaboration
order of units.
The new elaboration order mechanism is currently inaccessible.
------------
-- Source --
------------
-- pack.ads
package Pack is
procedure ABE_Proc;
procedure Safe_Proc;
end Pack;
-- pack.adb
with Ada.Text_IO; use Ada.Text_IO;
package body Pack is
function Call_Proc (ABE : Boolean) return Integer;
procedure Safe_Proc is
begin
Put_Line ("safe");
end Safe_Proc;
function Call_Proc (ABE : Boolean) return Integer is
begin
if ABE then
ABE_Proc;
else
Safe_Proc;
end if;
return 0;
end Call_Proc;
Elab_1 : constant Integer := Call_Proc (ABE => False);
Elab_2 : constant Integer := Call_Proc (ABE => True);
procedure ABE_Proc is
begin
Put_Line ("ABE");
end ABE_Proc;
end Pack;
-- main.adb
with Pack;
procedure Main is begin null; end Main;
----------------------------
-- Compilation and output --
----------------------------
$ gnatmake -f -q -gnatE main.adb
$ ./main
$ gnatmake -f -q -gnatE main.adb -gnatDG -gnatwL
$ grep -c "safeE" pack.adb.dg
pack.adb:14:10: warning: cannot call "ABE_Proc" before body seen
pack.adb:14:10: warning: Program_Error may be raised at run time
pack.adb:14:10: warning: body of unit "Pack" elaborated
pack.adb:14:10: warning: function "Call_Proc" called at line 22
pack.adb:14:10: warning: procedure "ABE_Proc" called at line 14
pack.adb:14:10: warning: cannot call "ABE_Proc" before body seen
pack.adb:14:10: warning: Program_Error may be raised at run time
pack.adb:14:10: warning: body of unit "Pack" elaborated
pack.adb:14:10: warning: function "Call_Proc" called at line 23
pack.adb:14:10: warning: procedure "ABE_Proc" called at line 14
safe
raised PROGRAM_ERROR : pack.adb:14 access before elaboration
0
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* ali.adb: Add with and use clauses for GNAT,
GNAT.Dynamic_HTables, and Snames. Add a map from invocation
signature records to invocation signature ids. Add various
encodings of invocation-related attributes. Sort and update
table Known_ALI_Lines.
(Add_Invocation_Construct, Add_Invocation_Relation,
Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
Code_To_Invocation_Graph_Line_Kind, Destroy, Hash): New
routines.
(Initialize_ALI): Sort the initialization sequence. Add
initialization for all invocation-related tables.
(Invocation_Construct_Kind_To_Code,
Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
Invocation_Signature_Of, Present): New routines.
(Scan_ALI): Add the default values for invocation-related ids.
Scan invocation graph lines.
(Scan_Invocation_Graph_Line): New routine.
* ali.ads: Add with clause for GNAT.Dynamic_Tables. Add types
for invocation constructs, relations, and signatures. Add
tables for invocation constructs, relations, and signatures.
Update Unit_Record to capture invocation-related ids. Relocate
table Unit_Id_Tables and subtypes Unit_Id_Table, Unit_Id_Array
from Binde.
(Add_Invocation_Construct, Add_Invocation_Relation,
Body_Placement_Kind_To_Code, Code_To_Body_Placement_Kind,
Code_To_Invocation_Construct_Kind, Code_To_Invocation_Kind,
Code_To_Invocation_Graph_Line_Kind,
Invocation_Construct_Kind_To_Code,
Invocation_Graph_Line_Kind_To_Code, Invocation_Kind_To_Code,
Invocation_Signature_Of, Present): New routines.
* binde.adb: Add with and use clause for Types. Add use clause
for ALI.Unit_Id_Tables;
* binde.ads: Relocate table Unit_Id_Tables and subtypes
Unit_Id_Table, Unit_Id_Array to ALI.
* bindgen.adb: Remove with and use clause for ALI.
* bindgen.ads: Remove with and use clause for Binde. Add with
and use clause for ALI.
* bindo.adb, bindo.ads, bindo-augmentors.adb,
bindo-augmentors.ads, bindo-builders.adb, bindo-builders.ads,
bindo-diagnostics.adb, bindo-diagnostics.ads,
bindo-elaborators.adb, bindo-elaborators.ads, bindo-graphs.adb,
bindo-graphs.ads, bindo-units.adb, bindo-units.ads,
bindo-validators.adb, bindo-validators.ads, bindo-writers.adb,
bindo-writers.ads: New units.
* debug.adb: Use and describe GNAT debug switches -gnatd_F and
-gnatd_G. Add GNATbind debug switches in the ranges dA .. dZ,
d.a .. d.z, d.A .. d.Z, d.1 .. d.9, d_a .. d_z, d_A .. d_Z, and
d_1 .. d_9. Use and describe GNATbind debug switches -d_A,
-d_I, -d_L, -d_N, -d_O, -d_T, and -d_V.
* exp_util.adb, exp_util.ads (Exceptions_OK): Relocate to
Sem_Util.
* gnatbind.adb: Add with and use clause for Bindo. Use the new
Bindo elaboration order only when -d_N is in effect.
* lib-writ.adb
(Column, Extra, Invoker, Kind, Line, Locations, Name, Placement,
Scope, Signature, Target): New routines.
(Write_ALI): Output all invocation-related data.
(Write_Invocation_Graph): New routine.
* lib-writ.ads: Document the invocation graph ALI line.
* namet.adb, namet.ads (Present): New routines.
* sem_ch8.adb (Find_Direct_Name): Capture the status of
elaboration checks and warnings of an identifier.
(Find_Expanded_Name): Capture the status of elaboration checks
and warnings of an expanded name.
* sem_ch12.adb (Analyze_Generic_Package_Declaration): Ensure
that invocation graph-related data within the body of the main
unit is encoded in the ALI file.
(Analyze_Generic_Subprogram_Declaration): Ensure that invocation
graph-related data within the body of the main unit is encoded
in the ALI file.
(Analyze_Package_Instantiation): Perform minimal decoration of
the instance entity.
(Analyze_Subprogram_Instantiation): Perform minimal decoration
of the instance entity.
* sem_elab.adb: Perform heavy refactoring of all code. The unit
is now split into "services" which specialize in one area of ABE
checks. Add processing in order to capture invocation-graph
related attributes of the main unit, and encode them in the ALI
file. The Processing phase can now operate in multiple modes,
all described by type Processing_Kind. Scenarios and targets
are now distinct at the higher level, and carry their own
representations. This eliminates the need to constantly
recompute their attributes, and offers the various processors a
uniform interface. The various initial states of the Processing
phase are now encoded using type Processing_In_State, and
xxx_State constants.
* sem_elab.ads: Update the literals of type
Enclosing_Level_Kind. Add Inline pragmas on several routines.
* sem_prag.adb (Process_Inline): Ensure that invocation
graph-related data within the body of the main unit is encoded
in the ALI file.
* sem_util.adb (Enclosing_Generic_Body, Enclosing_Generic_Unit):
Code clean up.
(Exceptions_OK): Relocated from Sem_Util.
(Mark_Save_Invocation_Graph_Of_Body): New routine.
* sem_util.ads (Exceptions_OK): Relocated from Sem_Util.
(Mark_Save_Invocation_Graph_Of_Body): New routine.
* sinfo.adb (Is_Elaboration_Checks_OK_Node): Now applicable to
N_Variable_Reference_Marker.
(Is_Elaboration_Warnings_OK_Node): Now applicable to
N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
(Is_Read): Use Flag4.
(Is_SPARK_Mode_On_Node): New applicable to
N_Variable_Reference_Marker.
(Is_Write): Use Flag5.
(Save_Invocation_Graph_Of_Body): New routine.
(Set_Is_Elaboration_Checks_OK_Node): Now applicable to
N_Variable_Reference_Marker.
(Set_Is_Elaboration_Warnings_OK_Node): Now applicable to
N_Expanded_Name, N_Identifier, N_Variable_Reference_Marker.
(Set_Is_SPARK_Mode_On_Node): New applicable to
N_Variable_Reference_Marker.
(Set_Save_Invocation_Graph_Of_Body): New routine.
* sinfo.ads: Update the documentation of attributes
Is_Elaboration_Checks_OK_Node, Is_Elaboration_Warnings_OK_Node,
Is_SPARK_Mode_On_Node. Update the flag usage of attributes
Is_Read, Is_Write. Add attribute Save_Invocation_Graph_Of_Body
and update its occurrence in nodes.
(Save_Invocation_Graph_Of_Body): New routine along with pragma
Inline.
(Set_Save_Invocation_Graph_Of_Body): New routine along with
pragma Inline.
* switch-b.adb (Scan_Binder_Switches): Refactor the scanning of
debug switches.
(Scan_Debug_Switches): New routine.
* libgnat/g-dynhta.adb, libgnat/g-dynhta.ads (Contains): New routine.
* libgnat/g-graphs.adb (Associate_Vertices): Update the use of
Component_Vertex_Iterator.
(Contains_Component, Contains_Edge, Contains_Vertex, Has_Next):
Reimplemented.
(Iterate_Component_Vertices): New routine.
(Iterate_Vertices): Removed.
(Next): Update the parameter profile.
(Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
routines.
* libgnat/g-graphs.ads: Update the initialization of
No_Component. Add type Component_Vertex_Iterator. Remove type
Vertex_Iterator.
(Has_Next): Add new versions and remove old ones.
(Iterate_Component_Vertices): New routine.
(Iterate_Vertices): Removed.
(Next): Add new versions and remove old ones.
(Number_Of_Component_Vertices, Number_Of_Outgoing_Edges): New
routines.
* libgnat/g-sets.adb (Contains): Reimplemented.
* gcc-interface/Make-lang.in (GNATBIND_OBJS): Add
GNAT.Dynamic_HTables, GNAT.Graphs and Bindo units.
* rtsfind.ads: Remove extra space.
From-SVN: r272976
Yannick Moy [Wed, 3 Jul 2019 08:14:52 +0000 (08:14 +0000)]
[Ada] SPARK pointer support extended to local borrowers and observers
SPARK rules allow local borrowers and observers to be declared. During
their lifetime, the access to the borrowed/observed object is
restricted.
There is no impact on compilation.
2019-07-03 Yannick Moy <moy@adacore.com>
gcc/ada/
* sem_spark.adb: Add support for locally borrowing and observing
a path.
(Get_Root_Object): Add parameter Through_Traversal to denote
when we are interesting in getting to the traversed parameter.
(Is_Prefix_Or_Almost): New function to support detection of
illegal access to borrowed or observed paths.
(Check_Pragma): Add analysis of assertion pragmas.
From-SVN: r272975
Ed Schonberg [Wed, 3 Jul 2019 08:14:47 +0000 (08:14 +0000)]
[Ada] Spurious error with static predicate in generic unit
This patch fixes a spurious error in a generic unit that invludes a
subtype with a static predicate, when the type is used in a case
expression.
2019-07-03 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch13.adb (Build_Predicate_Functions): In a generic context
we do not build the bodies of predicate fuctions, but the
expression in a static predicate must be elaborated to allow
case coverage checking within the generic unit.
(Build_Discrete_Static_Predicate): In a generic context, return
without building function body once the
Static_Discrete_Predicate expression for the type has been
constructed.
gcc/testsuite/
* gnat.dg/predicate6.adb, gnat.dg/predicate6.ads: New testcase.
* gnat.dg/static_pred1.adb: Remove expected error.
From-SVN: r272974
Hristian Kirtchev [Wed, 3 Jul 2019 08:14:43 +0000 (08:14 +0000)]
[Ada] Minor reformatting
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* bindgen.adb, inline.adb, layout.adb, sem_ch12.adb,
sem_ch13.adb, sem_ch7.adb, styleg.adb: Minor reformatting.
From-SVN: r272973
Bob Duff [Wed, 3 Jul 2019 08:14:38 +0000 (08:14 +0000)]
[Ada] Style check for mixed-case identifiers
This patch implements a new switch, -gnatyD, enables a style check that
requires defining identifiers to be in mixed case.
2019-07-03 Bob Duff <duff@adacore.com>
gcc/ada/
* par-ch3.adb (P_Defining_Identifier): Call
Check_Defining_Identifier_Casing.
* style.ads, styleg.ads, styleg.adb
(Check_Defining_Identifier_Casing): New procedure to check for
mixed-case defining identifiers.
* stylesw.ads, stylesw.adb (Style_Check_Mixed_Case_Decls): New
flag for checking for mixed-case defining identifiers.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Document new feature.
* gnat_ugn.texi: Regenerate.
From-SVN: r272972
Eric Botcazou [Wed, 3 Jul 2019 08:14:33 +0000 (08:14 +0000)]
[Ada] Extend -gnatw.z warning to array types
The -gnatw.z switch causes the compiler to issue a warning on record
types subject to both an alignment clause and a size clause, when the
specified size is not a multiple of the alignment in bits, because this
means that the Object_Size will be strictly larger than the specified
size.
It makes sense to extend this warning to array types, but not to the
cases of bit-packed arrays where the size is not a multiple of storage
unit and the specified alignment is the minimum one, because there would
be no way to get rid of it apart from explicitly silencing it.
The compiler must issue the warning:
p.ads:5:03: warning: size is not a multiple of alignment for "Triplet"
p.ads:5:03: warning: size of 24 specified at line 4
p.ads:5:03: warning: Object_Size will be increased to 32
on the following package:
package P is
type Triplet is new String (1 .. 3);
for Triplet'Size use 24;
for Triplet'Alignment use 4;
type Arr is array (1 .. 7) of Boolean;
pragma Pack (Arr);
for Arr'Size use 7;
for Arr'Alignment use 1;
end P;
2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* doc/gnat_ugn/building_executable_programs_with_gnat.rst
(Warning message control): Document that -gnatw.z/Z apply to
array types.
* freeze.adb (Freeze_Entity): Give -gnatw.z warning for array
types as well, but not if the specified alignment is the minimum
one.
* gnat_ugn.texi: Regenerate.
From-SVN: r272971
Bob Duff [Wed, 3 Jul 2019 08:14:29 +0000 (08:14 +0000)]
[Ada] Spell "laid" correctly
2019-07-03 Bob Duff <duff@adacore.com>
gcc/ada/
* einfo.ads, exp_util.adb, layout.ads, sinfo.ads: Spell "laid"
correctly.
From-SVN: r272970
Ed Schonberg [Wed, 3 Jul 2019 08:14:24 +0000 (08:14 +0000)]
[Ada] Spurious error on dynamic predicate in a generic context
This patch fixes a spurious error on the conformance checking between
the expression for an aspect analyzed at the freeze point of the type,
and the analysis of a copy of the expression performed at the end of the
enclosing list of declarationss. In a generic context the first may not
have been analyzed yet and this must be done before the conformance
check.
2019-07-03 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): No error
message on attribute applied to a renaming when the renamed
object is an aggregate (from code reading).
(Check_Aspect_At_End_Of_Declarations): In a generic context
where freeze nodes are not generated, the original expression
for an aspect may need to be analyzed to precent spurious
conformance errors when compared with the expression that is
anakyzed at the end of the current declarative list.
gcc/testsuite/
* gnat.dg/predicate5.adb, gnat.dg/predicate5.ads: New testcase.
From-SVN: r272969
Eric Botcazou [Wed, 3 Jul 2019 08:14:15 +0000 (08:14 +0000)]
[Ada] Fix bogus error on array with overaligned scalar component
The compiler would wrongly reject an alignment clause larger than 8 on
the component type of an array of scalars, which is valid albeit
pathological.
2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* layout.adb (Layout_Type): Do not set the component size of an
array with a scalar component if the component type is
overaligned.
gcc/testsuite/
* gnat.dg/alignment14.adb: New testcase.
From-SVN: r272968
Ed Schonberg [Wed, 3 Jul 2019 08:14:10 +0000 (08:14 +0000)]
[Ada] Make loop labels unique for front-end inlined calls
This patch transforms loop labels in the body of subprograms that are to
be inlined by the front-end, to prevent accidental duplication of loop
labels, which might make the resulting source illegal.
----
Source program:
----
package P is
procedure Get_Rom_Addr_Offset
with Inline_Always;
end P;
----
package body P is
procedure Get_Rom_Addr_Offset is
X : Integer;
begin
Main_Block :
for I in 1 .. 10 loop
X := 2;
exit Main_Block when I > 4;
other_loop:
for J in character'('a') .. 'z' loop
if I < 5 then
exit Main_Block when J = 'k';
else
Exit Other_Loop;
end if;
end loop other_loop;
end loop Main_Block;
end Get_Rom_Addr_Offset;
procedure P2 is
begin
Main_Block :
for I in 1 .. 1 loop
Get_Rom_Addr_Offset;
end loop Main_Block;
end P2;
end P;
----
Command:
gcc -c -gnatN -gnatd.u -gnatDG p.adb
----
Output
----
package body p is
procedure p__get_rom_addr_offset is
x : integer;
other_loop : label
main_block : label
begin
main_block : for i in 1 .. 10 loop
x := 2;
exit main_block when i > 4;
other_loop : for j in 'a' .. 'z' loop
if i < 5 then
exit main_block when j = 'k';
else
exit other_loop;
end if;
end loop other_loop;
end loop main_block;
return;
end p__get_rom_addr_offset;
procedure p__p2 is
main_block : label
begin
main_block : for i in 1 .. 1 loop
B6b : declare
x : integer;
other_loopL10b : label
main_blockL9b : label
begin
main_blockL9b : for i in 1 .. 10 loop
x := 2;
exit main_blockL9b when i > 4;
other_loopL10b : for j in 'a' .. 'z' loop
if i < 5 then
exit main_blockL9b when j = 'k';
else
exit other_loopL10b;
end if;
end loop other_loopL10b;
end loop main_blockL9b;
end B6b;
end loop main_block;
return;
end p__p2;
begin
null;
end p;
2019-07-03 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* inline.adb (Make_Loop_Labels_Unique): New procedure to modify
the source code of subprograms that are inlined by the
front-end, to prevent accidental duplication between loop labels
in the inlined code and the code surrounding the inlined call.
From-SVN: r272967
Hristian Kirtchev [Wed, 3 Jul 2019 08:14:05 +0000 (08:14 +0000)]
[Ada] Update the section on resolving elaboration circularities
2019-07-03 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Update
the section on resolving elaboration circularities to eliminate
certain combinations of switches which together do not produce
the desired effect and confuse users.
* gnat_ugn.texi: Regenerate.
From-SVN: r272966
Arnaud Charlet [Wed, 3 Jul 2019 08:14:00 +0000 (08:14 +0000)]
[Ada] Add a gnatbind option to generate C code
2019-07-03 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* bindgen.adb (Gen_Main): Disable generation of reference to
Ada_Main_Program_Name for CCG.
* bindusg.adb (Display): Add -G to the command-line usage for
gnatbind.
* opt.ads (Generate_C_Code): Update comment.
* switch-b.adb (Scan_Binder_Switches): Add handling for -G.
From-SVN: r272965
Arnaud Charlet [Wed, 3 Jul 2019 08:13:55 +0000 (08:13 +0000)]
[Ada] Do not consider inlined subprograms when generating C code
2019-07-03 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_ch7.adb (Has_Referencer): Do not consider inlined
subprograms when generating C code, which allows us to generate
static inline subprograms.
From-SVN: r272964
Justin Squirek [Wed, 3 Jul 2019 08:13:51 +0000 (08:13 +0000)]
[Ada] Missing consistency check for constant modifier
This patch fixes an issue whereby instantiations of generic packages
were incorrectly allowed despite formal and actual subprograms not
having matching declarations with anonymous constant access type
parameters.
------------
-- Source --
------------
-- gen1.ads
package Gen1 is
generic
with procedure View (IA : not null access constant Integer);
procedure Dispatch (IA : access Integer);
end;
-- gen2.adb
package body Gen1 is
procedure Dispatch (IA : access Integer) is
begin
View (IA);
end;
end;
-- bad1.ads
with Gen1;
package Bad1 is
procedure Bad_View (IA : not null access Integer);
procedure Bad_Dispatch is new Gen1.Dispatch (Bad_View);
end;
-- bad1.adb
package body Bad1 is
procedure Bad_View (IA : not null access Integer) is
begin
IA.all := IA.all + 1;
end;
end;
-- gen2.ads
package Gen2 is
generic
with procedure View (IA : access constant Integer);
procedure Dispatch (IA : access Integer);
end;
-- gen2.adb
package body Gen2 is
procedure Dispatch (IA : access Integer) is
begin
View (IA);
end;
end;
-- bad2.ads
with Gen2;
package Bad2 is
procedure Bad_View (IA : access Integer);
procedure Bad_Dispatch is new Gen2.Dispatch (Bad_View);
end;
-- bad2.adb
package body Bad2 is
procedure Bad_View (IA : access Integer) is
begin
IA.all := IA.all + 1;
end;
end;
-----------------
-- Compilation --
-----------------
$ gnatmake -q bad1.adb
$ bad1.ads:4:04: instantiation error at gen1.ads:3
$ bad1.ads:4:04: not mode conformant with declaration at line 3
$ bad1.ads:4:04: constant modifier does not match
$ gnatmake: "bad1.adb" compilation error
$ gnatmake -q bad2.adb
$ bad2.ads:4:04: instantiation error at gen2.ads:3
$ bad2.ads:4:04: not mode conformant with declaration at line 3
$ bad2.ads:4:04: constant modifier does not match
$ gnatmake: "bad2.adb" compilation error
2019-07-03 Justin Squirek <squirek@adacore.com>
gcc/ada/
* sem_ch6.adb (Check_Conformance): Add expression checking for
constant modifiers in anonymous access types (in addition to
"non-null" types) so that they are considered "matching" for
subsequent conformance tests.
From-SVN: r272963
Arnaud Charlet [Wed, 3 Jul 2019 08:13:46 +0000 (08:13 +0000)]
[Ada] Clarify wording on documentation for No_Multiple_Elaboration
2019-07-03 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
Clarify wording on No_Multiple_Elaboration.
* gnat_rm.texi: Regenerate.
From-SVN: r272962
Ed Schonberg [Wed, 3 Jul 2019 08:13:41 +0000 (08:13 +0000)]
[Ada] Spurious error on predicate of subtype in generic
This patch fixes a spurious error on a dynamic predicate of a record
subtype when the expression for the predicate includes a selected
component that denotes a component of the subtype.
2019-07-03 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch8.adb (Find_Selected_Component): If the prefix is the
current instance of a type or subtype, complete the resolution
of the name by finding the component of the type denoted by the
selector name.
gcc/testsuite/
* gnat.dg/predicate4.adb, gnat.dg/predicate4_pkg.ads: New
testcase.
From-SVN: r272961
Eric Botcazou [Wed, 3 Jul 2019 08:13:34 +0000 (08:13 +0000)]
[Ada] Document that boolean types with convention C now map to C99 bool
2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* doc/gnat_rm/interfacing_to_other_languages.rst (Interfacing to C):
Document that boolean types with convention C now map to C99 bool.
* gnat_rm.texi: Regenerate.
From-SVN: r272960
Javier Miranda [Wed, 3 Jul 2019 08:13:29 +0000 (08:13 +0000)]
[Ada] Exp_Attr: remove dead code
2019-07-03 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_attr.adb (Expand_Min_Max_Attribute): Code cleanup:
removing code that it is now never executed in the CCG compiler
(dead code).
From-SVN: r272959
Jakub Jelinek [Wed, 3 Jul 2019 05:03:58 +0000 (07:03 +0200)]
tree-core.h (enum omp_clause_code): Add OMP_CLAUSE__SCANTEMP_ clause.
* tree-core.h (enum omp_clause_code): Add OMP_CLAUSE__SCANTEMP_
clause.
* tree.h (OMP_CLAUSE_DECL): Use OMP_CLAUSE__SCANTEMP_ instead of
OMP_CLAUSE__CONDTEMP_ as range's upper bound.
(OMP_CLAUSE__SCANTEMP__ALLOC, OMP_CLAUSE__SCANTEMP__CONTROL): Define.
* tree.c (omp_clause_num_ops, omp_clause_code_name): Add
OMP_CLAUSE__SCANTEMP_ entry.
(walk_tree_1): Handle OMP_CLAUSE__SCANTEMP_.
* tree-pretty-print.c (dump_omp_clause): Likewise.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Likewise.
* omp-general.h (struct omp_for_data): Add have_scantemp and
have_nonctrl_scantemp members.
* omp-general.c (omp_extract_for_data): Initialize them.
* omp-low.c (struct omp_context): Add scan_exclusive member.
(scan_omp_1_stmt): Don't unnecessarily mask gimple_omp_for_kind
result again with GF_OMP_FOR_KIND_MASK. Initialize also
ctx->scan_exclusive.
(lower_rec_simd_input_clauses): Use ctx->scan_exclusive instead
of !ctx->scan_inclusive.
(lower_rec_input_clauses): Simplify gimplification of dtors using
gimplify_and_add. For non-is_simd test OMP_CLAUSE_REDUCTION_INSCAN
rather than rvarp. Handle OMP_CLAUSE_REDUCTION_INSCAN in worksharing
loops. Don't add barrier for reduction_omp_orig_ref if
ctx->scan_??xclusive.
(lower_reduction_clauses): Don't do anything for ctx->scan_??xclusive.
(lower_omp_scan): Use ctx->scan_exclusive instead
of !ctx->scan_inclusive. Handle worksharing loops with inscan
reductions. Use new_vard != new_var instead of repeated
omp_is_reference calls.
(omp_find_scan, lower_omp_for_scan): New functions.
(lower_omp_for): Call lower_omp_for_scan for worksharing loops with
inscan reductions.
* omp-expand.c (expand_omp_scantemp_alloc): New function.
(expand_omp_for_static_nochunk): Handle fd->have_nonctrl_scantemp
and fd->have_scantemp.
* c-c++-common/gomp/scan-3.c (f1): Don't expect a sorry message.
* c-c++-common/gomp/scan-5.c (foo): Likewise.
* testsuite/libgomp.c++/scan-1.C: New test.
* testsuite/libgomp.c++/scan-2.C: New test.
* testsuite/libgomp.c++/scan-3.C: New test.
* testsuite/libgomp.c++/scan-4.C: New test.
* testsuite/libgomp.c++/scan-5.C: New test.
* testsuite/libgomp.c++/scan-6.C: New test.
* testsuite/libgomp.c++/scan-7.C: New test.
* testsuite/libgomp.c++/scan-8.C: New test.
* testsuite/libgomp.c/scan-1.c: New test.
* testsuite/libgomp.c/scan-2.c: New test.
* testsuite/libgomp.c/scan-3.c: New test.
* testsuite/libgomp.c/scan-4.c: New test.
* testsuite/libgomp.c/scan-5.c: New test.
* testsuite/libgomp.c/scan-6.c: New test.
* testsuite/libgomp.c/scan-7.c: New test.
* testsuite/libgomp.c/scan-8.c: New test.
From-SVN: r272958
Jakub Jelinek [Wed, 3 Jul 2019 04:56:25 +0000 (06:56 +0200)]
gimplify.c (gimplify_scan_omp_clauses): For inscan reductions on worksharing loop propagate it as shared clause to...
* gimplify.c (gimplify_scan_omp_clauses): For inscan reductions
on worksharing loop propagate it as shared clause to containing
combined parallel.
* c-omp.c (c_omp_split_clauses): Put OMP_CLAUSE_REDUCTION_INSCAN
clauses on OMP_FOR rather than OMP_PARALLEL when OMP_FOR is combined
with OMP_PARALLEL.
* c-c++-common/gomp/scan-5.c: New test.
From-SVN: r272957
Jakub Jelinek [Wed, 3 Jul 2019 04:51:45 +0000 (06:51 +0200)]
omp-expand.c (expand_omp_for_static_nochunk, [...]): For nowait worksharing loop with conditional lastprivate clause(s)...
* omp-expand.c (expand_omp_for_static_nochunk,
expand_omp_for_static_chunk): For nowait worksharing loop with
conditional lastprivate clause(s), emit GOMP_loop_end_nowait call
at the end.
* c-c++-common/gomp/lastprivate-conditional-5.c: New test.
From-SVN: r272956
Ian Lance Taylor [Wed, 3 Jul 2019 00:56:35 +0000 (00:56 +0000)]
compiler: rework type and package tracking in exporter
Revamps the way the exporter tracks exported types and imported
packages that need to be mentioned in the export data.
The previous implementation wasn't properly handling the case where an
exported non-inlinable function refers to an imported type whose
method set includes an inlinable function whose body makes a call to a
function in another package that's not directly used in the original
package.
This patch integrates together two existing traversal helper classes,
"Collect_references_from_inline" and "Find_types_to_prepare" into a
single helper "Collect_export_references", so as to have common/shared
code that looks for indirectly imported packages.
Fixes golang/go#32778
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/183850
From-SVN: r272955
Joern Rennecke [Wed, 3 Jul 2019 00:22:53 +0000 (00:22 +0000)]
re PR testsuite/91065 (gcc.dg/plugin/start_unit_plugin.c uses ggc memory without registering a root_tab)
PR testsuite/91065
* testsuite/gcc.dg/plugin/start_unit_plugin.c: Register a root tab
to reference fake_var.
From-SVN: r272954
GCC Administrator [Wed, 3 Jul 2019 00:16:15 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r272953
Jeff Law [Tue, 2 Jul 2019 23:01:53 +0000 (17:01 -0600)]
re PR tree-optimization/90883 (Generated code is worse if returned struct is unnamed)
PR tree-optimization/90883
* g++.dg/tree-ssa/pr90883.c: Add -Os. Check dse2 for the
deleted store on some targets.
From-SVN: r272949
Qing Zhao [Tue, 2 Jul 2019 20:23:30 +0000 (20:23 +0000)]
re PR preprocessor/90581 (provide an option to adjust the maximum depth of nested #include)
PR preprocessor/90581
Add a cpp option -fmax-include-depth to set the maximum depth of the nested #include.
From-SVN: r272948
Iain Sandoe [Tue, 2 Jul 2019 19:03:48 +0000 (19:03 +0000)]
[PATCH, Ada, Darwin, PPC] PPC Darwin has stack check probes.
On PPC, Darwin uses the same code as other parts of the port.
2019-07-02 Iain Sandoe <iain@sandoe.co.uk>
* libgnat/system-darwin-ppc.ads: Set Stack_Check_Probes True for
PPC Darwin.
From-SVN: r272947
Aaron Sawdey [Tue, 2 Jul 2019 18:51:23 +0000 (13:51 -0500)]
optabs.def (movmem_optab): Add movmem back for memmove().
2019-07-02 Aaron Sawdey <acsawdey@linux.ibm.com>
* optabs.def (movmem_optab): Add movmem back for memmove().
* doc/md.texi: Add description of movmem pattern for overlapping move.
From-SVN: r272946
Cherry Zhang [Tue, 2 Jul 2019 16:47:48 +0000 (16:47 +0000)]
compiler: use builtin memset for non-pointer memclr
For zeroing a range of memory that doesn't contain pointer, we
can use builtin memset directly.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184438
* go-gcc.cc (Gcc_backend::Gcc_backend): Define __builtin_memset.
From-SVN: r272944
Uros Bizjak [Tue, 2 Jul 2019 15:48:36 +0000 (17:48 +0200)]
mmx.md (mmx_pack<s_trunsuffix>swb): Use TARGET_SSE2 && SSE_REGNO_P in split condition.
* config/i386/mmx.md (mmx_pack<s_trunsuffix>swb):
Use TARGET_SSE2 && SSE_REGNO_P in split condition.
(mmx_packssdw): Ditto.
(mmx_punpckhbw): Ditto.
(mmx_punpcklbw): Ditto.
(mmx_punpckhwd): Ditto.
(mmx_punpcklwd): Ditto.
(mmx_punpckhdq): Ditto.
(mmx_punpckldq): Ditto.
(*vec_dupv4hi): Ditto.
(*vec_dupv2si): Ditto.
(mmx_pmovmskb): Ditto.
* config/i386/sse.md (sse_cvtpi2ps): Use
TARGET_SSE2 && SSE_REG_P in split condition.
(ssse3_ph<plusminus_mnemonic>wv4hi3): Use
TARGET_SSSE3 && SSE_REGNO_P in split condition.
(ssse3_ph<plusminus_mnemonic>dv2si3): Ditto.
(ssse3_pshufbv8qi3): Ditto.
(ssse3_palignrdi): Ditto.
From-SVN: r272943
Andrew Stubbs [Tue, 2 Jul 2019 11:57:17 +0000 (11:57 +0000)]
Fix amdgcn regrename ICE.
2019-07-02 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn.md (movdi_symbol_save_scc): Convert to define_insn
with inlined save and restore.
From-SVN: r272932
Jonathan Wakely [Tue, 2 Jul 2019 11:50:27 +0000 (12:50 +0100)]
Fix preprocessor checks for Clang builtins
Clang seems to define built-ins that start with "__builtin_" as
non-keywords, which means that we need to use __has_builtin to detect
them, not __is_identifier. The built-ins that don't start with
"__builtin_" are keywords, and can only be detected using
__is_identifier and not by __has_builtin.
* include/bits/c++config (_GLIBCXX_HAVE_BUILTIN_LAUNDER)
(_GLIBCXX_HAVE_BUILTIN_IS_CONSTANT_EVALUATED): Use __has_builtin
instead of __is_identifier to detect Clang support.
From-SVN: r272931
Eric Botcazou [Tue, 2 Jul 2019 11:10:59 +0000 (11:10 +0000)]
* cfgrtl.c (commit_edge_insertions): Rebuild jump labels chain.
From-SVN: r272930
Eric Botcazou [Tue, 2 Jul 2019 09:44:47 +0000 (09:44 +0000)]
cfgexpand.c (pass_expand::execute): Deal specially with instructions to be inserted on single successor edge of the...
* cfgexpand.c (pass_expand::execute): Deal specially with instructions
to be inserted on single successor edge of the entry block. Then call
commit_edge_insertions instead of inserting the instructions manually.
* cfgrtl.c (commit_edge_insertions): Do not verify flow info during
RTL expansion.
From-SVN: r272929
Richard Biener [Tue, 2 Jul 2019 09:35:12 +0000 (09:35 +0000)]
tree-core.h (enum tree_index): Add TI_CHREC_DONT_KNOW and TI_CHREC_KNOWN.
2019-07-02 Richard Biener <rguenther@suse.de>
* tree-core.h (enum tree_index): Add TI_CHREC_DONT_KNOW and
TI_CHREC_KNOWN.
* tree.h (chrec_not_analyzed_yet, chrec_dont_know, chrec_known):
Define here.
* tree.c (build_common_tree_nodes): Initialize them.
* tree-chrec.h (chrec_not_analyzed_yet, chrec_dont_know, chrec_known):
Make declarations comments.
* tree-scalar-evolution.c (chrec_not_analyzed_yet, chrec_dont_know,
chrec_known): Remove definitions.
(initialize_scalar_evolutions_analyzer): Remove.
(scev_initialize): Do not call initialize_scalar_evolutions_analyzer.
* tree-streamer.c (preload_common_nodes): Do not preload
TI_CHREC_DONT_KNOW or TI_CHREC_KNOWN.
From-SVN: r272928
Jan Hubicka [Tue, 2 Jul 2019 08:35:58 +0000 (10:35 +0200)]
tree-ssa-alias.c (aliasing_component_refs_p): Remove forgotten sanity check.
* tree-ssa-alias.c (aliasing_component_refs_p): Remove forgotten
sanity check.
From-SVN: r272927
Jan Hubicka [Tue, 2 Jul 2019 08:28:24 +0000 (10:28 +0200)]
tree-ssa-alias.c (nonoverlapping_component_refs_for_decl_p): Rename to ..
* tree-ssa-alias.c (nonoverlapping_component_refs_for_decl_p): Rename
to ..
(nonoverlapping_component_refs_since_match_p): ... this one;
handle also non-decl bases; return -1 if search gave up.
(alias_stats): Rename nonoverlapping_component_refs_of_decl_p_may_alias,
nonoverlapping_component_refs_of_decl_p_no_alias to
nonoverlapping_component_refs_since_match_p_may_alias,
nonoverlapping_component_refs_since_match_p_no_alias.
(dump_alias_stats): Update dumping.
(aliasing_matching_component_refs_p): Break out from ...;
dispatch to nonoverlapping_component_refs_for_decl_p
and nonoverlapping_component_refs_since_match_p.
(aliasing_component_refs_p): ... here; call
nonoverlapping_component_refs_p in scenarios where we can not
precisely determine base match.
(decl_refs_may_alias_p): Use
nonoverlapping_component_refs_since_match_p.
(indirect_ref_may_alias_decl_p): Do not call
nonoverlapping_component_refs_p.
(indirect_refs_may_alias_p): Likewise.
* gcc.dg/tree-ssa/alias-access-path-7.c: New testcase.
From-SVN: r272926
Jan Hubicka [Tue, 2 Jul 2019 08:26:16 +0000 (10:26 +0200)]
tree-inline.c (remap_gimple_stmt): Do not subtitute handled components to clobber of return value.
* tree-inline.c (remap_gimple_stmt): Do not subtitute handled components
to clobber of return value.
* g++.dg/lto/pr90990_0.C: New testcase.
From-SVN: r272925
Kyrylo Tkachov [Tue, 2 Jul 2019 08:24:54 +0000 (08:24 +0000)]
[arm/AArch64] Assume unhandled NEON types are neon_arith_basic types when scheduling for Cortex-A57
Some scheduling descriptions, like the Cortex-A57 one, are reused for multiple -mcpu options.
Sometimes those other -mcpu cores support more architecture features than the Armv8-A Cortex-A57.
For example, the Cortex-A75 and Cortex-A76 support Armv8.2-A as well as the Dot Product instructions.
These Dot Product instructions have the neon_dot and neon_dot_q scheduling type, but that type is not
handled in cortex-a57.md, since the Cortex-A57 itself doesn't need to care about these instructions.
But if we just ignore the neon_dot(_q) type at scheduling we get really terrible codegen when compiling
for -mcpu=cortex-a76, for example, because the scheduler just pools all the UDOT instructions at the end
of the basic block, since it doesn't assume anything about their behaviour.
This patch ameliorates the situation somewhat by telling the Cortex-A57 scheduling model to treat any
insn that doesn't get assigned a cortex_a57_neon_type but is actually a is_neon_type instruction as
a simple neon_arith_basic instruction. This allows us to treat post-Armv8-A SIMD instructions more sanely
without having to model each of them explicitly in cortex-a57.md.
* config/arm/cortex-a57.md (cortex_a57_neon_type): Use neon_arith_basic
for is_neon_type instructions that have not already been categorized.
From-SVN: r272924
Jan Hubicka [Tue, 2 Jul 2019 08:23:02 +0000 (10:23 +0200)]
lto-common.c (lto_register_canonical_types_for_odr_types): Copy CXX_ODR_P from the main variant.
* lto-common.c (lto_register_canonical_types_for_odr_types):
Copy CXX_ODR_P from the main variant.
From-SVN: r272923
Richard Biener [Tue, 2 Jul 2019 07:35:23 +0000 (07:35 +0000)]
re PR tree-optimization/58483 (missing optimization opportunity for const std::vector compared to std::array)
2019-07-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/58483
* tree-ssa-scopedtables.c (avail_expr_hash): Use OEP_ADDRESS_OF
for MEM_REF base hashing.
(equal_mem_array_ref_p): Likewise for base comparison.
* gcc.dg/tree-ssa/ssa-dom-cse-8.c: New testcase.
From-SVN: r272922
Janne Blomqvist [Tue, 2 Jul 2019 05:54:31 +0000 (08:54 +0300)]
mklog/91048: Open ~/.mklog in string mode.
2019-07-02 Janne Blomqvist <jb@gcc.gnu.org>
PR other/91048
* mklog (read_user_info): Open ~/.mklog in string mode.
From-SVN: r272921
Jim Wilson [Tue, 2 Jul 2019 02:30:52 +0000 (02:30 +0000)]
Fix libstdc++ install-pdf support.
Generating pdf files requires everything that is required for the xml files
except the style sheets.
libstdc++-v3/
* configure.ac (BUILD_PDF): Also test for doxygen, dot, xsltproc,
and xmllint.
* configure: Regenerate.
From-SVN: r272920
Ian Lance Taylor [Tue, 2 Jul 2019 01:39:19 +0000 (01:39 +0000)]
compiler: refactoring in Export class to encapsulate type refs map
Convert the Export::type_refs map from a static object to a field
contained (indirectly, via an impl class) in Export itself, for better
encapsulation and to be able to reclaim its memory when exporting is
done. No change in compiler functionality.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/184170
From-SVN: r272919
GCC Administrator [Tue, 2 Jul 2019 00:16:22 +0000 (00:16 +0000)]
Daily bump.
From-SVN: r272916
Segher Boessenkool [Mon, 1 Jul 2019 21:58:47 +0000 (23:58 +0200)]
rs6000.md (signbit<mode>2_dm): Make this a parameterized name.
@signbit<mode>2_dm
* config/rs6000/rs6000.md (signbit<mode>2_dm): Make this a
parameterized name.
(signbit<mode>2): Use that name. Simplify.
From-SVN: r272912
Joern Rennecke [Mon, 1 Jul 2019 21:48:55 +0000 (21:48 +0000)]
re PR tree-optimization/66726 (missed optimization, factor conversion out of COND_EXPR)
PR middle-end/66726
* tree-ssa-phiopt.c (factor_out_conditional_conversion):
Tune heuristic from PR71016 to allow MIN / MAX.
* testsuite/gcc.dg/tree-ssa/pr66726-4.c: New testcase.
From-SVN: r272911
Uros Bizjak [Mon, 1 Jul 2019 19:04:05 +0000 (21:04 +0200)]
* config/i386/constraints.md: Remove stalled comment w.r.t. Yh constraint.
From-SVN: r272908
Segher Boessenkool [Mon, 1 Jul 2019 18:47:56 +0000 (20:47 +0200)]
rs6000.md (ieee_128bit_vsx_abs<mode>2): Make this a parameterized name.
@ieee_128bit_vsx_abs<mode>2
* config/rs6000/rs6000.md (ieee_128bit_vsx_abs<mode>2): Make this a
parameterized name.
(abs<mode>2): Use that name. Simplify.
From-SVN: r272907
Segher Boessenkool [Mon, 1 Jul 2019 18:47:05 +0000 (20:47 +0200)]
rs6000.md (ieee_128bit_vsx_neg<mode>2): Make this a parameterized name.
@ieee_128bit_vsx_neg<mode>2
* config/rs6000/rs6000.md (ieee_128bit_vsx_neg<mode>2): Make this a
parameterized name.
(neg<mode>2): Use that name. Simplify.
From-SVN: r272906
Segher Boessenkool [Mon, 1 Jul 2019 18:45:36 +0000 (20:45 +0200)]
rs6000.md (abs<mode>2_hw): Make this a parameterized name.
@abs<mode>2_hw
* config/rs6000/rs6000.md (abs<mode>2_hw): Make this a parameterized
name.
(abs<mode>2): Use that name. Simplify.
From-SVN: r272905
Segher Boessenkool [Mon, 1 Jul 2019 18:44:18 +0000 (20:44 +0200)]
rs6000.md (neg<mode>2_hw): Make this a parameterized name.
@neg<mode>2_hw
* config/rs6000/rs6000.md (neg<mode>2_hw): Make this a parameterized
name.
(neg<mode>2): Use that name. Simplify.
From-SVN: r272904
Segher Boessenkool [Mon, 1 Jul 2019 18:43:10 +0000 (20:43 +0200)]
rs6000.md (extenddf<mode>2): Make this a parameterized name.
@extenddf<mode>2
* config/rs6000/rs6000.md (extenddf<mode>2): Make this a parameterized
name.
(floatsi<mode>2): Use that name. Simplify.
From-SVN: r272903
Uros Bizjak [Mon, 1 Jul 2019 18:41:09 +0000 (20:41 +0200)]
i386.md ("isa" attribute): Add sse_noavx.
* config/i386/i386.md ("isa" attribute): Add sse_noavx.
("enabled" attribute): Handle sse_noavx isa attribute.
* config/i386/mmx.md (*vec_dupv2sf): Add "isa" attribute.
Use TARGET_SSE && SSE_REGNO_P in split condition.
(*vec_dupv2sf): Ditto.
From-SVN: r272902
Segher Boessenkool [Mon, 1 Jul 2019 18:40:40 +0000 (20:40 +0200)]
rs6000.md (extenddf<mode>2_fprs): Make this a parameterized name.
@extenddf<mode>2_{fprs,vsx}
* config/rs6000/rs6000.md (extenddf<mode>2_fprs): Make this a
parameterized name.
(extenddf<mode>2_vsx): Make this a parameterized name.
(extenddf<mode>2): Use those names. Simplify.
From-SVN: r272901
Segher Boessenkool [Mon, 1 Jul 2019 18:39:52 +0000 (20:39 +0200)]
rs6000.md (eh_set_lr_<mode>): Make this a parameterized name.
@eh_set_lr_<mode>
* config/rs6000/rs6000.md (eh_set_lr_<mode>): Make this a parameterized
name.
(eh_return): Use that name. Simplify.
From-SVN: r272900
Segher Boessenkool [Mon, 1 Jul 2019 18:39:13 +0000 (20:39 +0200)]
rs6000.md (ctr<mode>): Make this a parameterized name.
@ctr<mode>
* config/rs6000/rs6000.md (ctr<mode>): Make this a parameterized name.
(doloop_end): Use that name. Simplify.
From-SVN: r272899
Segher Boessenkool [Mon, 1 Jul 2019 18:38:21 +0000 (20:38 +0200)]
rs6000.md (indirect_jump<mode>_nospec): Make this a parameterized name.
@indirect_jump<mode>_nospec
* config/rs6000/rs6000.md (indirect_jump<mode>_nospec): Make this a
parameterized name.
(indirect_jump): Use that name. Simplify.
From-SVN: r272898
Segher Boessenkool [Mon, 1 Jul 2019 18:37:25 +0000 (20:37 +0200)]
rs6000.md (abs<mode>2_internal): Make this a parameterized name.
@abs<mode>2_internal
* config/rs6000/rs6000.md (abs<mode>2_internal): Make this a
parameterized name.
(abs<mode>2): Use that name. Simplify.
From-SVN: r272897
Segher Boessenkool [Mon, 1 Jul 2019 18:36:34 +0000 (20:36 +0200)]
rs6000.md (fix_trunc<mode>si2_fprs): Make this a parameterized name.
@fix_trunc<mode>si2_fprs
* config/rs6000/rs6000.md (fix_trunc<mode>si2_fprs): Make this a
parameterized name.
(fix_trunc<mode>si2): Use that name. Simplify.
From-SVN: r272896
Segher Boessenkool [Mon, 1 Jul 2019 18:35:23 +0000 (20:35 +0200)]
rs6000.md (neg<mode>2): Make this a parameterized name.
@neg<mode>2
* config/rs6000/rs6000.md (neg<mode>2): Make this a parameterized name.
(allocate_stack): Use that name. Simplify.
From-SVN: r272894
Martin Sebor [Mon, 1 Jul 2019 18:33:36 +0000 (18:33 +0000)]
PR middle-end/90923 - hash_map destroys elements without constructing them
gcc/ChangeLog:
PR middle-end/90923
* hash-map.h (hash_map::put): On insertion invoke element ctor.
(hash_map::get_or_insert): Same. Reformat comment.
* hash-set.h (hash_set::add): On insertion invoke element ctor.
* hash-map-tests.c (test_map_of_type_with_ctor_and_dtor): New.
* hash-set-tests.c (test_map_of_type_with_ctor_and_dtor): New.
* hash-table.h (hash_table::operator=): Prevent copy assignment.
(hash_table::hash_table (const hash_table&)): Use copy ctor
instead of assignment to copy elements.
From-SVN: r272893
Wilco Dijkstra [Mon, 1 Jul 2019 16:55:42 +0000 (16:55 +0000)]
re PR target/90963 (FAIL: gcc.c-torture/execute/built-in-setjmp.c execution test)
PR target/90963
* config/pa/pa.md (builtin_longjmp): Restore hard_frame_pointer_rtx
using saved frame pointer.
Co-Authored-By: John David Anglin <danglin@gcc.gnu.org>
From-SVN: r272891
Eric Botcazou [Mon, 1 Jul 2019 16:26:38 +0000 (16:26 +0000)]
re PR middle-end/64242 (Longjmp expansion incorrect)
PR middle-end/64242
* config/sparc/sparc.md (nonlocal_goto): Restore frame pointer last.
Add frame clobber and schedule blockage.
From-SVN: r272889
Sandra Loosemore [Mon, 1 Jul 2019 15:42:49 +0000 (11:42 -0400)]
invoke.texi (Link Options): Further editorial changes to -flinker-output docs.
2019-07-01 Sandra Loosemore <sandra@codesourcery.com>
gcc/
* doc/invoke.texi (Link Options): Further editorial changes to
-flinker-output docs.
From-SVN: r272887
Segher Boessenkool [Mon, 1 Jul 2019 15:15:41 +0000 (17:15 +0200)]
rs6000: Improve indexed addressing
The function rs6000_force_indexed_or_indirect_mem makes a memory
operand suitable for indexed (or indirect) addressing. If the memory
address isn't yet valid, it loads the whole thing into a register to
make it valid. That isn't optimal. This changes it to load an
address that is the sum of two things into two registers instead.
This results in lower latency code, and if inside loops, a constant
term can be moved outside the loop.
* config/rs6000/rs6000.c (rs6000_force_indexed_or_indirect_mem):
Load both operands of a PLUS into registers separately.
From-SVN: r272886
Andreas Krebbel [Mon, 1 Jul 2019 14:59:43 +0000 (14:59 +0000)]
Fix changelog entry.
From-SVN: r272885
Andreas Krebbel [Mon, 1 Jul 2019 14:56:41 +0000 (14:56 +0000)]
S/390: Fix vector shift count operand
We currently use subst definitions to handle the different variants of shift
count operands. Unfortunately, in the vector shift pattern the shift count
operand is used directly. Without it being adjusted for the 'subst' variants the
displacement value is omitted resulting in a wrong shift count being applied.
This patch needs to be applied to older branches as well.
gcc/ChangeLog:
2019-07-01 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/vector.md:
gcc/testsuite/ChangeLog:
2019-07-01 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/vector/vec-shift-2.c: New test.
From-SVN: r272884
Ed Schonberg [Mon, 1 Jul 2019 13:37:47 +0000 (13:37 +0000)]
[Ada] Spurious error on inst. of partially defaulted formal package
This patch removes a spurious error on an instantiation whose generic
unit has a formal package where some formal parameters are
box-initialiaed. Previously the code assumed that box-initialization
for a formal package applied to all its formal parameters.
2019-07-01 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch12.adb (Is_Defaulted): New predicate in
Check_Formal_Package_Intance, to skip the conformance of checks
on parameters of a formal package that are defaulted,
gcc/testsuite/
* gnat.dg/generic_inst3.adb,
gnat.dg/generic_inst3_kafka_lib-topic.ads,
gnat.dg/generic_inst3_kafka_lib.ads,
gnat.dg/generic_inst3_markets.ads,
gnat.dg/generic_inst3_traits-encodables.ads,
gnat.dg/generic_inst3_traits.ads: New testcase.
From-SVN: r272883
Hristian Kirtchev [Mon, 1 Jul 2019 13:37:42 +0000 (13:37 +0000)]
[Ada] Minor reformatting
2019-07-01 Hristian Kirtchev <kirtchev@adacore.com>
gcc/ada/
* checks.adb, exp_ch9.adb, exp_unst.adb, sem_ch4.adb,
sem_prag.adb, sem_spark.adb: Minor reformatting.
From-SVN: r272882
Ed Schonberg [Mon, 1 Jul 2019 13:37:37 +0000 (13:37 +0000)]
[Ada] More permissive use of GNAT attribute Enum_Rep
This patch allows the prefix of the attribute Enum_Rep to be an
attribute referece (such as Enum_Type'First). A recent patch had
restricted the prefix to be an object of a discrete type, which is
incompatible with orevious usage.
2019-07-01 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_attr.adb (Analyze_Attribute, case Enum_Rep): Allow prefix
of attribute to be an attribute reference of a discrete type.
gcc/testsuite/
* gnat.dg/enum_rep.adb, gnat.dg/enum_rep.ads: New testcase.
From-SVN: r272881
Eric Botcazou [Mon, 1 Jul 2019 13:37:31 +0000 (13:37 +0000)]
[Ada] Make No_Inline pragma effective for generic subprograms
2019-07-01 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Move up
handling of Has_Pragma_Inline_Always and deal with
Has_Pragma_No_Inline.
From-SVN: r272880
Ed Schonberg [Mon, 1 Jul 2019 13:37:26 +0000 (13:37 +0000)]
[Ada] Spurious error private subtype derivation
This patch fixes a spurious error on a derived type declaration whose
subtype indication is a subtype of a private type whose full view is a
constrained discriminated type.
2019-07-01 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch3.adb (Build_Derived_Record_Type): If the parent type is
declared as a subtype of a private type with an inherited
discriminant constraint, its generated full base appears as a
record subtype, so we need to retrieve its oen base type so that
the inherited constraint can be applied to it.
gcc/testsuite/
* gnat.dg/derived_type6.adb, gnat.dg/derived_type6.ads: New
testcase.
From-SVN: r272879
Yannick Moy [Mon, 1 Jul 2019 13:37:21 +0000 (13:37 +0000)]
[Ada] SPARK support for pointers through ownership
SPARK RM 3.10 is the final version of the pointer ownership rules. Start
changing the implementation accordingly. Anonymous access types are not
fully supported yet.
There is no impact on compilation.
2019-07-01 Yannick Moy <moy@adacore.com>
gcc/ada/
* sem_spark.adb: Completely rework the algorithm for ownership
checking, as the rules in SPARK RM have changed a lot.
* sem_spark.ads: Update comments.
From-SVN: r272878
Dmitriy Anisimkov [Mon, 1 Jul 2019 13:37:16 +0000 (13:37 +0000)]
[Ada] GNAT.Sockets: refactor Has_Sockaddr_Len
Use a field offset computation trick to avoid maintaining a list of
platforms.
2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
gcc/ada/
* gsocket.h (Has_Sockaddr_Len): Use the offset of sin_family offset in
the sockaddr_in structure to determine the existence of length field
before the sin_family.
From-SVN: r272877