[gcc r17-2690] Fix m68k bootstrap due to -Wempty-body warning

Jeff Law via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:7c19a52852b7bfef10430b90f8f51eedf217663d

commit r17-2690-g7c19a52852b7bfef10430b90f8f51eedf217663d
Author: Jeff Law <[email protected]>
Date:   Fri Jul 24 16:19:57 2026 -0600

    Fix m68k bootstrap due to -Wempty-body warning
    
    Ah the jobs of conditional compilation...
    
    A recent change is breaking m68k bootstrap as it doesn't have any
    UNSPECV_VALUES and as a result we end up with
    
    if (cond)
      ;
    [ With no else clauses. ]
    
    Which triggers:
    
    > /home/jlaw/test/gcc/gcc/print-rtl.cc: In function ‘void print_exp(pretty_printer*, const_rtx, int)’:
    > /home/jlaw/test/gcc/gcc/print-rtl.cc:1622:11: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
    
    Rather than using ";" we can use a "{}" pair with proper formatting as the
    warning suggests.
    
    Committing as obvious and hopefully restoring m68k bootstrap.
    
    gcc/
            * print-rtl.cc (print_exp): Avoid -Wempty-body warning.

Diff:
---
 gcc/print-rtl.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/print-rtl.cc b/gcc/print-rtl.cc
index b969c6d82299..315b027516dc 100644
--- a/gcc/print-rtl.cc
+++ b/gcc/print-rtl.cc
@@ -1619,7 +1619,8 @@ print_exp (pretty_printer *pp, const_rtx x, int verbose)
 	auto unspec = XINT (x, 1);
 #if !defined(GENERATOR_FILE)
 	if (unspec < 0)
-	  ;
+	  {
+	  }
 #if NUM_UNSPECV_VALUES > 0
 	else if (GET_CODE (x) == UNSPEC_VOLATILE
 		 && unspec < NUM_UNSPECV_VALUES)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.