Commit Graph

177167 Commits

Author SHA1 Message Date
Arnaud Charlet 354cce532c [Ada] Avoid redefining IS_DIR_SEPARATOR macro
2020-06-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* adaint.c: Avoid redefining IS_DIR_SEPARATOR macro.
2020-06-04 05:11:09 -04:00
Arnaud Charlet c21938bee0 [Ada] Wrong walk order in Walk_Library_Items
2020-06-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem.adb (Walk_Library_Items): Defer processing of main spec
	after all other specs and before processing bodies.
2020-06-04 05:11:08 -04:00
Arnaud Charlet 1e01dddb44 [Ada] Import Adafinal as convention Ada
2020-06-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* bindgen.adb (Gen_Adafinal): Adafinal is convention Ada, not C.
2020-06-04 05:11:07 -04:00
Ed Schonberg 0b27ccce08 [Ada] Incorrect source line range on subprogram body with contract
2020-06-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sinput.adb (Sloc_Range): Ignore node in the tree if it appears
	in a unit different from that of the node whose Sloc range we
	are computing. This is necessary when computing the source range
	of a subprogram body whose declaration includes a pre- or
	postcondition, because declaration and body may appear in
	different units, and the expanded code for the body includes
	copies of the contract code.
2020-06-04 05:11:06 -04:00
Alexandre Oliva 593627b456 [Ada] Revamp dump and aux output names
2020-06-04  Alexandre Oliva  <oliva@adacore.com>

gcc/ada/

	* switch.adb (Is_Internal_GCC_Switch): Recognize dumpdir and
	dumpbase-ext.  Mark auxbase and auxbase-strip for removal.
2020-06-04 05:11:06 -04:00
Eric Botcazou d2f87b22d1 [Ada] Set convention and inlined flag on default null procedure
2020-06-04  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_attr.adb (Resolve_Attribute) <Access>: Do not generate
	the secondary message about a missing pragma if the convention
	of the prefix is Intrinsic.
	* sem_ch12.adb (Instantiate_Formal_Subprogram): Only set the
	Convention and the Is_Inlined flag on a null procedure.
2020-06-04 05:11:05 -04:00
Justin Squirek a0c94bd34a [Ada] Missing accessibility check on access discriminant in extended return
2020-06-04  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* sem_ch6.adb (Check_Return_Obj_Accessibility): Change to
	Check_Return_Construct_Accessibility to better reflect its
	purpose.  Add loop to properly obtain the object declaration
	from an expanded extended return statement and add calls to get
	the original node for associated values. Also, avoid checks when
	the return statement being examined comes from an internally
	generated function.
2020-06-04 05:11:04 -04:00
Dmitriy Anisimkov 7c02e403d1 [Ada] Fix Is_Absolute_Path on Windows
2020-06-04  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

	* adaint.c (__gnat_is_absolute_path): Check for directory
	separator after drive and colon.
	(IS_DIR_SEPARATOR): Define new inline substitution.
2020-06-04 05:11:03 -04:00
Eric Botcazou 51bc44b84a [Ada] Update the documentation in checks.ads about range checks
2020-06-04  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* checks.ads: Update documentation about range checks and fix
	minor other things.
2020-06-04 05:11:02 -04:00
Eric Botcazou d46b330ddc [Ada] Small tweak to special handling of private index types
2020-06-04  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch3.adb (Array_Type_Declaration): Apply special handling
	of private index types to generic packages and restrict it to
	index types defined in the current scope.
2020-06-04 05:11:02 -04:00
Arnaud Charlet 528576de0b [Ada] New procedure Register_Global_Unhandled_Action
2020-06-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/a-exextr.adb (Global_Unhandled_Action): New global
	variable.
	(Notify_Exception): Take into account Global_Unhandled_Action
	and fix latent race condition.
	(Exception_Action): Mark Favor_Top_Level so that variables can
	be atomic.
	(Global_Action): Mark atomic to remove the need for a lock.
	* libgnat/g-excact.ads, libgnat/g-excact.adb
	(Register_Global_Unhandled_Action): New procedure.
	(Register_Global_Action): Remove lock.
	* libgnat/s-stalib.ads (Raise_Action): Mark Favor_Top_Level to
	be compatible with Exception_Action.
	* sem_warn.adb (Warn_On_Unreferenced_Entity): Fix logic wrt
	Volatile entities and entities with an address clause: the code
	did not match the comment/intent.
2020-06-04 05:11:01 -04:00
Arnaud Charlet 32cc672033 [Ada] Update URL and bug report instructions
2020-06-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* comperr.adb (Compiler_Abort): Update URL and bug report
	instructions.
