https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121968

            Bug ID: 121968
           Summary: Inconsistent bug box from use clause in generic
                    package parameter part
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: liam at liampwll dot com
                CC: dkm at gcc dot gnu.org
  Target Milestone: ---

I'm getting a bug box from 15.2.1 that appears to be caused by a use clause in
a generic package parameter part. However, this only occurs on one specific
package and I've been unable to get it to appear in a small program so I have
included a full Alire project that triggers the bug.

This may be built with: PRUNT_SKIP_PRE_BUILD=true alr build

The bug box is below:

+===========================GNAT BUG DETECTED==============================+
| 15.2.0 (x86_64-pc-linux-gnu) Program_Error sem_util.adb:6650 explicit raise|
| Error detected at prunt-controller.ads:286:4                             |
| Compiling /home/liam/Downloads/prunt/src/prunt-controller-gcode_handler.adb|
| Please submit a bug report; see https://gcc.gnu.org/bugs/ .              |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact command that you entered.                              |
| Also include sources listed below.                                       |
+==========================================================================+

The diff that fixes the issue for this particular program is below:

1 file changed, 7 insertions(+), 7 deletions(-)
src/prunt-step_generator-generator.ads | 14 +++++++-------

modified   src/prunt-step_generator-generator.ads
@@ -25,7 +25,6 @@ with Prunt.Input_Shapers;

 generic
    with package Planner is new Motion_Planner.Planner (<>);
-   use Planner;

    type Stepper_Name is (<>);

@@ -33,22 +32,22 @@ generic

    with
      procedure Start_Planner_Block
-       (Resetting_Data     : Flush_Resetting_Data_Type;
-        Persistent_Data    : Block_Persistent_Data_Type;
+       (Resetting_Data     : Planner.Flush_Resetting_Data_Type;
+        Persistent_Data    : Planner.Block_Persistent_Data_Type;
         Last_Command_Index : Command_Index);
    with
      procedure Enqueue_Command
        (Pos             : Position;
         Stepper_Pos     : Stepper_Position;
-        Data            : Corner_Extra_Data_Type;
+        Data            : Planner.Corner_Extra_Data_Type;
         Index           : Command_Index;
         Loop_Until_Hit  : Boolean;
         Safe_Stop_After : Boolean;
         Vel_Ratio       : Dimensionless);
    with
      procedure Finish_Planner_Block
-       (Resetting_Data       : Flush_Resetting_Data_Type;
-        Persistent_Data      : Block_Persistent_Data_Type;
+       (Resetting_Data       : Planner.Flush_Resetting_Data_Type;
+        Persistent_Data      : Planner.Block_Persistent_Data_Type;
         Next_Block_Pos       : Stepper_Position;
         First_Accel_Distance : Length;
         Last_Command_Index   : Command_Index);
@@ -58,7 +57,7 @@ generic

    with
      function Get_Axial_Shaper_Parameters
-       (Data : Block_Persistent_Data_Type) return
Input_Shapers.Axial_Shaper_Parameters;
+       (Data : Planner.Block_Persistent_Data_Type) return
Input_Shapers.Axial_Shaper_Parameters;

    with procedure Report_Loop_Move_Offset (Index : Command_Index;
Distance_Delta : Position_Offset);

@@ -67,6 +66,7 @@ generic

    Runner_CPU : System.Multiprocessors.CPU_Range;
 package Prunt.Step_Generator.Generator is
+   use Planner;

    type Stepper_Pos_Map is array (Axis_Name, Stepper_Name) of Length;

Reply via email to