- 22 May, 2018 27 commits
-
-
This patch fixes a compiler abort on a discriminant constraint when the constraint is a subtype indication. 2018-05-22 Patrick Bernardi <bernardi@adacore.com> gcc/ada/ * sem_ch3.adb (Build_Discriminant_Constraints): Raise an error if the user tries to use a subtype indication as a discriminant constraint. gcc/testsuite/ * gnat.dg/discr50.adb: New testcase. From-SVN: r260525
Patrick Bernardi committed -
This patch dismantles the prototype implementation of the first proposal for Reduction expressions, one of the important potentially parallel constructs for Ada2020. The ARG is going in a different direction with a simpler syntax. 2018-05-22 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * exp_ch4.ads, exp_ch4.adb, exp_util.adb, expander.adb: Remove mention of N_Reduction_Expression and N_Reduction_Expression_Parameter. * par-ch4.adb: Remove parsing routines for reduction expressions. * sem.adb, sinfo.ads, sinfo.adb, sem_ch4.ads, sem_ch4.adb, sem_res.adb, sem_spark.adb, sprint.adb: Remove analysis routines for reduction expressions. From-SVN: r260524
Ed Schonberg committed -
2018-05-22 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_ch8.adb (Check_Frozen_Renaming): Do not emit error in Relaxed_RM_Semantics mode. From-SVN: r260523
Arnaud Charlet committed -
2018-05-22 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * comperr.adb (Delete_SCIL_Files): Take into account N_Generic_Package_Renaming_Declaration. From-SVN: r260522
Arnaud Charlet committed -
This patch fixes a compiler abort on an object declaration whose type is a private type with discriminants, and whose full view is a derived type that renames some discriminant of its parent. 2018-05-22 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch3.adb (Search_Derivation_Levels): Whenever a parent type is private, use the full view if available, because it may include renamed discriminants whose values are stored in the corresponding Stored_Constraint. gcc/testsuite/ * gnat.dg/discr49.adb, gnat.dg/discr49_rec1.adb, gnat.dg/discr49_rec1.ads, gnat.dg/discr49_rec2.adb, gnat.dg/discr49_rec2.ads: New testcase. From-SVN: r260521
Ed Schonberg committed -
This patch fixes a spurious visibility error with a nested instance of a generic unit with a formal package, when the actual for it is a formal package PA of an enclosing generic, and there are subsequent uses of the formals of PA in that generic unit. 2018-05-22 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * einfo.ads, einfo.adb: New attribute Hidden_In_Formal_Instance, defined on packages that are actuals for formal packages, in order to set/reset the visibility of the formals of a formal package with given actuals, when there are subsequent uses of those formals in the enclosing generic, as required by RN 12.7 (10). * atree.ads, atree.adb: Add operations for Elist30. * atree.h: Add Elist30. * sem_ch12.adb (Analyze_Formal_Package_Instantiation): Collect formals that are not defaulted and are thus not visible within the current instance. (Check_Formal_Packages): Reset visibility of formals of a formal package that are not defaulted, on exit from current instance. gcc/testsuite/ * gnat.dg/gen_formal_pkg.adb, gnat.dg/gen_formal_pkg_a.ads, gnat.dg/gen_formal_pkg_b.ads, gnat.dg/gen_formal_pkg_w.ads: New testcase. From-SVN: r260520
Ed Schonberg committed -
This patch modifies the analysis of pragma [Refined_]Depends to emit an error when the pragma is asspciated with a [generic] function, and one of its clauses contains a non-null, non-'Result output item. ------------ -- Source -- ------------ -- pack.ads package Pack with SPARK_Mode is Obj_1 : Integer := 1; Obj_2 : Integer := 2; function Func_1 return Integer with Global => (In_Out => Obj_1); -- Error function Func_2 return Integer with Global => (Output => Obj_1); -- Error function Func_3 return Integer with Depends => (Func_3'Result => Obj_1, -- OK Obj_1 => Obj_1); -- Error function Func_4 return Integer with Depends => (Func_4'Result => Obj_1, -- OK null => Obj_2); -- OK end Pack; ---------------------------- -- Compilation and output -- ---------------------------- $ gcc -c pack.ads pack.ads:6:22: global mode "In_Out" is not applicable to functions pack.ads:9:22: global mode "Output" is not applicable to functions pack.ads:13:23: output item is not applicable to function 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * sem_prag.adb (Analyze_Input_Output): Emit an error when a non-null, non-'Result output appears in the output list of a function. From-SVN: r260519
Hristian Kirtchev committed -
This patch modifies the analysis and expansion of attribute 'Valid_Scalars. It is now possible to specify the attribute on a prefix of an untagged private type. ------------ -- Source -- ------------ -- gnat.adc pragma Initialize_Scalars; -- pack1.ads package Pack1 is type Acc_1 is private; type Acc_2 is private; type Arr_1 is private; type Arr_2 is private; type Bool_1 is private; type Cmpx_1 is private; type Cmpx_2 is private; type Enum_1 is private; type Enum_2 is private; type Fix_1 is private; type Fix_2 is private; type Flt_1 is private; type Flt_2 is private; type Modl_1 is private; type Prot_1 is limited private; type Prot_2 is limited private; type Prot_3 (Discr : Boolean) is limited private; type Rec_1 is private; type Rec_2 is private; type Rec_3 is private; type Rec_4 (Discr : Boolean) is private; type Rec_5 (Discr_1 : Boolean; Discr_2 : Boolean) is private; type Sign_1 is private; type Tag_1 is tagged private; type Task_1 is limited private; type Task_2 (Discr : Boolean) is limited private; type Prec_Arr_1 is private; type Prec_Arr_2 is private; type Prec_Arr_3 is private; type Prec_Arr_4 is private; type Prec_Arr_5 is private; type Prec_Rec_1 is private; type Prec_Rec_2 (Discr : Boolean) is private; type Prec_Rec_3 (Discr_1 : Boolean; Discr_2 : Boolean) is private; type Prec_Rec_4 is private; type Prec_Rec_5 is private; type Prec_Rec_6 is private; type Prec_Rec_7 is private; type Prec_Rec_8 is private; type Prec_Rec_9 is private; private type Acc_1 is access Boolean; type Acc_2 is access procedure; type Arr_1 is array (1 .. 10) of Boolean; type Arr_2 is array (1 .. 3) of access Boolean; type Bool_1 is new Boolean; type Cmpx_1 is array (1 .. 5) of Rec_5 (True, True); type Cmpx_2 is record Comp_1 : Cmpx_1; Comp_2 : Rec_4 (True); end record; type Enum_1 is (One, Two, Three); type Enum_2 is ('f', 'o', 'u', 'r'); type Fix_1 is delta 0.5 range 0.0 .. 10.0; type Fix_2 is delta 0.1 digits 15; type Flt_1 is digits 8; type Flt_2 is digits 10 range -1.0 .. 1.0; type Modl_1 is mod 8; protected type Prot_1 is end Prot_1; protected type Prot_2 is private Comp_1 : Boolean; Comp_2 : Boolean; end Prot_2; protected type Prot_3 (Discr : Boolean) is private Comp_1 : Boolean; Comp_2 : Rec_4 (Discr); end Prot_3; type Rec_1 is null record; type Rec_2 is record null; end record; type Rec_3 is record Comp_1 : Boolean; Comp_2 : Boolean; end record; type Rec_4 (Discr : Boolean) is record case Discr is when True => Comp_1 : Boolean; Comp_2 : Boolean; when False => Comp_3 : access Boolean; end case; end record; type Rec_5 (Discr_1 : Boolean; Discr_2 : Boolean) is record Comp_1 : Boolean; Comp_2 : Boolean; case Discr_1 is when True => case Discr_2 is when True => Comp_3 : Boolean; Comp_4 : Boolean; when False => null; end case; when False => null; end case; end record; type Sign_1 is range 1 .. 10; type Tag_1 is tagged null record; task type Task_1; task type Task_2 (Discr : Boolean); type Prec_Arr_1 is array (1 .. 2) of Boolean; type Prec_Arr_2 is array (1 .. 2, 1 .. 2) of Boolean; type Prec_Arr_3 is array (1 .. 2) of Prec_Rec_1; type Prec_Arr_4 is array (1 .. 2) of Prec_Rec_2 (True); type Prec_Arr_5 is array (1 .. 2) of Prec_Rec_3 (True, True); type Prec_Rec_1 is record Comp_1 : Boolean; end record; type Prec_Rec_2 (Discr : Boolean) is record case Discr is when True => Comp_1 : Boolean; when others => Comp_2 : Boolean; end case; end record; type Prec_Rec_3 (Discr_1 : Boolean; Discr_2 : Boolean) is record case Discr_1 is when True => case Discr_2 is when True => Comp_1 : Boolean; when others => Comp_2 : Boolean; end case; when False => case Discr_2 is when True => Comp_3 : Boolean; when others => Comp_4 : Boolean; end case; end case; end record; type Prec_Rec_4 is record Comp : Prec_Arr_1; end record; type Prec_Rec_5 is record Comp : Prec_Arr_4; end record; type Prec_Rec_6 is record Comp : Prec_Arr_5; end record; type Prec_Rec_7 is record Comp : Prec_Rec_4; end record; type Prec_Rec_8 is record Comp : Prec_Rec_5; end record; type Prec_Rec_9 is record Comp : Prec_Rec_6; end record; end Pack1; -- pack1.adb package body Pack1 is protected body Prot_1 is end Prot_1; protected body Prot_2 is end Prot_2; protected body Prot_3 is end Prot_3; task body Task_1 is begin null; end Task_1; task body Task_2 is begin null; end Task_2; end Pack1; -- pack2.ads with Pack1; use Pack1; package Pack2 is type Acc_3 is private; type Acc_4 is private; type Arr_3 is private; type Arr_4 is private; type Bool_2 is private; type Cmpx_3 is private; type Cmpx_4 is private; type Enum_3 is private; type Enum_4 is private; type Fix_3 is private; type Fix_4 is private; type Flt_3 is private; type Flt_4 is private; type Modl_2 is private; type Prot_4 is limited private; type Prot_5 is limited private; type Prot_6 is limited private; type Rec_6 is private; type Rec_7 is private; type Rec_8 is private; type Rec_9 (Discr : Boolean) is private; type Rec_10 (Discr : Boolean) is private; type Sign_2 is private; type Task_3 is limited private; private type Acc_3 is new Acc_1; type Acc_4 is new Acc_2; type Arr_3 is new Arr_1; type Arr_4 is new Arr_2; type Bool_2 is new Bool_1; type Cmpx_3 is new Cmpx_1; type Cmpx_4 is new Cmpx_2; type Enum_3 is new Enum_1; type Enum_4 is new Enum_2; type Fix_3 is new Fix_1; type Fix_4 is new Fix_2; type Flt_3 is new Flt_1; type Flt_4 is new Flt_2; type Modl_2 is new Modl_1; type Prot_4 is new Prot_1; type Prot_5 is new Prot_2; type Prot_6 is new Prot_3 (True); type Rec_6 is new Rec_1; type Rec_7 is new Rec_2; type Rec_8 is new Rec_3; type Rec_9 (Discr : Boolean) is new Rec_4 (Discr => Discr); type Rec_10 (Discr : Boolean) is new Rec_5 (Discr_1 => Discr, Discr_2 => True); type Sign_2 is new Sign_1; type Task_3 is new Task_1; end Pack2; -- main.adb with Ada.Text_IO; use Ada.Text_IO; with Pack1; use Pack1; with Pack2; use Pack2; procedure Main is procedure Check (Actual : Boolean; Valid : Boolean; Test : String) is begin if Actual /= Valid then Put_Line ("ERROR " & Test); Put_Line (" valid : " & Valid'Img); Put_Line (" actual: " & Actual'Img); end if; end Check; Valid : constant Boolean := True; Not_Valid : constant Boolean := not Valid; pragma Warnings (Off); Acc_1_Obj : Acc_1; Acc_2_Obj : Acc_2; Acc_3_Obj : Acc_3; Acc_4_Obj : Acc_4; Arr_1_Obj : Arr_1; Arr_2_Obj : Arr_2; Arr_3_Obj : Arr_3; Arr_4_Obj : Arr_4; Bool_1_Obj : Bool_1; Bool_2_Obj : Bool_2; Cmpx_1_Obj : Cmpx_1; Cmpx_2_Obj : Cmpx_2; Cmpx_3_Obj : Cmpx_3; Cmpx_4_Obj : Cmpx_4; Enum_1_Obj : Enum_1; Enum_2_Obj : Enum_2; Enum_3_Obj : Enum_3; Enum_4_Obj : Enum_4; Fix_1_Obj : Fix_1; Fix_2_Obj : Fix_2; Fix_3_Obj : Fix_3; Fix_4_Obj : Fix_4; Flt_1_Obj : Flt_1; Flt_2_Obj : Flt_2; Flt_3_Obj : Flt_3; Flt_4_Obj : Flt_4; Modl_1_Obj : Modl_1; Modl_2_Obj : Modl_2; Prot_1_Obj : Prot_1; Prot_2_Obj : Prot_2; Prot_3_Obj : Prot_3 (True); Prot_4_Obj : Prot_4; Prot_5_Obj : Prot_5; Rec_1_Obj : Rec_1; Rec_2_Obj : Rec_2; Rec_3_Obj : Rec_3; Rec_4_Obj : Rec_4 (True); Rec_5_Obj : Rec_5 (True, True); Rec_6_Obj : Rec_6; Rec_7_Obj : Rec_7; Rec_8_Obj : Rec_8; Rec_9_Obj : Rec_9 (True); Sign_1_Obj : Sign_1; Sign_2_Obj : Sign_2; Tag_1_Obj : Tag_1; Task_1_Obj : Task_1; Task_2_Obj : Task_2 (True); Task_3_Obj : Task_3; Prec_Arr_1_Obj : Prec_Arr_1; Prec_Arr_2_Obj : Prec_Arr_2; Prec_Arr_3_Obj : Prec_Arr_3; Prec_Arr_4_Obj : Prec_Arr_4; Prec_Arr_5_Obj : Prec_Arr_5; Prec_Rec_1_Obj : Prec_Rec_1; Prec_Rec_2_Obj : Prec_Rec_2 (True); Prec_Rec_3_Obj : Prec_Rec_3 (True, True); Prec_Rec_4_Obj : Prec_Rec_4; Prec_Rec_5_Obj : Prec_Rec_5; Prec_Rec_6_Obj : Prec_Rec_6; Prec_Rec_7_Obj : Prec_Rec_7; Prec_Rec_8_Obj : Prec_Rec_8; Prec_Rec_9_Obj : Prec_Rec_9; pragma Warnings (On); begin Check (Acc_1_Obj'Valid_Scalars, Valid, "Acc_1_Obj"); Check (Acc_2_Obj'Valid_Scalars, Valid, "Acc_2_Obj"); Check (Acc_3_Obj'Valid_Scalars, Valid, "Acc_3_Obj"); Check (Acc_4_Obj'Valid_Scalars, Valid, "Acc_4_Obj"); Check (Arr_1_Obj'Valid_Scalars, Not_Valid, "Arr_1_Obj"); Check (Arr_2_Obj'Valid_Scalars, Valid, "Arr_2_Obj"); Check (Arr_3_Obj'Valid_Scalars, Not_Valid, "Arr_3_Obj"); Check (Arr_4_Obj'Valid_Scalars, Valid, "Arr_4_Obj"); Check (Bool_1_Obj'Valid_Scalars, Not_Valid, "Bool_1_Obj"); Check (Bool_2_Obj'Valid_Scalars, Not_Valid, "Bool_2_Obj"); Check (Cmpx_1_Obj'Valid_Scalars, Not_Valid, "Cmpx_1_Obj"); Check (Cmpx_2_Obj'Valid_Scalars, Not_Valid, "Cmpx_2_Obj"); Check (Cmpx_3_Obj'Valid_Scalars, Not_Valid, "Cmpx_3_Obj"); Check (Cmpx_4_Obj'Valid_Scalars, Not_Valid, "Cmpx_4_Obj"); Check (Enum_1_Obj'Valid_Scalars, Not_Valid, "Enum_1_Obj"); Check (Enum_2_Obj'Valid_Scalars, Not_Valid, "Enum_2_Obj"); Check (Enum_3_Obj'Valid_Scalars, Not_Valid, "Enum_3_Obj"); Check (Enum_4_Obj'Valid_Scalars, Not_Valid, "Enum_4_Obj"); Check (Fix_1_Obj'Valid_Scalars, Not_Valid, "Fix_1_Obj"); Check (Fix_2_Obj'Valid_Scalars, Not_Valid, "Fix_2_Obj"); Check (Fix_3_Obj'Valid_Scalars, Not_Valid, "Fix_3_Obj"); Check (Fix_4_Obj'Valid_Scalars, Not_Valid, "Fix_4_Obj"); Check (Flt_1_Obj'Valid_Scalars, Not_Valid, "Flt_1_Obj"); Check (Flt_2_Obj'Valid_Scalars, Not_Valid, "Flt_2_Obj"); Check (Flt_3_Obj'Valid_Scalars, Not_Valid, "Flt_3_Obj"); Check (Flt_4_Obj'Valid_Scalars, Not_Valid, "Flt_4_Obj"); Check (Modl_1_Obj'Valid_Scalars, Not_Valid, "Modl_1_Obj"); Check (Modl_2_Obj'Valid_Scalars, Not_Valid, "Modl_2_Obj"); Check (Prot_1_Obj'Valid_Scalars, Valid, "Prot_1_Obj"); Check (Prot_2_Obj'Valid_Scalars, Not_Valid, "Prot_2_Obj"); Check (Prot_3_Obj'Valid_Scalars, Not_Valid, "Prot_3_Obj"); Check (Prot_4_Obj'Valid_Scalars, Valid, "Prot_4_Obj"); Check (Prot_5_Obj'Valid_Scalars, Not_Valid, "Prot_5_Obj"); Check (Rec_1_Obj'Valid_Scalars, Valid, "Rec_1_Obj"); Check (Rec_2_Obj'Valid_Scalars, Valid, "Rec_2_Obj"); Check (Rec_3_Obj'Valid_Scalars, Not_Valid, "Rec_3_Obj"); Check (Rec_4_Obj'Valid_Scalars, Not_Valid, "Rec_4_Obj"); Check (Rec_5_Obj'Valid_Scalars, Not_Valid, "Rec_5_Obj"); Check (Rec_6_Obj'Valid_Scalars, Valid, "Rec_6_Obj"); Check (Rec_7_Obj'Valid_Scalars, Valid, "Rec_7_Obj"); Check (Rec_8_Obj'Valid_Scalars, Not_Valid, "Rec_8_Obj"); Check (Rec_9_Obj'Valid_Scalars, Not_Valid, "Rec_9_Obj"); Check (Sign_1_Obj'Valid_Scalars, Not_Valid, "Sign_1_Obj"); Check (Sign_2_Obj'Valid_Scalars, Not_Valid, "Sign_2_Obj"); Check (Tag_1_Obj'Valid_Scalars, Valid, "Tag_1_Obj"); Check (Task_1_Obj'Valid_Scalars, Valid, "Task_1_Obj"); Check (Task_2_Obj'Valid_Scalars, Valid, "Task_2_Obj"); Check (Task_3_Obj'Valid_Scalars, Valid, "Task_3_Obj"); Check (Prec_Arr_1_Obj'Valid_Scalars, Not_Valid, "Prec_Arr_1_Obj"); Check (Prec_Arr_2_Obj'Valid_Scalars, Not_Valid, "Prec_Arr_2_Obj"); Check (Prec_Arr_3_Obj'Valid_Scalars, Not_Valid, "Prec_Arr_3_Obj"); Check (Prec_Arr_4_Obj'Valid_Scalars, Not_Valid, "Prec_Arr_4_Obj"); Check (Prec_Arr_5_Obj'Valid_Scalars, Not_Valid, "Prec_Arr_5_Obj"); Check (Prec_Rec_1_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_1_Obj"); Check (Prec_Rec_2_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_2_Obj"); Check (Prec_Rec_3_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_3_Obj"); Check (Prec_Rec_4_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_4_Obj"); Check (Prec_Rec_5_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_5_Obj"); Check (Prec_Rec_6_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_6_Obj"); Check (Prec_Rec_7_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_7_Obj"); Check (Prec_Rec_8_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_8_Obj"); Check (Prec_Rec_9_Obj'Valid_Scalars, Not_Valid, "Prec_Rec_9_Obj"); end Main; ----------------- -- Compilation -- ----------------- $ gnatmake -q main.adb $ ./main 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * exp_attr.adb (Build_Array_VS_Func): Reimplemented. (Build_Record_VS_Func): Reimplemented. (Expand_N_Attribute): Reimplement the handling of attribute 'Valid_Scalars. * sem_attr.adb (Analyze_Attribute): Reimplement the handling of attribute 'Valid_Scalars. * sem_util.adb (Scalar_Part_Present): Reimplemented. (Validated_View): New routine. * sem_util.ads (Scalar_Part_Present): Update the parameter profile and comment on usage. (Validated_View): New routine. * doc/gnat_rm/implementation_defined_attributes.rst: Update the documentation of attribute 'Valid_Scalars. * gnat_rm.texi: Regenerate. From-SVN: r260518
Hristian Kirtchev committed -
2018-05-22 Bob Duff <duff@adacore.com> gcc/ada/ * binde.adb: (Choose): Ignore a pragma Elaborate_Body that appears in the spec of a SAL_Interface package. From-SVN: r260517
Bob Duff committed -
This patch fixes a spurious visiblity error on an instantiation of a generic package that contains a type declaration with an aspect specification for an aspect that must be delayed (i.e. an aspect whose value may be specified at a later point). The package g.ads must compile quietly: ---- with S; generic package G is type Buffer_Type is record Data : Integer; end record; package Buffer is new S (Buffer_Type => Buffer_Type); end G; ---- generic type Buffer_Type is private; package S is Page_Size : constant := 4096; type Reader_Type is limited record Data : Buffer_Type; end record with Alignment => Page_Size; -- Using a constant does not work -- Alignment => 4096; -- Using a number works -- for Reader_Type'Alignment use Page_Size; -- so does an attribute. pragma Compile_Time_Error (Reader_Type'Size /= 12345, "Ooops"); -- Note: We set 'Alignment and check for 'Size. end S; 2018-05-22 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * freeze.adb (Freeze_Entity): When analyzing delayed aspects of an entity E within a generic unit, indicate that there are no remaining delayed aspects after invoking Analyze_Aspects_At_Freeze_Point. The entity E is not frozen yet but the aspects should not be reanalyzed at the freeze point, which may be outside of the generic and may not have the proper visibility. From-SVN: r260516
Ed Schonberg committed -
2018-05-22 Bob Duff <duff@adacore.com> gcc/ada/ * doc/gnat_ugn/gnat_utility_programs.rst: Add documentation for the new --split-line-before-record, --indent-named-statements and --no-align-modes gnatpp switches. From-SVN: r260515
Bob Duff committed -
This patch fixes a compiler abort on a pragma Compile_Time_Warning when its second argument is a reference to a constsant string (rather than a string literal or an expression that evaluates to a string literal). Compiling msain.adb must yield: main.adb:5:33: warning: Good main.adb:6:33: warning: VALLUE main.adb:7:33: warning: Test ---- procedure Main is Value : constant String := "Test"; Switch : constant Boolean := True; begin pragma Compile_Time_Warning (Switch, "Good"); pragma Compile_Time_Warning (Switch, "VAL" & "LUE"); pragma Compile_Time_Warning (Switch, value); null; end Main; 2018-05-22 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly a second argument that is a constant of a given string value. From-SVN: r260514
Ed Schonberg committed -
Real board requires fat alignment of stack. 2018-05-22 Doug Rupp <rupp@adacore.com> gcc/ada/ * sigtramp-vxworks-target.inc: Align stack to 128bits on AArch64. From-SVN: r260513
Doug Rupp committed -
The stack on AArch64 is 128-bit aligned to allow Neon and FPU operations. 2018-05-22 Jerome Lambourg <lambourg@adacore.com> gcc/ada/ * sigtramp-qnx.c: Fix stack alignment issue in the signal trampoline. From-SVN: r260512
Jerome Lambourg committed -
This path fixes a spurious size error on a fixed point that carries an aspect specification for the 'Small of the type, when there is a subsequent derivation of that type before the type is frozen, the given 'Small is not not a power of two, and the bounds of the type require its full size, also given by an aspect specification. 2018-05-22 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * freeze.adb (Freeze_Fixed_Point_Type): If the first subtype has delayed aspects, analyze them now, os that the representation of the type (size, bounds) can be computed and validated. gcc/testsuite/ * gnat.dg/fixedpnt3.adb: New testcase. From-SVN: r260511
Ed Schonberg committed -
We now only have the executable code section boundaries at hand, so can only infer offsets for symbols within those boundaries. Symbols outside of this region are non-text symbols, pointless for traceback symbolization anyway. 2018-05-22 Olivier Hainque <hainque@adacore.com> gcc/ada/ * libgnat/s-dwalin.adb (Enable_Cache): Skip symbols outside of the executable code section boundaries. From-SVN: r260510
Olivier Hainque committed -
This patch adds generic support for the Ada.Locales package that relies on the setlocale() C service. 2018-05-22 Javier Miranda <miranda@adacore.com> gcc/ada/ * locales.c: New implementation for the Ada.Locales package. * libgnat/a-locale.ads: Remove comment indicating that this is not implemented. * doc/gnat_rm/standard_library_routines.rst: Remove comment indicating that this is not implemented. * gnat_rm.texi: Regenerate. From-SVN: r260509
Javier Miranda committed -
2018-05-22 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * exp_ch5.adb, freeze.adb, pprint.adb, sem_ch4.adb, sem_res.adb: Minor reformattings. From-SVN: r260508
Hristian Kirtchev committed -
This patch fixes an issue whereby placement of the pragma/aspect Pure_Function was not verified to have been in the same declarative part as the function declaration incorrectly allowing it to appear after a function body or in a different region like a private section. 2018-05-22 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_ch12.adb (In_Same_Declarative_Part): Moved to sem_util. (Freeze_Subprogram_Body, Install_Body): Modify calls to In_Same_Declarative_Part. * sem_prag.adb (Analyze_Pragma-Pragma_Pure_Function): Add check to verify pragma declaration is within the same declarative list with corresponding error message. * sem_util.adb, sem_util.ads (In_Same_Declarative_Part): Moved from sem_ch12.adb and generalized to be useful outside the scope of freezing. gcc/testsuite/ * gnat.dg/pure_function1.adb, gnat.dg/pure_function1.ads, gnat.dg/pure_function2.adb, gnat.dg/pure_function2.ads: New testcases. From-SVN: r260507
Justin Squirek committed -
This patch modifies the analysis of subprogram declarations to ensure that an aspect which is converted into a categorization pragma is properly taken into account when verifying the dependencies of a subprogram unit. ------------ -- Source -- ------------ -- pack.ads package Pack is end Pack; -- proc1.ads with Pack; procedure Proc1 with Pure; -- proc2.ads with Pack; procedure Proc2; pragma Pure (Proc2); ---------------------------- -- Compilation and output -- ---------------------------- $ gcc -c proc1.ads $ gcc -c proc2.ads proc1.ads:1:06: cannot depend on "Pack" (wrong categorization) proc1.ads:1:06: pure unit cannot depend on non-pure unit proc2.ads:1:06: cannot depend on "Pack" (wrong categorization) proc2.ads:1:06: pure unit cannot depend on non-pure unit 2018-05-22 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * sem_ch6.adb (Analyze_Subprogram_Declaration): Set the proper categorization of the unit after processing the aspects in case one of its aspects is converted into a categorization pragma. From-SVN: r260506
Hristian Kirtchev committed -
This PR showed that the normal function for expanding directly-mapped internal functions didn't handle the case in which the call was only being kept for its side-effects. 2018-05-22 Richard Sandiford <richard.sandiford@linaro.org> gcc/ PR middle-end/85862 * internal-fn.c (expand_direct_optab_fn): Cope with a null lhs. gcc/testsuite/ PR middle-end/85862 * gcc.dg/torture/pr85862.c: New test. From-SVN: r260504
Richard Sandiford committed -
2018-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/85834 * tree-ssa-sccvn.c (vn_reference_lookup_3): Properly handle non-constant and non-zero memset arguments. * g++.dg/torture/pr85834.C: New testcase. * gcc.dg/tree-ssa/ssa-fre-64.c: Likewise. From-SVN: r260503
Richard Biener committed -
2018-05-22 Martin Liska <mliska@suse.cz> PR ipa/85607 * ipa-icf.c (sem_item::add_type): Do not ICE for incomplete types. 2018-05-22 Martin Liska <mliska@suse.cz> PR ipa/85607 * g++.dg/ipa/pr85607.C: New test. From-SVN: r260502
Martin Liska committed -
re PR tree-optimization/85863 (ICE in compiling spec2006 fortran test case solib.fppized.f starting with r260283) 2018-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/85863 * tree-vect-stmts.c (vect_is_simple_cond): Only widen invariant comparisons when vectype is specified. (vectorizable_condition): Do not specify vectype for vect_is_simple_cond when SLP vectorizing. * gfortran.fortran-torture/compile/pr85863.f: New testcase. From-SVN: r260501
Richard Biener committed -
From-SVN: r260500
Bin Cheng committed -
2018-05-22 Janus Weil <janus@gcc.gnu.org> PR fortran/85841 * libgfortran.h: Remove the macros GFC_STD_F2008_TS and GFC_STD_OPT_F08TS. * error.c (notify_std_msg): Remove GFC_STD_F2008_TS. * options.c (set_default_std_flags): Ditto. (gfc_handle_option): Make -std=f2008ts an alias for -std=f2018. * array.c (gfc_match_array_spec): Replace GFC_STD_F2008_TS by GFC_STD_F2018. * check.c (gfc_check_atomic, gfc_check_event_query, gfc_check_c_f_pointer, gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc, gfc_check_num_images, gfc_check_this_image): Ditto. * decl.c (gfc_verify_c_interop_param, gfc_match_decl_type_spec): Ditto. * intrinsic.c (add_functions, add_subroutines, gfc_check_intrinsic_standard): Ditto. * iso-c-binding.def: Ditto. * iso-fortran-env.def: Ditto. * match.c (gfc_match_event_post, gfc_match_event_wait, gfc_match_fail_image, gfc_match_form_team, gfc_match_change_team, gfc_match_end_team, gfc_match_sync_team): Ditto. * gfortran.texi: Remove mention of -std=f2008ts. Move TSs into F2018 section. * invoke.texi: Update documentation of -std=f2008ts. 2018-05-22 Janus Weil <janus@gcc.gnu.org> PR fortran/85841 * gfortran.dg/assumed_rank_5.f90: Update error message. * gfortran.dg/assumed_type_4.f90: Ditto. * gfortran.dg/bind_c_array_params.f03: Ditto. * gfortran.dg/bind_c_usage_28.f90: Ditto. * gfortran.dg/c_funloc_tests_5.f03: Ditto. * gfortran.dg/c_funloc_tests_6.f90: Ditto. * gfortran.dg/c_loc_tests_11.f03: Ditto. * gfortran.dg/coarray_atomic_2.f90: Ditto. * gfortran.dg/coarray_collectives_2.f90: Ditto. * gfortran.dg/coarray_collectives_10.f90: Ditto. * gfortran.dg/coarray_collectives_13.f90: Ditto. * gfortran.dg/rank_3.f90: Ditto. * gfortran.dg/error_stop_4.f90: Replace -std=f2008ts by -std=f2008. * gfortran.dg/implicit_14.f90: Ditto. From-SVN: r260499
Janus Weil committed -
From-SVN: r260497
GCC Administrator committed
-
- 21 May, 2018 13 commits
-
-
From-SVN: r260492
Joseph Myers committed -
2018-05-21 Christian Groessler <chris@groessler.org> * gcc.c-torture/compile/simd-5.c: Fix comment. From-SVN: r260491
Christian Groessler committed -
re PR target/85657 (Make __ibm128 a separate type, even if long double uses the IBM double-double format) 2018-05-21 Michael Meissner <meissner@linux.ibm.com> PR target/85657 * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Do not define __ibm128 as long double. * config/rs6000/rs6000.c (rs6000_init_builtins): Create __ibm128 as a distinct type with IEEE 128-bit floating point is supported. (init_float128_ieee): Fix up conversions between IFmode and IEEE 128-bit types to use the correct functions. (rs6000_expand_float128_convert): Use explicit FLOAT_EXTEND to convert between 128-bit floating point types that have different modes but the same representation, instead of using gen_lowpart to makean alias. * config/rs6000/rs6000.md (IFKF): New iterator for IFmode and KFmode. (IFKF_reg): New attributes to give the register constraints for IFmode and KFmode. (extend<mode>tf2_internal): New insns to mark an explicit conversion between 128-bit floating point types that have a different mode but share the same representation. [gcc/testsuite] 2018-05-21 Michael Meissner <meissner@linux.ibm.com> PR target/85657 * gcc.target/powerpc/pr85657-1.c: New test for converting between __float128, __ibm128, and long double. * gcc.target/powerpc/pr85657-2.c: Likewise. * gcc.target/powerpc/pr85657-3.c: Likewise. * g++.dg/pr85667.C: New test to make sure __ibm128 is implementated as a separate type internally, and is not just an alias for long double. From-SVN: r260490
Michael Meissner committed -
re PR target/85657 (Make __ibm128 a separate type, even if long double uses the IBM double-double format) [gcc] 2018-05-21 Michael Meissner <meissner@linux.ibm.com> PR target/85657 * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Do not define __ibm128 as long double. * config/rs6000/rs6000.c (rs6000_init_builtins): Always create __ibm128 as a distinct type. (init_float128_ieee): Fix up conversions between IFmode and IEEE 128-bit types to use the correct functions. (rs6000_expand_float128_convert): Use explicit FLOAT_EXTEND to convert between 128-bit floating point types that have different modes but the same representation, instead of using gen_lowpart to makean alias. * config/rs6000/rs6000.md (IFKF): New iterator for IFmode and KFmode. (IFKF_reg): New attributes to give the register constraints for IFmode and KFmode. (extend<mode>tf2_internal): New insns to mark an explicit conversion between 128-bit floating point types that have a different mode but share the same representation. [gcc/testsuite] 2018-05-21 Michael Meissner <meissner@linux.ibm.com> PR target/85657 * gcc.target/powerpc/pr85657-1.c: New test for converting between __float128, __ibm128, and long double. * gcc.target/powerpc/pr85657-2.c: Likewise. * gcc.target/powerpc/pr85657-3.c: Likewise. * g++.dg/pr85667.C: New test to make sure __ibm128 is implementated as a separate type internally, and is not just an alias for long double. From-SVN: r260489
Michael Meissner committed -
In this PR we have: c_5 = c_4(D) + 4; c_12 = c_5 + 1; *c_5 = 2; a = 2; // A c_21 = c_12 + 1; *c_12 = 2; a = 2; // B c_28 = c_21 + 1; *c_21 = 2; a = 2; c_7 = c_28 + 1; *c_28 = 2; where a is a global int. We decide that A can't clobber *c_5 == c_4[4] because the latter implies that c_4 is an object of 5 bytes or more, whereas a has exactly 4 bytes. The assumption for B and *c_5 is the same, but when considering B and *c_12, we only follow the definition of c_12 to c_5 + 1 (for good reason) and so have *c_12 == c_5[1]. We then don't have the same size guarantee and so assume that B could clobber *c_12. This leads to a situation in which the strinfo for c_5 is still valid but the next strinfo (c_12) isn't. We then segfaulted while trying to get the strinfo for c_21 + 1 == c_5 + 3 because get_stridx_plus_constant assumed that c_5's next strinfo (c_12) would be valid too. And of course it should be valid really. It doesn't make sense for the string based at c_5 to be valid but a substring of it to be invalid. I don't think we can guarantee that such weird corner cases never happen though, even if we tried to avoid this one. One possibility would be to mark c_12 as valid on the basis that c_5 is valid, but I'm not sure the complication is worth it given that it seems to trigger very rarely. A better optimisation would be to get the unroller to clean up after itself a bit more... Although this particular instance of the bug relies on r249880, I think we could have similar problems in GCC 7. It would be much harder to trigger though, especially since it relies on unfolded IR like the above. 2018-05-21 Richard Sandiford <richard.sandiford@linaro.org> gcc/ PR tree-optimization/85814 * tree-ssa-strlen.c (get_stridx_plus_constant): Cope with a null return from get_strinfo when unsharing the next strinfo in the chain. gcc/testsuite/ PR tree-optimization/85814 * gcc.dg/torture/pr85814.c: New test. From-SVN: r260488
Richard Sandiford committed -
2018-05-21 Janus Weil <janus@gcc.gnu.org> PR fortran/85841 PR testsuite/85865 * testsuite/libgomp.fortran/collapse2.f90: Add option "-std=legacy". * testsuite/libgomp.fortran/omp_atomic2.f90: Ditto. * testsuite/libgomp.fortran/omp_parse1.f90: Ditto. * testsuite/libgomp.fortran/omp_parse3.f90: Ditto. * testsuite/libgomp.fortran/task2.f90: Ditto. * testsuite/libgomp.fortran/vla1.f90: Ditto. * testsuite/libgomp.fortran/vla2.f90: Ditto. * testsuite/libgomp.fortran/vla3.f90: Ditto. * testsuite/libgomp.fortran/vla4.f90: Ditto. * testsuite/libgomp.fortran/vla5.f90: Ditto. * testsuite/libgomp.fortran/vla6.f90: Ditto. * testsuite/libgomp.fortran/vla8.f90: Ditto. * testsuite/libgomp.oacc-fortran/collapse-2.f90: Ditto. * testsuite/libgomp.oacc-fortran/nested-function-1.f90: Ditto. From-SVN: r260487
Janus Weil committed -
2018-05-21 Paolo Carlini <paolo.carlini@oracle.com> * parser.c (cp_parser_parameter_declaration_list): Remove bool* parameter. (cp_parser_parameter_declaration_clause): Adjust. (cp_parser_cache_defarg): Likewise. From-SVN: r260486
Paolo Carlini committed -
PR gcc/84923 * varasm.c (weak_finish): Clean up weak_decls. From-SVN: r260485
Vladimir Mezentsev committed -
/cp 2018-05-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84588 * parser.c (cp_parser_maybe_commit_to_declaration, cp_parser_check_condition_declarator): New. (cp_parser_simple_declaration): Use the first above. (cp_parser_condition): Use both the above; enforce [stmt.stmt]/2 about the declarator not specifying a function or an array; improve error-recovery. /testsuite 2018-05-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/84588 * g++.dg/cpp0x/cond1.C: New. * g++.dg/cpp1y/pr84588-1.C: Likewise. * g++.dg/cpp1y/pr84588-2.C: Likewise. * g++.dg/cpp1y/pr84588-3.C: Likewise. * g++.dg/parse/cond6.C: Likewise. * g++.dg/parse/cond7.C: Likewise. * g++.dg/parse/cond8.C: Likewise. * g++.dg/cpp1z/decomp16.C: Update. * g++.old-deja/g++.jason/cond.C: Likewise. From-SVN: r260482
Paolo Carlini committed -
2018-05-21 Steven G. Kargl <kargl@gcc.gnu.org> ChangeLog for r260480 * gfortran.dg/graphite/block-2.f: Adjust testcase for new gfortran warnings for deleted and obsolescent features. * gfortran.dg/graphite/id-19.f: Ditto. * gfortran.dg/graphite/id-20.f: Ditto. * gfortran.dg/graphite/id-27.f90: Ditto. * gfortran.dg/graphite/pr82449.f: Ditto. From-SVN: r260481
Steven G. Kargl committed -
2018-05-21 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/graphite/block-2.f: Adjust testcase for new gfortran warnings for deleted and obsolescent features. * gfortran.dg/graphite/id-19.f: Ditto. * gfortran.dg/graphite/id-20.f: Ditto. * gfortran.dg/graphite/id-27.f90: Ditto. * gfortran.dg/graphite/pr82449.f: Ditto. From-SVN: r260480
Steven G. Kargl committed -
C++17 added new overloads to <fstream> class templates to support opening files from wide character strings "on systems where filesystem::path::value_type is not char". This patch adds those overloads conditional on _wfopen being available, and enables them for pre-C++17 modes as well. Add support for opening file streams from wide character strings. * config/io/basic_file_stdio.cc [_GLIBCXX_HAVE__WFOPEN] (__basic_file<char>::open(const wchar_t*, ios_base::openmode)): Define new overload. * config/io/basic_file_stdio.h [_GLIBCXX_HAVE__WFOPEN] (__basic_file<char>::open(const wchar_t*, ios_base::openmode)): Declare new overload. * configure.ac: Check for _wfopen. * crossconfig.m4: Likewise. * configure: Regenerate. * config.h.in: Regenerate. * include/bits/fstream.tcc [_GLIBCXX_HAVE__WFOPEN] (basic_filebuf<C,T>::open(const wchar_t*, ios_base::openmode)): Define new overload. * include/std/fstream [_GLIBCXX_HAVE__WFOPEN] (basic_filebuf<C,T>::open(const wchar_t*, ios_base::openmode)): Declare new overload. [_GLIBCXX_HAVE__WFOPEN] (basic_ifstream<C,T>::basic_ifstream(const wchar_t*, openmode)) (basic_ifstream<C,T>::basic_open(const wchar_t*, openmode)) (basic_ofstream<C,T>::basic_ifstream(const wchar_t*, openmode)) (basic_ofstream<C,T>::basic_open(const wchar_t*, openmode)) (basic_fstream<C,T>::basic_ifstream(const wchar_t*, openmode)) (basic_fstream<C,T>::basic_open(const wchar_t*, openmode)): Define new overloads. * testsuite/27_io/basic_filebuf/open/wchar_t/1.cc: New. * testsuite/27_io/basic_ifstream/cons/wchar_t/1.cc: New. * testsuite/27_io/basic_ifstream/open/wchar_t/1.cc: New. * testsuite/27_io/basic_ofstream/cons/wchar_t/1.cc: New. * testsuite/27_io/basic_ofstream/open/wchar_t/1.cc: New. * testsuite/27_io/basic_fstream/cons/wchar_t/1.cc: New. * testsuite/27_io/basic_fstream/open/wchar_t/1.cc: New. From-SVN: r260479
Jonathan Wakely committed -
2018-05-21 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/85845 * include/bits/stl_tree.h (_Rb_tree_impl(_Rb_tree_impl&&, _Node_allocator&&)): Fix noexcept qualification. From-SVN: r260478
François Dumont committed
-