2020-06-04 05:11:00 -04:00
Steve Baird b5682bf40c [Ada] Avoid buffer overflow in Long_Long_Float_Text_IO
2020-06-04  Steve Baird  <baird@adacore.com>

gcc/ada/

	* libgnat/s-imgrea.ads: Declare a named number
	Max_Real_Image_Length with value 5200.  Provide a comment
	explaining why this value was chosen.
	* libgnat/s-imgrea.adb (Set_Image_Real): Increase the upper
	bound of the local String variable Digs to
	Max_Real_Image_Length.
	* libgnat/a-tiflau.adb (Put): Increase the upper bound of the
	local String variable Buf to Max_Real_Image_Length.
	(Puts): Increase the upper bound of the local String variable
	Buf to Max_Real_Image_Length.
2020-06-04 05:10:59 -04:00
Arnaud Charlet b68c1670b7 [Ada] Remove System.Parameters.Single_Lock
2020-06-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnarl/a-dynpri.adb, libgnarl/a-taside.adb,
	libgnarl/a-taster.adb, libgnarl/s-interr.adb,
	libgnarl/s-interr__sigaction.adb, libgnarl/s-taasde.adb,
	libgnarl/s-taenca.adb, libgnarl/s-taenca.ads,
	libgnarl/s-taprop.ads, libgnarl/s-taprop__hpux-dce.adb,
	libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb,
	libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb,
	libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb,
	libgnarl/s-tarest.adb, libgnarl/s-tasini.adb,
	libgnarl/s-tasque.adb, libgnarl/s-tasque.ads,
	libgnarl/s-tasren.adb, libgnarl/s-tasren.ads,
	libgnarl/s-tassta.adb, libgnarl/s-tasuti.adb,
	libgnarl/s-tasuti.ads, libgnarl/s-tpoben.adb,
	libgnarl/s-tpobop.adb, libgnarl/s-tpopmo.adb,
	libgnarl/s-tposen.adb, libgnat/s-parame.ads,
	libgnat/s-parame__ae653.ads, libgnat/s-parame__hpux.ads,
	libgnat/s-parame__vxworks.ads: Remove references to Single_Lock
	and Global_Lock.
2020-06-04 05:10:58 -04:00
Arnaud Charlet bbe376e136 [Ada] Continuation of "Get rid of more references to Universal_Integer"
2020-06-04  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/s-atopar.adb, libgnat/s-atopex.adb: Use Object_Size
	instead of Size, otherwise many derived types will be rejected
	(e.g. a type with a 14 bits 'Size and a 16 bits 'Object_Size).
2020-06-04 05:10:58 -04:00
Eric Botcazou 8b3bf48a31 [Ada] Add another ad-hoc case to the Has_Private_View mechanism
2020-06-04  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch12.adb (Copy_Generic_Node): Add special handling for a
	conversion between access types.
2020-06-04 05:10:57 -04:00
Eric Botcazou 8a91f77d3a [Ada] Fix fallout of cleanup to Has_Private_View mechanism
2020-06-04  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch12.adb (Check_Generic_Actuals): Also restore the proper
	views of the actuals of the parent instances if the formals are
	used as actuals of the children.
	(Instantiate_Type): Add comment.
2020-06-04 05:10:56 -04:00
Gary Dismukes 9f3a17960b [Ada] Minor editorial fixes
2020-06-04  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

	* sem_ch12.adb: Minor editorial fixes.
2020-06-04 05:10:55 -04:00
Hao Liu 54ecfb182b cselim: Extend to check non-trapping for more references [PR89430]
If there is a dominating store, a store to the same reference can not be
trapped.  But previously, it only supports such check on MEM_REFs.
So this patch extends it to support ARRAY_REFs and COMPONENT_REFs.

This patch also supports a special case: if there is a dominating load of
local variable without address escape, a store is not trapped, as local
stack is always writable.  Other loads are ignored for simplicity, as they
don't help to check if a store can be trapped (the memory may be read-only).

gcc/ChangeLog:

	PR tree-optimization/89430
	* tree-ssa-phiopt.c
	(struct name_to_bb): Rename to ref_to_bb; add a new field exp;
	remove ssa_name_ver, store, offset fields.
	(struct ssa_names_hasher): Rename to refs_hasher; update functions.
	(class nontrapping_dom_walker): Rename m_seen_ssa_names to m_seen_refs.
	(nontrapping_dom_walker::add_or_mark_expr): Extend to support ARRAY_REFs
	and COMPONENT_REFs.

