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

            Bug ID: 123857
           Summary: Null pointer dereference from -gnata, -gnateV, and
                    Unchecked_Union
           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: ---

The below program causes a segfault in gcc-interface/utils2.cc when built with
`gcc -c -gnata -gnateV`. Either option on its own works fine, as does removing
Unchecked_Union. We don't really need this fixed for anything, I just came
across it while playing with flags.

procedure Example is
   type R (Bytes_Mode : Boolean := False) is record
      case Bytes_Mode is
         when True =>
            A : Boolean;

         when False =>
            B : Boolean;
      end case;
   end record
   with Unchecked_Union;

   function F (Message : R) return Integer
   is (0);
begin
   null;
end Example;

Reply via email to