Eric Botcazou [Fri, 28 Feb 2020 11:46:58 +0000 (12:46 +0100)]
[Ada] Propagate DIC, Invariant and Predicate attributes to views
2020-06-09 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* checks.adb (Apply_Predicate_Check): Extend trick used for
aggregates to qualified aggregates and object declarations
* einfo.ads (Has_Own_DIC): Mention the underlying full view.
(Has_Own_Invariants): Likewise.
(Has_Predicates): Likewise.
* exp_util.adb (Build_DIC_Procedure_Declaration): Do not deal
with base types explicitly but with underlying full views.
(Build_Invariant_Procedure_Declaration): Likewise.
* sem_ch13.adb (Build_Predicate_Functions): Do not deal with
the full view manually but call Propagate_Predicate_Attributes
to propagate attributes to views.
(Build_Predicate_Function_Declaration): Likewise.
* sem_ch3.adb (Build_Assertion_Bodies_For_Type): Build bodies
for private full views with an underlying full view.
(Build_Derived_Private_Type): Small comment tweak.
(Complete_Private_Subtype): Call Propagate_Predicate_Attributes.
(Process_Full_View): Do not deal with base types explicitly for
DIC and Invariant attributes. Deal with underlying full views
for them. Call Propagate_Predicate_Attributes and deal with
underlying full views for them.
* sem_ch7.adb (Preserve_Full_Attributes): Do not cross propagate
DIC and Invariant attributes between full type and its base type.
Propagate Predicate attributes from the full to the private view.
* sem_ch9.adb (Analyze_Protected_Type_Declaration): Likewise.
(Analyze_Task_Type_Declaration): Likewise.
* sem_util.ads (Get_Views): Remove Full_Base parameter and add
UFull_Typ parameter.
(Propagate_Predicate_Attributes): New procedure.
* sem_util.adb (Get_Views): Remove Full_Base parameter and add
UFull_Typ parameter. Retrieve the Corresponding_Record_Type
from the underlying full view, if any.
(Propagate_DIC_Attributes): Remove useless tests.
(Propagate_Invariant_Attributes): Likewise.
(Propagate_Predicate_Attributes): New procedure.
Justin Squirek [Fri, 28 Feb 2020 15:21:38 +0000 (10:21 -0500)]
[Ada] Crash on exit statement within predicated loop
2020-06-09 Justin Squirek <squirek@adacore.com>
gcc/ada/
* exp_ch5.adb (Expand_Predicated_Loop): Perserve the original
loop identifier within the expansion.
Bob Duff [Fri, 28 Feb 2020 14:46:07 +0000 (09:46 -0500)]
[Ada] gnatbind: Correct assertions in Add_Edge_Kind_Check
2020-06-09 Bob Duff <duff@adacore.com>
gcc/ada/
* bindo-graphs.ads (Library_Graph_Edge_Kind): Reorder enumerals
to reflect the order of adding edges. Clarify comments.
* bindo-graphs.adb (Add_Edge_Kind_Check): Correct the
assertions. Reorder the "when"s to match the order of adding
edges, and therefore the order of enumerals in type
Library_Graph_Edge_Kind. Change names to "Old_" and "New_" to
clarify what's what. Combine Invocation_Edge into the "<="
test. Fix the "raise Program_Error" message, which was
backwards.
Bob Duff [Thu, 27 Feb 2020 15:49:47 +0000 (10:49 -0500)]
[Ada] Add debugging message
2020-06-09 Bob Duff <duff@adacore.com>
gcc/ada/
* bindo-graphs.adb (Add_Edge_Kind_Check): Add the Image of the
old and new Kinds to the raise Program_Error message.
Eric Botcazou [Thu, 27 Feb 2020 16:02:14 +0000 (17:02 +0100)]
[Ada] Remove bypass for instance bodies from Is_Visible_Component
2020-06-09 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_ch3.adb (Is_Visible_Component): Do not special-case
bodies of instances.
Arnaud Charlet [Thu, 27 Feb 2020 09:28:04 +0000 (04:28 -0500)]
[Ada] Membership test against a non-excluding subtype
2020-06-09 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* exp_ch4.adb (Expand_N_In): Fix handling of null exclusion.
Ed Schonberg [Tue, 25 Feb 2020 21:58:06 +0000 (16:58 -0500)]
[Ada] Ada2020 AI12-0282: Shared variable control aspects in generics
2020-06-09 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch12.adb (Check_Shared_Variable_Control_Aspects): Require
exact match between formal and actual for aspects Atomic,
Atomic_Component, Volatile, and Volatile_Components.
Bob Duff [Wed, 26 Feb 2020 14:51:56 +0000 (09:51 -0500)]
[Ada] gnatpp: documentation for --no-separate-return switch
2020-06-09 Bob Duff <duff@adacore.com>
gcc/ada/
* doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for
the --no-separate-return switch of gnatpp.
Arnaud Charlet [Wed, 26 Feb 2020 10:01:53 +0000 (05:01 -0500)]
[Ada] Add missing tag with -gnatw.d
2020-06-09 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_warn.adb (Warn_On_Constant_Valid_Condition): Add proper
warning tag.
Arnaud Charlet [Fri, 21 Feb 2020 16:36:40 +0000 (11:36 -0500)]
[Ada] Refine implementation of AI05-0149 missing conversion checks
2020-06-09 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_type.adb (Covers): Fix implementation of AI05-0149.
* sem_res.adb: Fix typo.
Ed Schonberg [Mon, 24 Feb 2020 18:37:58 +0000 (13:37 -0500)]
[Ada] Spurious error on instantiations with Taft_Amendment types and tasks
2020-06-09 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* exp_ch9.adb (Build_Master_Renaming): Make name in renaming
declaration unique by adding a numeric suffix, to prevent
accidental name conflict when several instantiations of a
package containing an access_to_incomplete type that designate
tasks appear in the same scope.
Piotr Trojanek [Tue, 25 Feb 2020 12:58:04 +0000 (13:58 +0100)]
[Ada] Annotate Ada.Synchronous_Barriers with SPARK_Mode => Off
2020-06-09 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* libgnarl/a-synbar.ads, libgnarl/a-synbar.adb,
libgnarl/a-synbar__posix.ads, libgnarl/a-synbar__posix.adb
(Ada.Synchronous_Barriers): Annotate with SPARK_Mode => Off.
Arnaud Charlet [Mon, 24 Feb 2020 20:35:12 +0000 (15:35 -0500)]
[Ada] AI1-0201 Relational operators of static string types are now static
2020-06-09 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_eval.adb (Eval_Relational_Op, Eval_String_Literal,
Eval_Type_Conversion): Relax rules on relational operators and
type conversions of static string types.
Arnaud Charlet [Sun, 23 Feb 2020 18:50:18 +0000 (13:50 -0500)]
[Ada] Ada2020: AI12-0301 Predicates and Default_Value
2020-06-09 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_util.ads, sem_util.adb (Is_Partially_Initialized_Type):
Take Default_Value and Default_Component_Value into account.
* sem_ch3.adb (Analyze_Object_Declaration): Update comment.
Bob Duff [Tue, 25 Feb 2020 00:22:56 +0000 (19:22 -0500)]
[Ada] Disable assertion regarding Body_Before_Spec_Edge
2020-06-09 Bob Duff <duff@adacore.com>
gcc/ada/
* bindo-graphs.adb (Add_Edge_Kind_Check): Disable failing part
of the assertion.
Martin Liska [Mon, 8 Jun 2020 14:04:31 +0000 (16:04 +0200)]
libsanitizer: use gnu++14
libsanitizer/ChangeLog:
* asan/Makefile.am: Replace gnu++11 with gnu++14.
* interception/Makefile.am: Likewise.
* libbacktrace/Makefile.am: Likewise.
* lsan/Makefile.am: Likewise.
* sanitizer_common/Makefile.am: Likewise.
* tsan/Makefile.am: Likewise.
* ubsan/Makefile.am: Likewise.
* asan/Makefile.in: Regenerate.
* interception/Makefile.in: Likewise.
* libbacktrace/Makefile.in: Likewise.
* lsan/Makefile.in: Likewise.
* sanitizer_common/Makefile.in: Likewise.
* tsan/Makefile.in: Likewise.
* ubsan/Makefile.in: Likewise.
Martin Liska [Tue, 9 Jun 2020 08:01:05 +0000 (10:01 +0200)]
gcc-changelog: fix deduction for root ChangeLog
contrib/ChangeLog:
* gcc-changelog/git_commit.py: Fix ChangeLog regex in order to
match the top-level ChangeLog.
* gcc-changelog/test_email.py: Add test.
* gcc-changelog/test_patches.txt: Likewise.
Jakub Jelinek [Tue, 9 Jun 2020 06:39:36 +0000 (08:39 +0200)]
c-family: Fix up MEM_REF printing [PR95580]
The C FE in the MEM_REF printing ICEs if the type of the first argument
(which due to useless pointer conversions can be an arbitrary type) is a
pointer to an incomplete type. The code just wants to avoid printing a cast
if it is a pointer to single byte elements.
2020-06-09 Jakub Jelinek <jakub@redhat.com>
PR c/95580
* c-pretty-print.c (c_pretty_printer::unary_expression): Handle the
case when MEM_REF's first argument has type pointer to incomplete type.
* gcc.dg/pr95580.c: New test.
Jakub Jelinek [Tue, 9 Jun 2020 06:38:19 +0000 (08:38 +0200)]
match.pd: Optimize ffs comparisons against constants [PR95527]
The following patch implements various optimizations of __builtin_ffs*
against constants.
2020-06-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/95527
* match.pd (__builtin_ffs (X) cmp CST): New optimizations.
* gcc.dg/tree-ssa/pr95527.c: New test.
Jakub Jelinek [Tue, 9 Jun 2020 06:34:13 +0000 (08:34 +0200)]
testsuite: Fix g++.dg/torture/pr95493.C FAIL on i686-linux with -O0.
2020-06-09 Jakub Jelinek <jakub@redhat.com>
* g++.dg/torture/pr95493.C: Add -Wno-psabi -w to dg-additional-options.
Max Filippov [Sat, 6 Jun 2020 12:06:04 +0000 (05:06 -0700)]
xtensa: libgcc: fix PR target/95571
Rewrite uw_install_context without function calls to avoid register
spilling in _Unwind_RaiseException during return context installation.
2020-06-08 Max Filippov <jcmvbkbc@gmail.com>
gcc/testsuite/
* g++.target/xtensa/pr95571.C: New test.
* g++.target/xtensa/xtensa.exp: New testsuite.
libgcc/
* config/xtensa/unwind-dw2-xtensa.c (uw_install_context): Merge
with uw_install_context_1.
Segher Boessenkool [Mon, 8 Jun 2020 22:34:21 +0000 (22:34 +0000)]
rs6000/testsuite: Allow xxperm* instead of only vperm*
Some testcases failed (esp. with --with-cpu=power9) after my change to
prefer xxperm over vperm when all else is equal. Fix that. (This also
tightens the relevant REs somewhat).
2020-06-09 Segher Boessenkool <segher@kernel.crashing.org>
gcc/testsuite/
* gcc.target/powerpc/fold-vec-perm-char.c: Allow both vperm/vpermr and
xxperm/xxpermr.
* gcc.target/powerpc/fold-vec-perm-double.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-float.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-int.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-longlong.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-pixel.c: Ditto.
* gcc.target/powerpc/fold-vec-perm-short.c: Ditto.
* gcc.target/powerpc/lvsl-lvsr.c: Ditto.
* gcc.target/powerpc/vec-mult-char-2.c: Ditto.
* gcc.target/powerpc/vsx-vector-6.p9.c: Also allow xxpermr.
GCC Administrator [Tue, 9 Jun 2020 00:16:47 +0000 (00:16 +0000)]
Daily bump.
Tobias Burnus [Mon, 8 Jun 2020 21:24:57 +0000 (23:24 +0200)]
openmp: ensure variables in offload table are streamed out (PRs 94848 + 95551)
gcc/ChangeLog:
PR lto/94848
PR middle-end/95551
* omp-offload.c (add_decls_addresses_to_decl_constructor,
omp_finish_file): Skip removed items.
* lto-cgraph.c (output_offload_tables): Likewise; set force_output
to this node for variables and functions.
libgomp/ChangeLog:
PR lto/94848
PR middle-end/95551
* testsuite/libgomp.fortran/target-var.f90: New test.
Jason Merrill [Fri, 5 Jun 2020 16:45:11 +0000 (12:45 -0400)]
bootstrap: Fix --disable-bootstrap with older g++.
Previously I had AX_CXX_COMPILE_STDCXX in the gcc directory configure, which
added -std=c++11 to CXX if needed, but then CXX is overridden from the
toplevel directory, so it didn't have the desired effect. Fixed by moving
the check to the toplevel. Currently it is only used when building GCC
without bootstrapping; other packages that share the toplevel directory
can adjust the condition if they also want to require C++11 support.
/ChangeLog:
* configure.ac: Check AX_CXX_COMPILE_STDCXX if not bootstrapping.
* configure: Regenerate.
gcc/ChangeLog:
* aclocal.m4: Remove ax_cxx_compile_stdcxx.m4.
* configure.ac: Remove AX_CXX_COMPILE_STDCXX.
* configure: Regenerate.
Jonathan Wakely [Mon, 8 Jun 2020 20:34:46 +0000 (21:34 +0100)]
libstdc++: Fix failing tests
These started failing with the previous commit, because I forgot to add
the tests after adjusting them.
* testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error
line number.
* testsuite/20_util/default_delete/void_neg.cc: Likewise.
Jason Merrill [Mon, 8 Jun 2020 19:22:24 +0000 (15:22 -0400)]
Add missing ChangeLog entries
Jonathan Wakely [Mon, 8 Jun 2020 17:08:14 +0000 (18:08 +0100)]
libstdc++: Implement operator<< for std::unique_ptr (LWG 2948)
libstdc++-v3/ChangeLog:
* include/bits/unique_ptr.h (operator<<): Define for C++20.
* testsuite/20_util/unique_ptr/io/lwg2948.cc: New test.
Iain Buclaw [Mon, 8 Jun 2020 20:11:00 +0000 (22:11 +0200)]
d: Fix regression caused by recent refactoring
gcc/d/ChangeLog:
PR d/95573
* dmd/MERGE: Merge upstream dmd
5041e56f1.
Iain Buclaw [Mon, 8 Jun 2020 19:57:59 +0000 (21:57 +0200)]
d: Merge upstream dmd
955b8b36f.
Merges AndAndExp and OrOrExp into a LogicalExp AST node.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
955b8b36f.
* expr.cc (ExprVisitor::visit (AndAndExp *)): Rename type to ...
(ExprVisitor::visit (LogicalExp *)): ... this. Handle both 'and if'
and 'or if' expression nodes.
(ExprVisitor::visit (OrOrExp *)): Remove.
Harald Anlauf [Mon, 8 Jun 2020 19:00:11 +0000 (21:00 +0200)]
PR fortran/95195 - Fortran testcase should clean up afterwards
Change testcase to check error message (iomsg) at runtime, rather than to crash.
libgfortran/
PR fortran/95091
* io/transfer.c (finalize_transfer): Fix type in error message.
gcc/testsuite/
PR fortran/95195
* gfortran.dg/namelist_97.f90: Adjust testcase.
Martin Sebor [Mon, 8 Jun 2020 15:06:48 +0000 (09:06 -0600)]
PR bootstrap/95555 - powepc64 bootstrap failure due to -Wmaybe-uninitialized in reload_cse_simplify_operands
gcc/ChangeLog:
* postreload.c (reload_cse_simplify_operands): Clear first array element
before using it. Assert a precondition.
Mark Eggleston [Thu, 4 Jun 2020 04:53:31 +0000 (05:53 +0100)]
Fortran : ICE in maybe_canonicalize_comparison_1 PR92993
This issue has been fixed by PR94090. Add test case to ensure that
this does not re-occur.
2020-06-08 Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/testsuite/
PR fortran/92993
* gfortran.dg/pr92993.f90: New test.
Jakub Jelinek [Mon, 8 Jun 2020 09:05:10 +0000 (11:05 +0200)]
forwprop: Ignore scalar mode vectors in simplify_vector_constructor [PR95528]
As mentioned in the PR, the problem is that at least the x86 backend asumes
that the vec_unpack* and vec_pack* optabs with integral modes are for the
AVX512-ish vector masks rather than for very small vectors done in GPRs.
The only other target that seems to have a scalar mode vec_{,un}pack* optab
is aarch64 as discussed in the PR, so there is also a condition for that.
All other targets have just vector mode optabs.
2020-06-08 Jakub Jelinek <jakub@redhat.com>
PR target/95528
* tree-ssa-forwprop.c (simplify_vector_constructor): Don't use
VEC_UNPACK*_EXPR or VEC_PACK_TRUNC_EXPR with scalar modes unless the
type is vector boolean.
* g++.dg/opt/pr95528.C: New test.
Jakub Jelinek [Mon, 8 Jun 2020 08:30:48 +0000 (10:30 +0200)]
testsuite: Fix up pr95548.C testcase.
2020-06-08 Jakub Jelinek <jakub@redhat.com>
PR lto/95548
* g++.dg/torture/pr95548.C: Change from dg-do compile to dg-do link,
add return type for main, for __SIZEOF_INT128__ test with __uint128_t
enumerator constants and add a test with unsigned long long
enumerators for all targets.
Tamar Christina [Mon, 8 Jun 2020 08:23:10 +0000 (09:23 +0100)]
AArch64: Expand on comment of stack-clash and implicit probing through LR.
This expands the comment on an assert we have in aarch64_layout_frame
and points to an existing comment somewhere else that has a much longer
explanation of what's going on.
Committed under the GCC Obvious rule.
gcc/ChangeLog:
* config/aarch64/aarch64.c (aarch64_layout_frame): Expand comments.
Christophe Lyon [Mon, 8 Jun 2020 08:17:20 +0000 (08:17 +0000)]
[arm] Fix vfp_operand_register for VFP HI regs
While looking at PR target/94743 I noticed an ICE when I tried to save
all the FP registers: this was because all HI registers wouldn't match
vfp_register_operand.
gcc/ChangeLog:
* config/arm/predicates.md (vfp_register_operand): Use VFP_HI_REGS
instead of VFP_REGS.
Martin Liska [Tue, 2 Jun 2020 13:29:37 +0000 (15:29 +0200)]
rs6000: Replace FAIL with gcc_unreachable
gcc/ChangeLog:
* config/rs6000/vector.md: Replace FAIL with gcc_unreachable
in all vcond* patterns.
Christophe Lyon [Mon, 8 Jun 2020 08:04:19 +0000 (08:04 +0000)]
[arm] (header usage fix) include c++ algorithm header via system.h
After the recent commit that forces uses of c++11, the arm part failed
to build because it does not include <algorithm> via system.h as
should be done.
This results in:
from /gcc/common/config/arm/arm-common.c:34:
/usr/lib/gcc/x86_64-linux-gnu/5/include/mm_malloc.h:42:12: error:
attempt to use poisoned "malloc"
return malloc (size);
This patch fixes the problem by defining INCLUDE_ALGORITHM before
including system.h and no longer includes <algorithm> directly.
gcc/ChangeLog:
* common/config/arm/arm-common.c (INCLUDE_ALGORITHM):
Define. No longer include <algorithm>.
Steve Baird [Thu, 20 Feb 2020 23:35:51 +0000 (15:35 -0800)]
[Ada] Implement AI12-0073 (Ravenscar disallows Synchronous_Barriers)
2020-06-08 Steve Baird <baird@adacore.com>
gcc/ada/
* sem_prag.adb (Analyze_Pragma.Set_Ravenscar_Profile): Add
appropriate call to Set_Restriction_No_Dependence if Ada_Version
>= Ada2012 and Profile is either Ravenscar or a GNAT-defined
Ravenscar variant (i.e., not Jorvik).
Arnaud Charlet [Mon, 24 Feb 2020 10:41:00 +0000 (05:41 -0500)]
[Ada] AI12-0204 Renaming of a prefixed view
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_ch5.adb: Fix typo.
* sem_ch8.adb (Analyze_Renamed_Primitive_Operation): Check that
the prefix of a prefixed view must be renamable as an object.
Arnaud Charlet [Fri, 21 Feb 2020 14:44:28 +0000 (09:44 -0500)]
[Ada] AI12-0085 Missing aspect cases for Remote_Types
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_cat.ads: Fix typo.
* sem_cat.adb (Validate_Remote_Access_To_Class_Wide_Type): Add
handling of N_Attribute_Definition_Clause.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Call
Validate_Remote_Access_To_Class_Wide_Type for Storage_Size and
Storage_Pool.
* sem_attr.adb, exp_ch4.adb: Update comments.
Justin Squirek [Fri, 21 Feb 2020 21:12:35 +0000 (16:12 -0500)]
[Ada] Spurious error on call to controlled primitive
2020-06-08 Justin Squirek <squirek@adacore.com>
gcc/ada/
* sem_ch4.adb (Analyze_One_Call): Add extra condition to the
predicate for deciding when a given controlled call is visible.
Piotr Trojanek [Mon, 17 Feb 2020 17:00:41 +0000 (18:00 +0100)]
[Ada] Port a modified expansion of Enum_Rep from GNAT to GNATprove
2020-06-08 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Port
changes in frontend expander.
Piotr Trojanek [Thu, 20 Feb 2020 11:10:53 +0000 (12:10 +0100)]
[Ada] Style cleanups in new code for Pure_Barriers
2020-06-08 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* sem_ch13.adb (All_Membership_Choices_Static): Fix style.
Steve Baird [Thu, 20 Feb 2020 00:27:47 +0000 (16:27 -0800)]
[Ada] Implement AI12-0291 (Jorvik profile)
2020-06-08 Steve Baird <baird@adacore.com>
gcc/ada/
* libgnat/s-rident.ads: Add Jorvik to the Profile_Name
enumeration type. Add an element for Jorvik to the array
aggregate that is the initial value of the constant
Profile_Info.
* targparm.adb (Get_Target_Parameters): Handle "pragma Profile
(Jorvik);" similarly to "pragma Profile (Ravenscar);".
* snames.ads-tmpl: Declare Name_Jorvik Name_Id. Unlike
Ravenscar, Jorvik is not a pragma name and has no corresponding
element in the Pragma_Id enumeration type; this means that its
declaration must not occur between those of First_Pragma_Name
and Last_Pragma_Name.
* sem_prag.adb (Analyze_Pragma): Add call to
Set_Ravenscar_Profile for Jorvik, similar to the existing calls
for Ravenscar and the GNAT Ravenscar variants.
Arnaud Charlet [Mon, 17 Feb 2020 17:41:37 +0000 (12:41 -0500)]
[Ada] AI12-0228 Properties of qualified expressions used as names
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_ch8.adb (Analyze_Object_Renaming): Update Get_Object_Name
to go through N_Qualified_Expression and N_Type_Conversion. Fix
another case of wrong usage of E_Anonymous_Access_Type instead
of Anonymous_Access_Kind.
* sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Work
on the original node.
(Is_Aliased_View): Take into account N_Qualified_Expression.
Arnaud Charlet [Fri, 14 Feb 2020 16:50:12 +0000 (11:50 -0500)]
[Ada] Fix handling of 'Enum_Rep and renamings
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_eval.adb (Eval_Type_Conversion): Fix handling of
enumeration to integer conversions.
* exp_attr.adb (Expand_N_Attribute_Reference
[Attribute_Enum_Rep]): Remove special casing for first-level
renaming, best left to the general folding mechanism via
Eval_Type_Conversion.
Eric Botcazou [Sun, 9 Feb 2020 17:03:48 +0000 (18:03 +0100)]
[Ada] Remove the Has_Dynamic_Range_Check flag
2020-06-08 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* atree.adb (New_Copy): Do not clear Has_Dynamic_Range_Check.
* checks.ads (Append_Range_Checks): Remove Flag_Node parameter.
(Insert_Range_Checks): Likewise and remove default value of
Static_Loc parameter.
* checks.adb (Append_Range_Checks): Remove Flag_Node parameter.
Do not test and set Has_Dynamic_Range_Check.
(Insert_Range_Checks): Likewise and remove default value of
Static_Loc parameter.
* csinfo.adb (CSinfo): Remove 'L' from [NEUB]_Fields pattern and
do not handle Has_Dynamic_Range_Check.
* exp_ch5.adb (Expand_N_Assignment_Statement): Remove argument
in call to Insert_Range_Checks.
* sem_ch3.adb (Analyze_Subtype_Declaration): Do not fiddle
with Has_Dynamic_Range_Check.
(Process_Range_Expr_In_Decl): Remove argument in calls to
Insert_Range_Checks and Append_Range_Checks.
* sinfo.ads (Has_Dynamic_Range_Check): Delete.
(Set_Has_Dynamic_Range_Check): Likewise.
* sinfo.adb (Has_Dynamic_Range_Check): Delete.
(Set_Has_Dynamic_Range_Check): Likewise.
* treepr.adb (Print_Node): Do not print Has_Dynamic_Range_Check.
Steve Baird [Sat, 15 Feb 2020 00:24:47 +0000 (16:24 -0800)]
[Ada] Implement AI12-0290 (Simple_Barriers restriction)
2020-06-08 Steve Baird <baird@adacore.com>
gcc/ada/
* sem_ch13.ads: Export new function
All_Membership_Choices_Static.
* sem_ch13.adb: Implement new function
All_Membership_Choices_Static. This involves moving the
functions Is_Static_Choice and All_Membership_Choices_Static,
which were previously declared within the function
Is_Predicate_Static, out to library level so that they can be
called by the new function. The already-exisiting code in
Is_Predicate_Static which became the body of
All_Membership_Choices_Static is replaced with a call to the new
function in order to avoid duplication.
* exp_ch9.adb (Is_Pure_Barrier): Several changes needed to
implement rules of AI12-0290 and RM D.7's definition of
"pure-barrier-eligible". These changes include adding a call to
the new function Sem_13.All_Membership_Choices_Static, as per
the "see 4.9" in RM D.7(1.6/5).
Richard Kenner [Mon, 17 Feb 2020 23:17:58 +0000 (18:17 -0500)]
[Ada] Issue with unnesting of 'First/Last and renaming
2020-06-08 Richard Kenner <kenner@adacore.com>
gcc/ada/
* exp_unst.adb (Visit_Node): When visiting array attribute
nodes, in addition to checking the type of Get_Referenced_Object
of the prefix, also check the actual type of the prefix.
Gary Dismukes [Mon, 17 Feb 2020 06:31:57 +0000 (01:31 -0500)]
[Ada] Implement predicate checks on qualified expressions (AI12-0100)
2020-06-08 Gary Dismukes <dismukes@adacore.com>
gcc/ada/
* checks.adb (Apply_Predicate_Check): Refine test for being in a
subprogram body to account for no Corresponding_Body case,
avoiding blowups arising due to other changes here.
* exp_ch4.adb (Expand_N_Qualified_Expression): Apply predicate
checks, if any, after constraint checks are applied.
* sem_eval.ads (Check_Expression_Against_Static_Predicate): Add
Check_Failure_Is_Error formal for conditionalizing warning vs.
error messages.
* sem_eval.adb (Check_Expression_Against_Static_Predicate):
Issue an error message rather than a warning when the new
Check_Failure_Is_Error formal is True. In the nonstatic or
Dynamic_Predicate case where the predicate is known to fail,
emit the check to ensure that folded cases get checks applied.
* sem_res.adb (Resolve_Qualified_Expression): Call
Check_Expression_Against_Static_Predicate, passing True for
Check_Failure_Is_Error, to ensure we reject static predicate
violations. Remove code that was conditionally calling
Apply_Predicate_Check, which is no longer needed, and that check
procedure shouldn't be called from a resolution routine in any
case. Also remove associated comment about preventing infinite
recursion and consistency with Resolve_Type_Conversion, since
that handling was already similarly removed from
Resolve_Type_Convesion at some point.
(Resolve_Type_Conversion): Add passing of True for
Check_Failure_Is_Error parameter on call to
Check_Expression_Against_Static_Predicate, to ensure that static
conversion cases that violate a predicate are rejected as
errors.
Piotr Trojanek [Mon, 17 Feb 2020 13:15:16 +0000 (14:15 +0100)]
[Ada] Restore Snames.Name_SPARK as it used in the GNATprove backend
2020-06-08 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* snames.ads-tmpl (Name_SPARK): Restore after being deleted.
Arnaud Charlet [Mon, 10 Feb 2020 20:18:47 +0000 (15:18 -0500)]
[Ada] Remove processing of SPARK_05 restriction
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* exp_aggr.adb, exp_ch6.adb, par-ch11.adb, par-ch6.adb,
par-ch7.adb, par-prag.adb, restrict.adb, restrict.ads,
scans.ads, scng.adb, sem_aggr.adb, sem_attr.adb, sem_ch11.adb,
sem_ch12.adb, sem_ch3.adb, sem_ch3.ads, sem_ch4.adb,
sem_ch5.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_ch9.adb,
sem_res.adb, sem_util.adb, sem_util.ads, snames.ads-tmpl,
gnatbind.adb, libgnat/s-rident.ads,
doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
Remove processing of SPARK_05 restriction.
* gnat_rm.texi: Regenerate.
* opt.ads: Remove processing of old checksum which is now
handled by gprbuild directly.
Arnaud Charlet [Sun, 16 Feb 2020 12:16:45 +0000 (07:16 -0500)]
[Ada] AI12-0287 Legality Rules for null exclusions in renaming are too fierce
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_ch12.adb (Instantiate_Object): Relax rules related to null
exclusions and generic objects. Handle all anonymous types
consistently and not just E_Anonymous_Access_Type.
* sem_ch8.adb (Analyze_Object_Renaming): Change wording so that
it applies to both renamings and instantiations to avoid
confusion.
Arnaud Charlet [Sat, 15 Feb 2020 17:37:13 +0000 (12:37 -0500)]
[Ada] Ada.Text_IO: fix typo
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* libgnat/a-textio.ads (File_Mode): Fix typo in comment.
Eric Botcazou [Sat, 15 Feb 2020 15:48:15 +0000 (16:48 +0100)]
[Ada] Do not warn on partial access to atomic object with address clause
2020-06-08 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_res.adb (Resolve_Indexed_Component): Do not give a warning
for a nonatomic component of an atomic array which is subject to
an address clause in Ada 2020 mode.
(Resolve_Selected_Component): Likewise for an atomic record.
Philippe Gil [Mon, 3 Feb 2020 13:56:23 +0000 (14:56 +0100)]
[Ada] Add gnatname use for multiple units files support
2020-06-08 Philippe Gil <gil@adacore.com>
gcc/ada/
* doc/gnat_ugn/the_gnat_compilation_model.rst: in "Handling
Files with Multiple Units" part documents gnatname use for
unmodified files handling and gnatchop use for files
refactoring.
* gnat_ugn.texi: Regenerate.
Arnaud Charlet [Fri, 14 Feb 2020 08:12:30 +0000 (03:12 -0500)]
[Ada] Update doc on Enum_Rep/Enum_Val
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* doc/gnat_rm/implementation_defined_attributes.rst:
Enum_Rep/Enum_Val are standard Ada 202x attributes.
* gnat_rm.texi: Regenerate.
Javier Miranda [Mon, 10 Feb 2020 22:12:32 +0000 (17:12 -0500)]
[Ada] Better code generation for nested aggregates
2020-06-08 Javier Miranda <miranda@adacore.com>
gcc/ada/
* exp_aggr.adb (Safe_Component): Remove code that considers as
unsafe components that are aggregates; such removal allows the
frontend to proceed and evaluate if they are safe by means of
invoking Safe_Aggregate.
Piotr Trojanek [Wed, 12 Feb 2020 10:00:38 +0000 (11:00 +0100)]
[Ada] Reuse standard expansion of 'First and 'Last in GNATprove mode
2020-06-08 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Apply
standard expansion to attributes First and Last.
Piotr Trojanek [Tue, 11 Feb 2020 22:01:06 +0000 (23:01 +0100)]
[Ada] Reuse Get_Index_Subtype in the special expander for GNATprove
2020-06-08 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* exp_attr.adb, exp_util.ads, exp_util.adb (Get_Index_Subtype):
Move from the body of Exp_Attr to Exp_Util and expose from the
spec.
* exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Replace
duplicated code with a call to Get_Index_Subtype.
Arnaud Charlet [Sun, 9 Feb 2020 19:53:05 +0000 (14:53 -0500)]
[Ada] AI12-0226 Make objects more consistent
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* sem_ch8.adb (Analyze_Object_Renaming): Simplify code by moving
many special cases to Is_Object_Reference and removing others by
only checking renamings coming from sources.
* sem_util.adb (Is_Object_Reference): Update for AI12-0226 and
add more regular handling of 'Priority. Remove special cases no
longer needed now that we are only checking renamings coming
from sources.
Claire Dross [Mon, 10 Feb 2020 13:51:30 +0000 (14:51 +0100)]
[Ada] Silence spurious warning on instances of formal vectors
2020-06-08 Claire Dross <dross@adacore.com>
gcc/ada/
* libgnat/a-cofove.adb (Insert_Space): The computation of Index
generates a spurious compiler warning about a value not being in
range for a statically dead branch. Silence it using pragma
Warnings.
Bob Duff [Tue, 11 Feb 2020 00:21:00 +0000 (19:21 -0500)]
[Ada] gnatbind: Deterministic No_Entry_Calls_In_Elaboration_Code messages
2020-06-08 Bob Duff <duff@adacore.com>
gcc/ada/
* bindo-graphs.adb (function Add_Edge): Rename
Add_Edge_With_Return to Add_Edge; we can tell it returns because
it's a function, and overloading seems appropriate in this case.
If Activates_Task=True, and we're not going to add a new edge
because an existing Pred-->Succ edge already exists, then set
Activates_Task to True on the preexisting edge. This ensures
that the message:
info: use pragma Restrictions (No_Entry_Calls_In_Elaboration_Code)
appears when appropriate, no matter in what order the edges
happened to be processed.
(procedure Add_Edge): Remove redundant assertions.
(Activates_Task): Other kinds of edges can have
Activates_Task=True. For example, if we had a With_Edge and
then an Invocation_Edge with Activates_Task=True, then the
With_Edge has Activates_Task set to True.
(Add_Edge_Kind_Check): New procedure to prevent other bugs of
this nature. For example, if we were to sometimes call Add_Edge
for a Spec_Before_Body_Edge followed by Add_Edge for a
With_Edge, and sometimes in the other order, that would cause a
similar bug to what we're fixing here.
(Set_Is_Recorded_Edge): Val parameter is not used. Get rid of
it.
(Set_Activates_Task): New procedure to set the Activates_Task flag.
* bindo-graphs.ads (Library_Graph_Edge_Kind): Reorder the
enumeration literals to facilitate Add_Edge_Kind_Check.
* ali.adb (Known_ALI_Lines): The comment about "still available"
was wrong. Fix that by erasing the comment, and encoding the
relevant information in real code. Take advantage of Ada's full
coverage rules by removing "others =>". Also DRY.
Ed Schonberg [Mon, 10 Feb 2020 00:30:05 +0000 (19:30 -0500)]
[Ada] Ada_2020: shared variable control aspects on formal derived types
2020-06-08 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* par-ch12.adb (P_Formal_Derived_Type_Definition): Handle
properly formal derived types that include aspect
specifications, so that the "with" keyword appears twice in the
formal type declaration.
* sem_ch13.adb (Has_Generic_Parent): Return true if the type
itself is a generic formal.
Dmitriy Anisimkov [Thu, 6 Feb 2020 10:25:06 +0000 (16:25 +0600)]
[Ada] Fix socket timeout correction for Windows Server 2019 case
2020-06-08 Dmitriy Anisimkov <anisimko@adacore.com>
gcc/ada/
* socket.c (__gnat_minus_500ms): Remove
IsWindowsVersionOrGreater from condition.
Claire Dross [Mon, 10 Feb 2020 11:30:40 +0000 (12:30 +0100)]
[Ada] Add Depends contracts to Delete procedures of formal containers
2020-06-08 Claire Dross <dross@adacore.com>
gcc/ada/
* libgnat/a-cfdlli.ads, libgnat/a-cfhama.ads,
libgnat/a-cfhase.ads, libgnat/a-cforma.ads, libgnat/a-cforse.ads
(Delete): Add Depends contract.
Arnaud Charlet [Fri, 31 Jan 2020 16:09:11 +0000 (11:09 -0500)]
[Ada] AI12-0309 Missing checks for pragma Suppress
2020-06-08 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* snames.ads-tmpl (Name_Program_Error_Check,
Name_Tasking_Check): New constants.
* types.ads (Program_Error_Check, Tasking_Check): New constants.
(All_Checks): Update accordingly.
GCC Administrator [Mon, 8 Jun 2020 00:16:23 +0000 (00:16 +0000)]
Daily bump.
Iain Buclaw [Sun, 7 Jun 2020 19:58:49 +0000 (21:58 +0200)]
d: Merge upstream dmd
73d8e2fec.
Renames the enum PROTKIND to Prot::Kind, updates all uses of the
original enum accordingly.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
73d8e2fec.
* decl.cc (get_symbol_decl): Use new Prot::Kind enum.
* modules.cc (get_internal_fn): Likewise.
Uros Bizjak [Sun, 7 Jun 2020 20:07:28 +0000 (22:07 +0200)]
i386: Improve expansion of __builtin_parity
GCC currently hides the shift and xor reduction inside a backend
specific UNSPEC PARITY, making it invisible to the RTL optimizers until
very late during compilation. It is normally reasonable for the
middle-end to maintain wider mode representations for as long as possible
and split them later, but this only helps if the semantics are visible
at the RTL-level (to combine and other passes), but UNSPECs are black
boxes, so in this case splitting early (during RTL expansion) is a
better strategy.
It turns out that that popcount instruction on modern x86_64 processors
has (almost) made the integer parity flag in the x86 ALU completely
obsolete, especially as POPCOUNT's integer semantics are a much better
fit to RTL. The one remaining case where these transistors are useful
is where __builtin_parity is immediately tested by a conditional branch,
and therefore the result is wanted in a flags register rather than as
an integer. This case is captured by two peephole2 optimizations in
the attached patch.
2020-06-07 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog:
* config/i386/i386.md (paritydi2, paritysi2): Expand reduction
via shift and xor to an USPEC PARITY matching a parityhi2_cmp.
(paritydi2_cmp, paritysi2_cmp): Delete these define_insn_and_split.
(parityhi2, parityqi2): New expanders.
(parityhi2_cmp): Implement set parity flag with xorb insn.
(parityqi2_cmp): Implement set parity flag with testb insn.
New peephole2s to use these insns (UNSPEC PARITY) when appropriate.
gcc/testsuite/ChangeLog:
* gcc.target/i386/parity-3.c: New test.
* gcc.target/i386/parity-4.c: Likewise.
* gcc.target/i386/parity-5.c: Likewise.
* gcc.target/i386/parity-6.c: Likewise.
* gcc.target/i386/parity-7.c: Likewise.
* gcc.target/i386/parity-8.c: Likewise.
* gcc.target/i386/parity-9.c: Likewise.
Iain Buclaw [Sun, 7 Jun 2020 17:42:58 +0000 (19:42 +0200)]
d: Merge upstream dmd
108ca1bcd.
Renames OutBuffer::peekString to OutBuffer::peekChars, and
OutBuffer::extractString to OutBuffer::extractChars. All callers have
been updated as appropriate.
Reviewed-on: https://github.com/dlang/dmd/pull/11247
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
108ca1bcd.
* d-diagnostic.cc (expand_d_format): Adjust to use extractChars().
* d-frontend.cc (Loc::toChars): Likewise.
* d-lang.cc (deps_write): Likewise.
(d_parse_file): Likewise.
* decl.cc (d_mangle_decl): Likewise.
* intrinsics.cc (maybe_set_intrinsic): Likewise.
Iain Buclaw [Sun, 7 Jun 2020 14:50:46 +0000 (16:50 +0200)]
d: Merge upstream dmd
b0df0e982
Adds a struct ParameterList to encapulate parameter and vararg
information in the front-end.
Reviewed-on: https://github.com/dlang/dmd/pull/11226
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
b0df0e982.
* d-builtins.cc (build_frontend_type): Use VarArg for varargs_p.
* d-codegen.cc (declaration_type): Call TypeFunction::create with
argument VARARGnone.
(parameter_type): Likewise.
(d_build_call): Use new field names and member functions.
* d-target.cc (Target::cppParameterType): Call TypeFunction::create
with argument VARARGnone.
* types.cc (TypeVisitor::visit (TypeFunction *): Use new field names
and member functions.
Harald Anlauf [Sun, 7 Jun 2020 14:43:12 +0000 (16:43 +0200)]
PR fortran/95091 - Buffer overflows with submodules and long symbols
Add cast to fix bootstrap error with -Werror=sign-compare.
gcc/fortran/
PR fortran/95091
* class.c (gfc_hash_value): Add cast.
Iain Buclaw [Sun, 7 Jun 2020 14:37:25 +0000 (16:37 +0200)]
d: Merge upstream dmd
1831b24ff.
Converts some global and param fields from pointers to value types.
Reviewed-on: https://github.com/dlang/dmd/pull/11245
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
1831b24ff.
* d-lang.cc (d_init_options): Remove initialization of updated fields.
(d_handle_option): Adjust for new field types.
Harald Anlauf [Sun, 7 Jun 2020 12:47:24 +0000 (14:47 +0200)]
PR fortran/95091 - Buffer overflows with submodules and long symbols
With submodules, name mangling results in long internal symbols. This
requires adjustment of the sizes of temporaries to avoid buffer overflows.
2020-06-07 Harald Anlauf <anlauf@gmx.de>
gcc/fortran/
PR fortran/95091
* class.c (get_unique_type_string, gfc_hash_value): Enlarge
buffers, and check whether the strings returned by
get_unique_type_string() fit.
Iain Buclaw [Sun, 7 Jun 2020 09:26:32 +0000 (11:26 +0200)]
d: Merge upstream dmd
cef1e7991.
Adds a DString type, a struct that has a compatible layout with D
strings. Many parameters in the Global struct have been switched over
to this type, and users of these params have been adjust to use the
length or ptr field as appropriate.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
cef1e7991.
* d-lang.cc (d_parse_file): Adjust for new field types.
guojiufu [Thu, 28 May 2020 06:10:39 +0000 (14:10 +0800)]
rs6000: allow cunroll to grow size according to -funroll-loop or -fpeel-loops
Previously, flag_unroll_loops was turned on at -O2 implicitly. This
also turned on cunroll with allowance size increasing, and cunroll
will unroll/peel the loop even the loop is complex like code in PR95018.
With this patch, size growth for cunroll is allowed only for if -funroll-loops
or -fpeel-loops or -O3 is specified explicitly.
gcc/ChangeLog
2020-06-07 Jiufu Guo <guojiufu@linux.ibm.com>
PR target/95018
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Override flag_cunroll_grow_size.
guojiufu [Thu, 28 May 2020 05:42:23 +0000 (13:42 +0800)]
Introduce flag_cunroll_grow_size for cunroll
Currently GIMPLE complete unroller(cunroll) is checking
flag_unroll_loops and flag_peel_loops to see if allow size growth.
Beside affects curnoll, flag_unroll_loops also controls RTL unroler.
To have more freedom to control cunroll and RTL unroller, this patch
introduces flag_cunroll_grow_size. With this patch, we can control
cunroll and RTL unroller indepently.
gcc/ChangeLog
2020-06-07 Jiufu Guo <guojiufu@linux.ibm.com>
* common.opt (flag_cunroll_grow_size): New flag.
* toplev.c (process_options): Set flag_cunroll_grow_size.
* tree-ssa-loop-ivcanon.c (pass_complete_unroll::execute):
Use flag_cunroll_grow_size.
Thomas Koenig [Sun, 7 Jun 2020 08:43:54 +0000 (10:43 +0200)]
Added test case for a PR which has been fixed in the meantime.
gcc/testsuite/ChangeLog:
PR tree-optimization/50439
* gfortran.dg/loop_interchange_2.f: New test.
GCC Administrator [Sun, 7 Jun 2020 00:16:19 +0000 (00:16 +0000)]
Daily bump.
Jan Hubicka [Sat, 6 Jun 2020 20:19:46 +0000 (22:19 +0200)]
Fix ICE in ODR enum streaming [PR95548]
gcc/ChangeLog:
2020-06-06 Jan Hubicka <hubicka@ucw.cz>
PR lto/95548
* ipa-devirt.c (struct odr_enum_val): Turn values to wide_int.
(ipa_odr_summary_write): Update streaming.
(ipa_odr_read_section): Update streaming.
gcc/testsuite/ChangeLog:
2020-06-06 Jan Hubicka <hubicka@ucw.cz>
* g++.dg/torture/pr95548.C: New test.
Max Filippov [Sat, 6 Jun 2020 08:26:56 +0000 (01:26 -0700)]
MAINTAINERS: Add myself as xtensa port maintainer
2020-06-06 Max Filippov <jcmvbkbc@gmail.com>
* MAINTAINERS: Add myself as xtensa port maintainer.
Alexandre Oliva [Sat, 6 Jun 2020 01:31:19 +0000 (22:31 -0300)]
[PR95456] avoid memcpy (_, NULL, 0) in gcc.c
Some newly-added code in gcc.c might call memcpy with a NULL source
pointer and zero-length inputs. Avoid such calls by rearranging the
code a little.
for gcc/ChangeLog
PR driver/95456
* gcc.c (do_spec_1): Don't call memcpy (_, NULL, 0).
GCC Administrator [Sat, 6 Jun 2020 00:16:29 +0000 (00:16 +0000)]
Daily bump.
Iain Buclaw [Fri, 5 Jun 2020 21:09:23 +0000 (23:09 +0200)]
d: Merge upstream dmd
740f3d1ea.
Backports the conversion of the parameter fields debugids and versionids
to Identifiers. The idea is that Identifiers should be used instead of
C strings where ever possible.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
740f3d1ea.
* d-lang.cc (d_handle_option): Use new fields to save debug and
version levels passed over command-line.
(d_post_options): Add them to front-end here.
Martin Sebor [Fri, 5 Jun 2020 20:59:16 +0000 (14:59 -0600)]
Temporarily remove an unintentionally commited test.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wnonnull5.C: Temporarily remove.
Marek Polacek [Fri, 5 Jun 2020 18:22:35 +0000 (14:22 -0400)]
c++: Make braced-init-list as template arg work with aggr init [PR95369]
Barry pointed out to me that our braced-init-list as a template-argument
extension doesn't work as expected when we aggregate-initialize. Since
aggregate list-initialization is a user-defined conversion sequence, we
allow it as part of a converted constant expression.
Co-authored-by: Jason Merrill <jason@redhat.com>
gcc/cp/ChangeLog:
PR c++/95369
* call.c (build_converted_constant_expr_internal): Allow
list-initialization.
gcc/testsuite/ChangeLog:
PR c++/95369
* g++.dg/cpp2a/nontype-class38.C: New test.
Harald Anlauf [Fri, 5 Jun 2020 18:30:34 +0000 (20:30 +0200)]
PR fortran/95530, PR fortran/95537 - Buffer overflows with long symbols
The testcases for PR95090 and PR95106 trigger buffer overflows with long
symbols that were found with an instrumented compiler. Enlarge the
affected buffers, and add checks that the buffers will suffice.
2020-06-05 Harald Anlauf <anlauf@gmx.de>
gcc/fortran/
PR fortran/95530
PR fortran/95537
* decl.c (gfc_match_decl_type_spec): Enlarge buffer, and enhance
string copy to detect buffer overflow.
* gfortran.h (gfc_common_head): Enlarge buffer.
* trans-common.c (finish_equivalences): Enhance string copy to
detect buffer overflow.
Iain Sandoe [Fri, 5 Jun 2020 14:09:39 +0000 (15:09 +0100)]
coroutines: co_returns are statements, not expressions.
This corrects an error in the CO_RETURN_EXPR tree
class.
gcc/cp/ChangeLog:
* cp-tree.def (CO_RETURN_EXPR): Correct the class
to use tcc_statement.
Mark Wielaard [Thu, 28 May 2020 00:55:36 +0000 (02:55 +0200)]
diagnostics: Consistently add fixit hint for implicit builtin declaration
There are two warnings that might trigger when a builtin function is
used but not declared yet. Both called through implicitly_declare in
c-decl. The first in implicit_decl_warning does warn for builtins,
but does not add a fixit hint for them (only for non-builtins when
a header is suggested through lookup_name_fuzzy). This warning is
guarded by -Wimplicit-function-declaration. The second warning, which
does include a fixit hint if possible, is given when the implicit
builtin declaration has an incompatible signature. This second warning
cannot be disabled.
This setup means that you only get a fixit-hint for usage of builtin
functions where the implicit signature is different than the actual
signature of the builtin. No fixit hints with header suggestions
are ever generated for builtins like abs, isdigit or putchar.
It seems more consistent to always generate a fixit-hint if possible
for the -Wimplicit-function-declaration warning. And for the second
warning to make it depend on -Wbuiltin-declaration-mismatch like
other warnings about builtin declaration mismatches.
Include a new test to show we get fixit-hints for abs, isdigit and
putchar now. Some small tweaks to existing tests to show the
effect of -Wno-builtin-declaration-mismatch with this change. And
a testcase to show that #pragma GCC diagnostic ignored now works.
gcc/c/ChangeLog:
* c-decl.c (implicit_decl_warning): When warned and olddecl is
an undeclared builtin, then add a fixit header hint, if found.
(implicitly_declare): Add OPT_Wbuiltin_declaration_mismatch to
warning_at about implicit builtin declaration type mismatch.
gcc/testsuite/ChangeLog:
* gcc.dg/missing-header-fixit-3.c: Add
-Wno-implicit-function-declaration.
* gcc.dg/missing-header-fixit-4.c: Add new expected output.
* gcc.dg/missing-header-fixit-5.c: New testcase.
* gcc.dg/Wbuiltin-declaration-mismatch-ignore.c: Likewise.
Iain Buclaw [Fri, 5 Jun 2020 17:27:29 +0000 (19:27 +0200)]
d: Merge upstream dmd
f5638c7b8.
Adds a CHECKENABLE enum, uses it for all contract parameters for
consistency in state checking.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
f5638c7b8.
* d-builtins.cc (d_init_versions): Use new CHECKENABLE enum.
* d-codegen.cc (array_bounds_check): Likewise.
(build_frame_type): Likewise.
(get_frameinfo): Likewise.
* d-lang.cc (d_init_options): Likewise.
(d_init_options_struct): Don't initialize x_flag_bounds_check.
(d_handle_option): Use new CHECKENABLE enum.
(d_post_options): Likewise. Set flag_bounds_check here.
* expr.cc (ExprVisitor::visit(AssertExp *)): Use new CHECKENABLE enum.
Jason Merrill [Thu, 4 Jun 2020 19:56:57 +0000 (15:56 -0400)]
c++: Fix pretty-print of pointer minus integer.
For whatever reason, GCC internally represents a pointer minus an integer as
a pointer plus a very large unsigned integer. But exposing that to users is
unsightly, and it's easy enough to show the real value.
gcc/cp/ChangeLog:
* error.c (dump_binary_op): Handle negative operand to
POINTER_PLUS_EXPR.
gcc/c-family/ChangeLog:
* c-pretty-print.c (pp_c_additive_expression): Handle negative
operand to POINTER_PLUS_EXPR.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/constexpr-ptrsub2.C: New test.
Tom Tromey [Fri, 5 Jun 2020 12:40:14 +0000 (06:40 -0600)]
fortran/95509 - fix spellcheck-operator.f90 regression
My earlier patch to add case handling to the spell checker caused a
Fortran regression. I believe I must have misread the test results.
This patch fixes the problem by changing the cutoff. I chose this
value because the previous patch effectively multiplied the result of
get_edit_distance by 2 (unless a case change is involved).
gcc/fortran/ChangeLog:
PR fortran/95509
* misc.c (gfc_closest_fuzzy_match): Update cutoff value
computation.
Thomas Schwinge [Wed, 20 May 2020 08:56:55 +0000 (10:56 +0200)]
[OpenACC 'exit data'] Strip 'GOMP_MAP_STRUCT' mappings
These are not itself necessary for OpenACC 'exit data' directives, and are
skipped over (now) in libgomp. We might as well not emit them to start with,
in line with the equivalent OpenMP directive. We keep the no-op handling in
libgomp for the reason of backward compatibility.
gcc/
* gimplify.c (gimplify_adjust_omp_clauses): Remove
'GOMP_MAP_STRUCT' mapping from OpenACC 'exit data' directives.
gcc/testsuite/
* c-c++-common/goacc/struct-enter-exit-data-1.c: New file.
libgomp/
* oacc-mem.c (goacc_exit_data_internal) <GOMP_MAP_STRUCT>: Explain
special handling.
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Thomas Schwinge [Wed, 20 May 2020 08:53:33 +0000 (10:53 +0200)]
[OpenACC 'exit data'] Simplify 'GOMP_MAP_STRUCT' handling
libgomp/
* oacc-mem.c (goacc_exit_data_internal) <GOMP_MAP_STRUCT>:
Simplify.
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Julian Brown [Thu, 4 Jun 2020 13:40:53 +0000 (06:40 -0700)]
Add 'libgomp.oacc-c-c++-common/struct-copyout-{1,2}.c'
libgomp/
* testsuite/libgomp.oacc-c-c++-common/struct-copyout-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/struct-copyout-2.c: New test.
Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
Iain Buclaw [Fri, 5 Jun 2020 15:50:49 +0000 (17:50 +0200)]
d: Merge upstream dmd
56f0a65c4.
Updates the Target interface, removing static from all members, so all
field accesses and member function calls go through a single global
'target'. Information relating to extern ABI are now in TargetC,
TargetCPP, and TargetObjC for each supported language respectively.
Reviewed-on: https://github.com/dlang/dmd/pull/11228
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd
56f0a65c4.
* d-builtins.cc (build_frontend_type): Remove static.
(d_build_builtins_module): Use target.va_listType() to get front-end
type for va_list.
(d_init_builtins): Move creation of va_list to Target::va_listType.
* d-codegen.cc (build_interface_binfo): Use new target global.
(build_vindex_ref): Likewise.
(identity_compare_p): Likewise.
* d-ctfloat.cc (CTFloat::parse): Likewise.
* d-lang.cc (d_init): Likewise.
* d-port.cc (Port::isFloat32LiteralOutOfRange): Likewise.
(Port::isFloat64LiteralOutOfRange): Likewise.
* d-target.cc (define_float_constants): Initialize constants through a
reference, instead of setting globals.
(Target::_init): Initialize new fields instead of setting globals.
(Target::va_listType): Build front-end type from va_list_type_node.
(Target::toCppMangle): Renamed to ...
(TargetCPP::toMangle): ... this.
(Target::cppTypeInfoMangle): Renamed to ...
(TargetCPP::typeInfoMangle): ... this.
(Target::cppTypeMangle): Renamed to ...
(TargetCPP::typeMangle): this.
(Target::cppParameterType): Renamed to ...
(TargetCPP::parameterType): ... this. Use target.va_listType() to get
front-end type for va_list.
(Target::cppFundamentalType): Renamed to ...
(TargetCPP::fundamentalType): ... this.
* d-tree.h (build_frontend_type): Declare.
* decl.cc (base_vtable_offset): Use new target global.
* typeinfo.cc (layout_classinfo_interfaces): Likewise.
(layout_cpp_typeinfo): Likewise.
* types.cc (valist_array_p): Use target.va_listType() to get front-end
type for va_list.
(layout_aggregate_type): Use new target global.
Martin Sebor [Fri, 5 Jun 2020 15:34:39 +0000 (09:34 -0600)]
Adjust text of expected warnings to g:
b825a22890740f341eae566af27e18e528cd29a7.
gcc/testsuite/ChangeLog:
* c-c++-common/goacc/uninit-use-device-clause.c: Adjust.
* c-c++-common/pr59223.c: Same.
* g++.dg/warn/Wnonnull5.C: Same.
* gcc.dg/pr59924.c: Same.
* gcc.dg/ubsan/pr81981.c: Same.
* gcc.dg/ubsan/pr89284.c: Same.
* gfortran.dg/goacc/uninit-use-device-clause.f95: Same.