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

            Bug ID: 114227
           Summary: InstallTerminationProcedure does not work with -fiso
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: gaius at gcc dot gnu.org
  Target Milestone: ---

Forwarded from the gm2 mailing list.  Given a program:

MODULE glibc_test2;

FROM IOChan IMPORT
  ChanId;
FROM StdChans IMPORT
  StdOutChan;
FROM TextIO IMPORT
  WriteLn, WriteString;

FROM M2RTS IMPORT
  InstallTerminationProcedure ;

VAR
  cid_out:                      ChanId;

PROCEDURE P1();
  BEGIN                         (* PROCEDURE P1 *)
    WriteString(cid_out, 'This is P1');
    WriteLn(cid_out);
  END P1;

PROCEDURE P2();
  BEGIN                         (* PROCEDURE P2 *)
    WriteString(cid_out, 'This is P2');
    WriteLn(cid_out);
  END P2;

BEGIN                           (* MODULE glibc_test *)
   cid_out:=StdOutChan();
   IF InstallTerminationProcedure (P2)
   THEN
      P1();
   END
END glibc_test2.


$ gm2 -fiso glibc_test2.mod
$ ./a.out 
This is P1

whereas if it is compiled and linked with:


$ gm2 glibc_test2.mod
$ ./a.out 
This is P1
This is P2

Reply via email to