gcc/testsuite/ChangeLog:

	PR tree-optimization/89430
	* gcc.dg/tree-ssa/pr89430-1.c: Remove xfail.
	* gcc.dg/tree-ssa/pr89430-2.c: Remove xfail.
	* gcc.dg/tree-ssa/pr89430-5.c: Remove xfail.
	* gcc.dg/tree-ssa/pr89430-6.c: Remove xfail.
	* gcc.dg/tree-ssa/pr89430-7-comp-ref.c: New test.
	* gcc.dg/tree-ssa/pr89430-8-mem-ref-size.c: New test.
	* gcc.dg/tree-ssa/ssa-pre-17.c: Add -fno-tree-cselim.
2020-06-04 17:04:09 +08:00
Andreas Schwab 9b4e77e807 Fix missing assemble_external in ASM_OUTPUT_FDESC
When TARGET_VTABLE_USES_DESCRIPTORS is defined then function pointers in
the vtable are output by ASM_OUTPUT_FDESC.  The only current user of
this is ia64, but its implementation of ASM_OUTPUT_FDESC lacks a call to
assemble_external.  Thus if there is no other reference to the function
the weak declaration for it will be missing.

	PR target/95154
	* config/ia64/ia64.h (ASM_OUTPUT_FDESC): Call assemble_external.
2020-06-04 09:56:38 +02:00
Andreas Schwab 0ecf522972 Missing __divtf3@@GCC_4.4.0 on ia64
gcc/testsuite/
	PR libfortran/59227
	* gfortran.dg/erf_3.F90: Remove XFAIL on ia64-*-linux*.

libgcc/
	PR target/59230
	PR libfortran/59227
	* config/ia64/t-softfp-compat (softfp_file_list): Filter out
	soft-fp/divtf3.c.
	(LIB2ADD): Add config/ia64/divtf3.c.
	* config/ia64/divtf3.c: New file.
2020-06-04 09:56:32 +02:00
liuhongt c0b99f6763 Fix uppercase in trunc<mode><pmov_dst_3>2.
2020-06-04  Hongtao.liu  <hongtao.liu@intel.com>

gcc/ChangeLog:
	* config/i386/sse.md (pmov_dst_3_lower): New mode attribute.
	(trunc<mode><pmov_dst_3_lower>2): Refine from
	trunc<mode><pmov_dst_3>2.

gcc/testsuite
	* gcc.target/i386/pr92658-avx512bw-trunc.c: Adjust testcase.
2020-06-04 15:48:24 +08:00
Jakub Jelinek eeb54a14c4 c++: Reject some further reinterpret casts in constexpr [PR82304, PR95307]
cxx_eval_outermost_constant_expr had a check for reinterpret_casts from
pointers (well, it checked from ADDR_EXPRs) to integral type, but that
only caught such cases at the toplevel of expressions.
As the comment said, it should be done even inside of the expressions,
but at the point of the writing e.g. pointer differences used to be a
problem.  We now have POINTER_DIFF_EXPR, so this is no longer an issue.

Had to do it just for CONVERT_EXPR, because the FE emits NOP_EXPR casts
from pointers to integrals in various spots, e.g. for the PMR & 1 tests,
though on NOP_EXPR we have the REINTERPRET_CAST_P bit that we do check,
while on CONVERT_EXPR we don't.

2020-06-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/82304
	PR c++/95307
	* constexpr.c (cxx_eval_constant_expression): Diagnose CONVERT_EXPR
	conversions from pointer types to arithmetic types here...
	(cxx_eval_outermost_constant_expr): ... instead of here.

	* g++.dg/template/pr79650.C: Expect different diagnostics and expect
	it on all lines that do pointer to integer casts.
	* g++.dg/cpp1y/constexpr-shift1.C: Expect different diagnostics.
	* g++.dg/cpp1y/constexpr-82304.C: New test.
	* g++.dg/cpp0x/constexpr-95307.C: New test.
2020-06-04 09:09:01 +02:00
GCC Administrator 9a5b7438c8 Daily bump. 2020-06-04 00:16:34 +00:00
Mark Wielaard 1dc83b4606 Provide diagnostic hints for missing C++ cinttypes string constants.
When reporting an error in cp_parser and we notice a string literal
followed by an unknown name check whether there is a known standard
header containing a string macro with the same name, then add a hint
to the error message to include that header.

gcc/c-family/ChangeLog:

	* known-headers.cc (get_cp_stdlib_header_for_string_macro_name):
	New function.
	* known-headers.h (get_cp_stdlib_header_for_string_macro_name):
	New function declaration.

gcc/cp/ChangeLog:

	* parser.c (cp_lexer_safe_previous_token): New function.
	(cp_parser_error_1): Add name_hint if the previous token is
	a string literal and next token is a CPP_NAME and we have a
	missing header suggestion for the name.

