]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix m68k bootstrap due to -Wempty-body warning
authorJeff Law <jeffrey.law@oss.qualcomm.com>
Fri, 24 Jul 2026 22:19:57 +0000 (16:19 -0600)
committerJeff Law <jeffrey.law@oss.qualcomm.com>
Fri, 24 Jul 2026 22:19:57 +0000 (16:19 -0600)
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.

gcc/print-rtl.cc

index b969c6d82299eb91d7239fac741179f7066e4d5d..315b027516dc4e53a65a7ae24e621cff6087f1db 100644 (file)
@@ -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)