โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdaygcc/ada history

ada: Fix expansion of type aspects with handling of aspects

16 October 2023 at 15:14
ada: Fix expansion of type aspects with handling of aspects

The new handling of aspects stores the aspect expression as the
Expression_Copy of the aspect and not as the Entity of the aspect
identified. This has been changed for most of the aspects, but not for
Type_Invariant and Default_Initial_Condition, which have custom
expansion. Apparently this change only affects GNATprove and not GNAT.

gcc/ada/

	* exp_util.adb (Add_Own_DIC, Add_Own_Invariants): Store the aspect
	expression in Expression_Copy.
  • [DBH] gcc/ada/exp_util.adb
  • 16 October 2023 at 15:14

ada: Cleanup more "not Present"

13 October 2023 at 08:40
ada: Cleanup more "not Present"

We had a GNATcheck rule that suggests replacing "not Present (...)" with
"No (...)", but it only detected calls with a parameter of type Node_Id.
Now this rules also detects parameters of type Elist_Id.

gcc/ada/

	* sem_ch3.adb, sem_ch4.adb, sem_eval.adb: Fix newly detected
	violations.
  • [DBH] gcc/ada/sem_ch3.adb
  • [DBH] gcc/ada/sem_ch4.adb
  • [DBH] gcc/ada/sem_eval.adb
  • 13 October 2023 at 08:40

ada: Avoid extra conversion in expansion of packed array assignments

3 October 2023 at 19:33
ada: Avoid extra conversion in expansion of packed array assignments

Expansion of assignments to packed array objects with string literals on
the right-hand side, created an unnecessary conversion, i.e.:

  ... :=
    component_type
      (declare
         temp : component_type := "string_literal";
       begin
         temp)

Now the expansion omits the outer type conversion.

Cleanup; behavior is unaffected.

gcc/ada/

	* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Simplify handling of
	assignments with string literals.
  • [DBH] gcc/ada/exp_pakd.adb
  • 3 October 2023 at 19:33

ada: Remove duplicated code for expansion of packed array assignments

3 October 2023 at 17:43
ada: Remove duplicated code for expansion of packed array assignments

Expansion of assignments to packed array objects has two cases and
had duplicated code for both these cases.

gcc/ada/

	* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Remove code from the
	ELSE branch, because it was is identical to code before the IF
	statements itself.
  • [DBH] gcc/ada/exp_pakd.adb
  • 3 October 2023 at 17:43

ada: Simplify expansion of packed array assignments

3 October 2023 at 17:04
ada: Simplify expansion of packed array assignments

When expanding assignment to a packed array object, e.g. a formal
parameter with mode OUT that might have unconstrained type, we took the
component type and component size from the constrained actual subtype.
It is simpler to take these properties from the nominal type of the
assigned object.

Semantics is unaffected, because constraining the array doesn't change
the type or size of the array components.

gcc/ada/

	* exp_pakd.adb (Expand_Bit_Packed_Element_Set): Change Ctyp and Csiz
	from variables to constants and compute them using the nominal type
	of the assigned array object.
  • [DBH] gcc/ada/exp_pakd.adb
  • 3 October 2023 at 17:04

ada: Fix extra whitespace after END keywords

3 October 2023 at 13:00
ada: Fix extra whitespace after END keywords

Style cleanup.

gcc/ada/

	* exp_pakd.adb, libgnarl/s-osinte__android.ads,
	libgnarl/s-osinte__linux.ads, libgnarl/s-osinte__qnx.ads,
	libgnarl/s-osinte__rtems.ads, libgnat/s-gearop.adb,
	libgnat/s-poosiz.adb, sem_util.adb: Fix style.
  • [DBH] gcc/ada/exp_pakd.adb
  • [DBH] gcc/ada/libgnarl/s-osinte__android.ads
  • [DBH] gcc/ada/libgnarl/s-osinte__linux.ads
  • [DBH] gcc/ada/libgnarl/s-osinte__qnx.ads
  • [DBH] gcc/ada/libgnarl/s-osinte__rtems.ads
  • [DBH] gcc/ada/libgnat/s-gearop.adb
  • [DBH] gcc/ada/libgnat/s-poosiz.adb
  • [DBH] gcc/ada/sem_util.adb
  • 3 October 2023 at 13:00

ada: Explicitly analyze and expand null array aggregates

7 September 2023 at 20:13
ada: Explicitly analyze and expand null array aggregates

Null array aggregates have present but empty lists of expressions and
component associations. This confuses the previous code for ordinary
array aggregates, which assumes that if a list of either expressions or
component associations is present, then it is non-empty.

This patch adds explicit handling for null array aggregates to avoid
assertion failures in code for ordinary array aggregates.