gcc/testsuite/ChangeLog:

	* g++.dg/spellcheck-inttypes.C: Add string-literal testcases.
2020-06-04 01:22:53 +02:00
Mark Wielaard 9eea5d2ddf Provide diagnostic hints for missing C inttypes.h string constants.
This adds a flag to c_parser so we know when we were trying to
construct a string literal. If there is a parse error and we were
constructing a string literal, and the next token is an unknown
identifier name, and we know there is a standard header that defines
that name as a string literal, then add a missing header hint to
the error messsage.

The list of macro names are also used when providing a hint for
missing identifiers.

gcc/c-family/ChangeLog:

	* known-headers.cc (get_string_macro_hint): New function.
	(get_stdlib_header_for_name): Use get_string_macro_hint.
	(get_c_stdlib_header_for_string_macro_name): New function.
	* known-headers.h (get_c_stdlib_header_for_string_macro_name):
	New function declaration.

gcc/c/ChangeLog:

	* c-parser.c (struct c_parser): Add seen_string_literal
	bitfield.
	(c_parser_consume_token): Reset seen_string_literal.
	(c_parser_error_richloc): Add name_hint if seen_string_literal
	and next token is a CPP_NAME and we have a missing header
	suggestion for the name.
	(c_parser_string_literal): Set seen_string_literal.

gcc/testsuite/ChangeLog:

	* gcc.dg/spellcheck-inttypes.c: New test.
	* g++.dg/spellcheck-inttypes.C: Likewise.
2020-06-04 01:22:52 +02:00
Mark Wielaard 34e4962aed diagnostics: Add function call parens matching to c_parser.
The C++ parser already tracks function call parens matching, but the C
parser doesn't. This adds the same functionality to the C parser and adds
a testcase showing the C++ and C parser matching function call parens
in an error message.

gcc/c/ChangeLog:

	* c-parser.c (c_parser_postfix_expression_after_primary): Add
	scope with matching_parens after CPP_OPEN_PAREN.

gcc/testsuite/ChangeLog:

	* c-c++-common/missing-close-func-paren.c: New test.
2020-06-04 01:15:56 +02:00
Vitor Guidi 29e304fd5f optimize tanh(x) / sinh (x) to 1/ cosh (x)
gcc/
	* match.pd (tanh/sinh -> 1/cosh): New simplification.

gcc/testsuite

	* gcc.dg/tanhbysinh.c: New testcase.
2020-06-03 17:01:21 -06:00
Joseph Myers 817738fdf1 Update gcc sv.po.
* sv.po: Update.
2020-06-03 22:18:54 +00:00
Aaron Sawdey c0d738a0f4 identify lfs prefixed case PR95347
The same problem also arises for plfs where prefixed_load_p()
doesn't recognize it so we get just lfs in the asm output
with an @pcrel address.

	PR target/95347
	* config/rs6000/rs6000.c (is_stfs_insn): Rename to
	is_lfs_stfs_insn and make it recognize lfs as well.
	(prefixed_store_p): Use is_lfs_stfs_insn().
	(prefixed_load_p): Use is_lfs_stfs_insn() to recognize lfs.
2020-06-03 16:01:27 -05:00
Patrick Palka c06280ac4c c++: more constrained nested partial specialization
When checking that a constrained partial specialization is more
constrained than the primary template, we pass only the innermost level
of generic template arguments to strictly_subsumes.  This leads to us
doing a nonsensical substitution from normalize_concept_check if the
full set of template arguments has multiple levels, and it ultimately
causes strictly_subsumes to sometimes erroneously return false as in the
testcase below.

gcc/cp/ChangeLog:

	* pt.c (process_partial_specialization): Pass the full set of
	generic template arguments to strictly_subsumes.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/concepts-partial-spec8.C: New test.
2020-06-03 16:40:34 -04:00
Patrick Palka aee69073cd c++: constrained nested partial specialization [PR92103]
When determining the most specialized partial specialization of a
primary template that is nested inside a class template, we first
tsubst the outer template arguments into the TEMPLATE_DECL of each
partial specialization, and then check for satisfaction of each of the
new TEMPLATE_DECL's constraints.

But tsubst_template_decl does not currently guarantee that constraints
from the original DECL_TEMPLATE_RESULT get reattached to the new
DECL_TEMPLATE_RESULT.  In the testcase below, this leads to the
constraints_satisfied_p check in most_specialized_partial_spec to
trivially return true for each of the partial specializations.

I'm not sure if such a guarantee would be desirable, but in this case we
can just check constraints_satisfied_p on the original TEMPLATE_DECL
instead of on the tsubsted TEMPLATE_DECL here, which is what this patch
does (alongside some reorganizing).

