https://gcc.gnu.org/g:89e7b9b2bb6fbfa529d3eb7dc5c8e48d722aec95

commit r14-11020-g89e7b9b2bb6fbfa529d3eb7dc5c8e48d722aec95
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Mon Dec 2 18:03:31 2024 +0000

    [PATCH] modula2: Add noreturn attribute to m2/gm2-libs/M2RTS.mod
    
    This patch removes a build warning by adding a noreturn attribute
    to the M2RTS.mod:HaltC procedure.  Also add an infinite loop to
    gm2-libs-min/M2RTS.mod.
    
    gcc/m2/ChangeLog:
    
            * Make-lang.in (m2/gm2-libs-boot/M2RTS.o): Remove
            --suppress-noreturn.
            * gm2-libs/M2RTS.mod (HaltC): Add noreturn attribute.
            * gm2-libs-min/M2RTS.mod (HALT): Add LOOP END.
    
    (cherry picked from commit 5ef52ec422b8b92539baaa761ad878ccb6f82db8)
    
    Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>

Diff:
---
 gcc/m2/Make-lang.in           | 2 +-
 gcc/m2/gm2-libs-min/M2RTS.mod | 2 ++
 gcc/m2/gm2-libs/M2RTS.mod     | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in
index 02754e98c572..480c4fb28a7e 100644
--- a/gcc/m2/Make-lang.in
+++ b/gcc/m2/Make-lang.in
@@ -1477,7 +1477,7 @@ mcflex.c: $(srcdir)/m2/mc/mc.flex
 
 m2/gm2-libs-boot/M2RTS.o: $(srcdir)/m2/gm2-libs/M2RTS.mod $(MCDEPS) 
$(BUILD-BOOT-H)
        -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR)
-       $(MC) --suppress-noreturn -o=m2/gm2-libs-boot/M2RTS.c 
$(srcdir)/m2/gm2-libs/M2RTS.mod
+       $(MC) -o=m2/gm2-libs-boot/M2RTS.c $(srcdir)/m2/gm2-libs/M2RTS.mod
        $(COMPILER) $(CM2DEP) -c -DIN_GCC $(CFLAGS) $(GM2_PICFLAGS) 
$(MC_SRC_FLAGS) -I$(srcdir)/m2 -Im2 -I. -Im2/gm2-libs-boot 
-I$(srcdir)/m2/gm2-libs-ch $(MCINCLUDES) $(INCLUDES) m2/gm2-libs-boot/M2RTS.c 
-o $@
        $(POSTCOMPILE)
 
diff --git a/gcc/m2/gm2-libs-min/M2RTS.mod b/gcc/m2/gm2-libs-min/M2RTS.mod
index ae8cbfffbec9..1f04a027f82c 100644
--- a/gcc/m2/gm2-libs-min/M2RTS.mod
+++ b/gcc/m2/gm2-libs-min/M2RTS.mod
@@ -69,6 +69,8 @@ END ExecuteInitialProcedures ;
 
 PROCEDURE HALT ;
 BEGIN
+   LOOP
+   END
 END HALT ;
 
 
diff --git a/gcc/m2/gm2-libs/M2RTS.mod b/gcc/m2/gm2-libs/M2RTS.mod
index cb3c26f7ce11..98726a8d737e 100644
--- a/gcc/m2/gm2-libs/M2RTS.mod
+++ b/gcc/m2/gm2-libs/M2RTS.mod
@@ -286,7 +286,7 @@ END ErrorMessageC ;
            to stderr and calls exit (1).
 *)
 
-PROCEDURE HaltC (description, filename, function: ADDRESS; line: CARDINAL) ;
+PROCEDURE HaltC (description, filename, function: ADDRESS; line: CARDINAL) <* 
noreturn *> ;
 BEGIN
    ErrorMessageC (description, filename, line, function) ;
    exit (1)

Reply via email to