gcc/ada/

	* exp_aggr.adb (Build_Array_Aggr_Code): Don't build aggregate code
	for null array aggregates.
	* sem_aggr.adb (Resolve_Array_Aggregate): Don't examine formatting
	of a null array aggregate.
  • [DBH] gcc/ada/exp_aggr.adb
  • [DBH] gcc/ada/sem_aggr.adb
  • 7 September 2023 at 20:13

ada: Remove redundant protection against empty list

23 August 2023 at 14:44
ada: Remove redundant protection against empty list

Calls to First on No_List intentionally return Empty, so explicit guards
against No_List are unnecessary. Code cleanup; semantics is unaffected.

gcc/ada/

	* sem_type.adb (Interface_Present_In_Ancestor): Remove guard against no
	list of interfaces; fix style in comments (trailing dots).
  • [DBH] gcc/ada/sem_type.adb
  • 23 August 2023 at 14:44

ada: Add guard before querying the type for its interfaces

23 August 2023 at 14:02
ada: Add guard before querying the type for its interfaces

Fix crash on illegal code, when routine Iface_Present_In_Ancestor is
called on the predefined String type and attempts to examine the list of
interfaces.

gcc/ada/

	* sem_type.adb (Iface_Present_In_Ancestor): Only look at the list of
	interfaces for types that allow it. The guard is a high-level equivalent
	of the entity kinds listed in the preconditon of the Interfaces query.
  • [DBH] gcc/ada/sem_type.adb
  • 23 August 2023 at 14:02

ada: Extend precondition of Interfaces.C.String.Value with Length

28 July 2023 at 10:13
ada: Extend precondition of Interfaces.C.String.Value with Length

The existing precondition guarded against exception Dereference_Error,
but not against Constraint_Error.

The RM rule B.3.1(36/3) only mentions Constraint_Error for the Value
function which returns char_array, but the one which returns String
has the same restriction, because it is equivalent to calling the
variant which returns char_array and then converted.

gcc/ada/

	* libgnat/i-cstrin.ads (Value): Extend preconditions; adapt comment for
	the package.
  • [DBH] gcc/ada/libgnat/i-cstrin.ads
  • 28 July 2023 at 10:13

ada: Add guard for detection of class-wide precondition subprograms

11 July 2023 at 14:37
ada: Add guard for detection of class-wide precondition subprograms

When skipping check on subprograms built for class-wide preconditions
we must deal with the current scope not being a subprogram, e.g. it
could be a declare-block.

gcc/ada/

	* sem_res.adb (Resolve_Actuals): Add guard for the call to
	Class_Preconditions_Subprogram.
  • [DBH] gcc/ada/sem_res.adb
  • 11 July 2023 at 14:37

ada: Leave detection of missing return in functions to GNATprove

10 July 2023 at 13:02
ada: Leave detection of missing return in functions to GNATprove

GNAT has a heuristic to warn about missing return statements in
functions. This warning was escalated to errors when operating in
GNATprove mode and SPARK_Mode was On. However, this heuristic was
imprecise and caused spurious errors. Also, it was applied after the
Push_Scope/End_Scope, so for functions acting as compilation units it
was using the wrong SPARK_Mode.

It is better to simply leave this detection to GNATprove.

gcc/ada/

	* sem_ch6.adb (Check_Statement_Sequence): Only warn about missing return
	statements and let GNATprove emit a check when needed.
  • [DBH] gcc/ada/sem_ch6.adb
  • 10 July 2023 at 13:02

ada: Allow calls to Number_Formals when no formals are present

16 June 2023 at 07:16
ada: Allow calls to Number_Formals when no formals are present

It is much simpler and safer for the routine Number_Formals to accept
subprogram entities that have no formals.

gcc/ada/

	* einfo-utils.adb (Number_Formals): Change types in body.
	* einfo-utils.ads (Number_Formals): Change type in spec.
	* einfo.ads (Number_Formals): Change type in comment.
	* sem_ch13.adb (Is_Property_Function): Fix style in a caller of
	Number_Formals that was likely to crash because of missing guards.
  • [DBH] gcc/ada/einfo-utils.adb
  • [DBH] gcc/ada/einfo-utils.ads
  • [DBH] gcc/ada/einfo.ads
  • [DBH] gcc/ada/sem_ch13.adb
  • 16 June 2023 at 07:16

ada: Improve defense against illegal code in check for infinite loops

16 June 2023 at 06:34
ada: Improve defense against illegal code in check for infinite loops

Fix crash occurring when attribute System'To_Address is used without
a WITH clause for package System.

gcc/ada/

	* sem_warn.adb (Check_Infinite_Loop_Warning): Don't look at the type of
	actual parameter when it has no type at all, e.g. because the entire
	subprogram call is illegal.
  • [DBH] gcc/ada/sem_warn.adb
  • 16 June 2023 at 06:34
โŒ
โŒ