gcc/cp/ChangeLog:

	PR c++/92103
	* pt.c (most_specialized_partial_spec): Reorganize the loop over
	DECL_TEMPLATE_SPECIALIZATIONS.  Check constraints_satisfied_p on
	the original template declaration, not on the tsubsted one.

gcc/testsuite/ChangeLog:

	PR c++/92103
	* g++.dg/cpp2a/concepts-partial-spec7.C: New test.
2020-06-03 16:40:28 -04:00
Jan Hubicka 3fb68f2e66 Optimize ODR enum streaming
it turns out that half of the global decl stream of cc1 LTO build consits
TREE_LISTS, identifiers and integer cosntats representing TYPE_VALUES of enums.
Those are streamed only to produce ODR warning and used otherwise, so this
patch moves the info to a separate section that is represented and streamed
more effectively.

This also adds place for more info that may be used for ODR diagnostics
(i.e. at the moment we do not warn when the declarations differs i.e. by the
associated member functions and their types) and the type inheritance graph
rather then poluting the global stream.

I was bit unsure what enums we want to store into the section.  All parsed
enums is probably too expensive, only those enums streamed to represent IL is
bit hard to get, so I went for those seen by free lang data.

As a plus we now get bit more precise warning because also the location of
mismatched enum CONST_DECL is streamed.

It changes:
[WPA] read 4608466 unshared trees
[WPA] read 2942094 mergeable SCCs of average size 1.365328
[WPA] 8625389 tree bodies read in total
[WPA] tree SCC table: size 524287, 247652 elements, collision ratio: 0.383702
[WPA] tree SCC max chain length 2 (size 1)
[WPA] Compared 2694442 SCCs, 228 collisions (0.000085)
[WPA] Merged 2694419 SCCs
[WPA] Merged 3731982 tree bodies
[WPA] Merged 633335 types
[WPA] 122077 types prevailed (155548 associated trees)
...
[WPA] Compression: 110593119 input bytes, 287696614 uncompressed bytes (ratio: 2.601397)
[WPA] Size of mmap'd section decls: 85628556 bytes
[WPA] Size of mmap'd section function_body: 13842928 bytes

[WPA] read 1720989 unshared trees
[WPA] read 1252217 mergeable SCCs of average size 1.858507
[WPA] 4048243 tree bodies read in total
[WPA] tree SCC table: size 524287, 226524 elements, collision ratio: 0.491759
[WPA] tree SCC max chain length 2 (size 1)
[WPA] Compared 1025693 SCCs, 196 collisions (0.000191)
[WPA] Merged 1025670 SCCs
[WPA] Merged 2063373 tree bodies
[WPA] Merged 633497 types
[WPA] 122299 types prevailed (155827 associated trees)
...
[WPA] Compression: 103428770 input bytes, 281151423 uncompressed bytes (ratio: 2.718310)
[WPA] Size of mmap'd section decls: 49390917 bytes
[WPA] Size of mmap'd section function_body: 13858258 bytes
...
[WPA] Size of mmap'd section odr_types: 29054816 bytes

So number of SCCs streamed drops to 38% and the number of unshared trees (that
are bit misnamed since it is mostly integer_cst) to 37%.

Things speeds up correspondingly, but I did not save time report from previous
build.

The enum values are still quite surprisingly large.  I may take a look into
ways getting it smaller incrementally, but it streams reasonably fast:

Time variable                                   usr           sys          wall               GGC
 phase opt and generate             :  25.20 ( 68%)  10.88 ( 72%)  36.13 ( 69%)  868060 kB ( 52%)
 phase stream in                    :   4.46 ( 12%)   0.90 (  6%)   5.38 ( 10%)  790724 kB ( 48%)
 phase stream out                   :   6.69 ( 18%)   3.32 ( 22%)  10.03 ( 19%)       8 kB (  0%)
 ipa lto gimple in                  :   0.79 (  2%)   1.86 ( 12%)   2.39 (  5%)  252612 kB ( 15%)
 ipa lto gimple out                 :   2.48 (  7%)   0.78 (  5%)   3.26 (  6%)       0 kB (  0%)
 ipa lto decl in                    :   1.71 (  5%)   0.46 (  3%)   2.34 (  4%)  417883 kB ( 25%)
 ipa lto decl out                   :   3.28 (  9%)   0.07 (  0%)   3.27 (  6%)       0 kB (  0%)
 whopr wpa I/O                      :   0.40 (  1%)   2.24 ( 15%)   2.77 (  5%)       8 kB (  0%)
 lto stream decompression           :   1.38 (  4%)   0.31 (  2%)   1.36 (  3%)       0 kB (  0%)
 ipa ODR types                      :   0.18 (  0%)   0.02 (  0%)   0.25 (  0%)       0 kB (  0%)
 ipa inlining heuristics            :  11.64 ( 31%)   1.45 ( 10%)  13.12 ( 25%)  453160 kB ( 27%)
 ipa pure const                     :   1.74 (  5%)   0.00 (  0%)   1.76 (  3%)       0 kB (  0%)
 ipa icf                            :   1.72 (  5%)   5.33 ( 35%)   7.06 ( 13%)   16593 kB (  1%)
 whopr partitioning                 :   2.22 (  6%)   0.01 (  0%)   2.23 (  4%)    5689 kB (  0%)
 TOTAL                              :  37.17         15.20         52.46        1660886 kB

LTO-bootstrapped/regtested x86_64-linux, will comit it shortly.

gcc/ChangeLog:

2020-06-03  Jan Hubicka  <hubicka@ucw.cz>

	* ipa-devirt.c: Include data-streamer.h, lto-streamer.h and
	streamer-hooks.h.
	(odr_enums): New static var.
	(struct odr_enum_val): New struct.
	(class odr_enum): New struct.
	(odr_enum_map): New hashtable.
	(odr_types_equivalent_p): Drop code testing TYPE_VALUES.
	(add_type_duplicate): Likewise.
	(free_odr_warning_data): Do not free TYPE_VALUES.
	(register_odr_enum): New function.
	(ipa_odr_summary_write): New function.
	(ipa_odr_read_section): New function.
	(ipa_odr_summary_read): New function.
	(class pass_ipa_odr): New pass.
	(make_pass_ipa_odr): New function.
	* ipa-utils.h (register_odr_enum): Declare.
	* lto-section-in.c: (lto_section_name): Add odr_types section.
	* lto-streamer.h (enum lto_section_type): Add odr_types section.
	* passes.def: Add odr_types pass.
	* lto-streamer-out.c (DFS::DFS_write_tree_body): Do not stream
	TYPE_VALUES.
	(hash_tree): Likewise.
	* tree-streamer-in.c (lto_input_ts_type_non_common_tree_pointers):
	Likewise.
	* tree-streamer-out.c (write_ts_type_non_common_tree_pointers):
	Likewise.
	* timevar.def (TV_IPA_ODR): New timervar.
	* tree-pass.h (make_pass_ipa_odr): Declare.
	* tree.c (free_lang_data_in_type): Regiser ODR types.

gcc/lto/ChangeLog:

2020-06-03  Jan Hubicka  <hubicka@ucw.cz>

	* lto-common.c (compare_tree_sccs_1): Do not compare TYPE_VALUES.

gcc/testsuite/ChangeLog:

2020-06-03  Jan Hubicka  <hubicka@ucw.cz>

	* g++.dg/lto/pr84805_0.C: Update.
2020-06-03 21:24:38 +02:00
Iain Sandoe cf7eac5805 coroutines: Allow parameter packs in co_await/yield expressions [PR95345]
This corrects a pasto, where I copied the constraint on bare
parameter packs from the co_return to co_yield/await without
properly reviewing it.

gcc/cp/ChangeLog:

	PR c++/95345
	* coroutines.cc (finish_co_await_expr): Revise to allow for
	parameter packs.
	(finish_co_yield_expr): Likewise.

gcc/testsuite/ChangeLog:

	PR c++/95345
	* g++.dg/coroutines/pr95345.C: New test.
2020-06-03 20:23:59 +01:00
Romain Naour b19d8aac15 Fix missing dependencies for selftests which occasionally causes failed builds.
gcc/

	* Makefile.in (SELFTEST_DEPS): Move before including language makefile
	fragments.
2020-06-03 12:32:53 -06:00
Jason Merrill ef4e0c3554 c++: Fix VLA in template [PR95232]
In a non-template, grokdeclarator notices when we build a pointer to a
variably-modified type, and inserts a TYPE_DECL to make sure that type gets
gimplified.  But in a template we can't always recognize a variably-modified
type, so we need to deal with it at instantiation time.

gcc/cp/ChangeLog:

	PR c++/95232
	* cp-tree.h (predeclare_vla): Declare.
	* cp-gimplify.c (predeclare_vla): Handle getting a decl.
	* pt.c (tsubst_expr) [DECL_EXPR]: Use it.

gcc/testsuite/ChangeLog:

	PR c++/95232
	* g++.dg/ubsan/vla-2.C: New test.
2020-06-03 14:06:17 -04:00
José Rui Faustino de Sousa 8d57c30611 Simple patch only add assumed-rank to the list of possible attributes.
gcc/fortran/ChangeLog:

2020-06-03  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/95214
	PR fortran/66833
	PR fortran/67938
	* trans-expr.c (gfc_maybe_dereference_var): Add assumed-rank to
	character dummy arguments list of possible attributes.

gcc/testsuite/ChangeLog:

2020-06-03  José Rui Faustino de Sousa  <jrfsousa@gmail.com>

	PR fortran/95214
	PR fortran/66833
	PR fortran/67938
	* gfortran.dg/PR95214.f90: New test.
2020-06-03 19:38:22 +02:00
Richard Biener 887c45fb5b tree-optimization/95487 - use a truth type for scatter masks
This makes sure to get a truth type for scatter masks even when they
are invariant.

2020-06-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95487
	* tree-vect-stmts.c (vectorizable_store): Use a truth type
	for the scatter mask.

	* g++.dg/vect/pr95487.cc: New testcase.
2020-06-03 18:59:13 +02:00
David Malcolm 6d36cc21b6 jit: implement BT_CONST_VOLATILE_PTR [PR 95306]
gcc/jit/ChangeLog:
	PR jit/95306
	* jit-builtins.c (builtins_manager::make_primitive_type):
	Implement BT_CONST_VOLATILE_PTR.

gcc/testsuite/ChangeLog:
	PR jit/95306
	* jit.dg/test-pr95306-builtin-types.c (create_code): Add
	test of getting __atomic_load.
2020-06-03 11:14:46 -04:00
Richard Biener 779ae320bf tree-optimization/95495 - use SLP_TREE_REPRESENTATIVE in assertion
This fixes a place where I missed to use SLP_TREE_REPRESENTATIVE
after its introduction.

2020-06-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/95495
	* tree-vect-slp.c (vect_slp_analyze_node_operations): Use
	SLP_TREE_REPRESENTATIVE in the shift assertion.

	* gcc.dg/vect/pr95495.c: New testcase.
2020-06-03 16:51:05 +02:00
Tom Tromey 079632de49 Prefer simple case changes in spelling suggestions
I got this error message when editing gcc and recompiling:

../../gcc/gcc/ada/gcc-interface/decl.c:7714:39: error: ‘DWARF_GNAT_ENCODINGS_all’ was not declared in this scope; did you mean ‘DWARF_GNAT_ENCODINGS_GDB’?
 7714 |     = debug_info && gnat_encodings == DWARF_GNAT_ENCODINGS_all;
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
      |                                       DWARF_GNAT_ENCODINGS_GDB

This suggestion could be improved -- what happened here is that I
failed to upper-case the word, and DWARF_GNAT_ENCODINGS_ALL was the
correct spelling.

This patch changes gcc's spell checker to prefer simple case changes
when possible.

I tested this using the self-tests.  A new self-test is also included.

gcc/ChangeLog:

	* spellcheck.c (CASE_COST): New define.
	(BASE_COST): New define.
	(get_edit_distance): Recognize case changes.
	(get_edit_distance_cutoff): Update.
	(test_edit_distances): Update.
	(get_old_cutoff): Update.
	(test_find_closest_string): Add case sensitivity test.
2020-06-03 06:19:06 -06:00
Richard Biener f05c84ac13 simplify visited flag unsetting in SLP scalar cost computation
This changes the loop over all stmts to a loop over all costed stmts.

2020-06-03  Richard Biener  <rguenther@suse.de>

	* tree-vect-slp.c (vect_bb_vectorization_profitable_p): Loop over
	the cost vector to unset the visited flag on stmts.
2020-06-03 13:18:55 +02:00
Tobias Burnus 93535a2b40 [OpenMP] Fix mapping of artificial variables (PR94874)
gcc/c-family/ChangeLog:

	* c-common.h (c_omp_predetermined_mapping): Declare.
	* c-omp.c (c_omp_predetermined_mapping): New.

gcc/c/ChangeLog:

	* c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine.

gcc/cp/ChangeLog:

	* cp-gimplify.c (cxx_omp_predetermined_mapping): New.
	* cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine.
	* cp-tree.h (cxx_omp_predetermined_mapping): Declare.

gcc/fortran/ChangeLog:

	* f95-lang.c (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine.
	* trans-openmp.c (gfc_omp_predetermined_mapping): New.
	* trans.h (gfc_omp_predetermined_mapping): Declare.

gcc/ChangeLog:

	* gimplify.c (omp_notice_variable): Use new hook.
	* langhooks-def.h (lhd_omp_predetermined_mapping): Declare.
	(LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Define
	(LANG_HOOKS_DECLS): Add it.
	* langhooks.c (lhd_omp_predetermined_sharing): Remove bogus unused attr.
	(lhd_omp_predetermined_mapping): New.
	* langhooks.h (struct lang_hooks_for_decls): Add new hook.

gcc/testsuite/ChangeLog
2020-06-03  Thomas Schwinge  <thomas@codesourcery.com>
	    Tobias Burnus  <tobias@codesourcery.com>

	PR middle-end/94874
	* c-c++-common/gomp/pr94874.c: New.
2020-06-03 12:30:04 +02:00
Jan Hubicka dda7167051 Cleanup LTO tag streaming.
this patch cleanups a bit the way LTO tags are assigned (so we do not use magic
numbers of 2) and reorders them approximately by their frequency so the stream
gets little bit smaller because of uleb coding.

From:

[WPA] Compression: 111213968 input bytes, 293801489 uncompressed bytes (ratio: 2.641768)
[WPA] Size of mmap'd section decls: 85983129 bytes
[WPA] Size of mmap'd section function_body: 14058627 bytes

to:

[WPA] Compression: 110593119 input bytes, 287696614 uncompressed bytes (ratio: 2.601397)
[WPA] Size of mmap'd section decls: 85628556 bytes
[WPA] Size of mmap'd section function_body: 13842928 bytes

lto-bootstrapped/regtested x86_64-linux, will commit it shortly.

	* lto-streamer.h (LTO_tags): Reorder so frequent tags has small indexes;
	add LTO_first_tree_tag and LTO_first_gimple_tag.
	(lto_tag_is_tree_code_p): Update.
	(lto_tag_is_gimple_code_p): Update.
	(lto_gimple_code_to_tag): Update.
	(lto_tag_to_gimple_code): Update.
	(lto_tree_code_to_tag): Update.
	(lto_tag_to_tree_code): Update.
2020-06-03 12:10:22 +02:00
Eric Botcazou 4fc2610a83 [Ada] Fix for missing calls to Adjust primitive with nested generics
2020-06-03  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch12.adb (Denotes_Previous_Actual): Delete.
	(Check_Generic_Actuals): Do not special case array types whose
	component type denotes a previous actual.  Do not special case
	access types whose base type is private.
	(Check_Private_View): Remove code dealing with secondary types.
	Do not switch the views of an array because of its component.
	(Copy_Generic_Node): Add special handling for a comparison
	operator on array types.
	(Instantiate_Type): Do not special case access types whose
	designated type is private.
	(Set_Global_Type): Do not special case array types whose
	component type is private.
2020-06-03 06:01:49 -04:00
Justin Squirek 48b185bd01 [Ada] Spurious ineffective with clause warnings on use type clause
2020-06-03  Justin Squirek  <squirek@adacore.com>

gcc/ada/

	* sem_ch10.adb (Process_Body_Clauses): Add loop to interate
	through all prefixes in a use_type clause so that all packages
	in the expanded name get examined for effectiveness.
2020-06-03 06:01:48 -04:00
Eric Botcazou dca8f39d62 [Ada] Small housekeeping work in Check_Private_View
2020-06-03  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_ch12.adb (Check_Private_View): Clean up implementation of
	second main case, when the generic sees the private declaration.
2020-06-03 06:01:47 -04:00
Arnaud Charlet 3f06f6c30a [Ada] Add detection of uninitialized big reals
2020-06-03  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/a-nbnbin.ads: Minor reformatting.
	* libgnat/a-nbnbre.ads, libgnat/a-nbnbre.adb (Is_Valid): Add
	convention Intrinsic. Add detection of uninitialized big reals.
2020-06-03 06:01:46 -04:00
Arnaud Charlet e4ef65f904 [Ada] Remove more cases of empty loops
2020-06-03  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_util.ads, sem_util.adb (Side_Effect_Free_Statements,
	Side_Effect_Free_Loop): New functions.
	(Has_Non_Null_Statements): Consider N_Call_Marker as a null
	statement.
	* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Call
	Set_Is_Null_Loop even inside a generic instantiation.
	(Analyze_Loop_Statement): Mark for removal loops with no side
	effects.
2020-06-03 06:01:45 -04:00
Eric Botcazou 415c22da94 [Ada] Support pragma Allow_Integer_Address on 64-bit targets
2020-06-03  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* opt.ads (Allow_Integer_Address): Fix typo in comment.
	* stand.ads (Standard_Address): New entity.
	* cstand.adb (Create_Standard): Create it.
	* sem_ch4.adb (Operator_Check): Convert the operands of an
	operation with addresses and integers to Standard_Address
	if pragma Allow_Integer_Address is in effect.
2020-06-03 06:01:44 -04:00