Re: [PATCH v7 14/22] x86/decompressor: Merge trampoline cleanup with switching code

From: Ard Biesheuvel
Date: Tue Aug 01 2023 - 08:46:35 EST


On Tue, 1 Aug 2023 at 14:41, Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Tue, Aug 01, 2023 at 02:11:21PM +0200, Ard Biesheuvel wrote:
> > Removing it breaks the build for !CONFIG_X86_5LEVEL
>
> How come?
>

Because a label cannot be at the end of a block. There needs to be at
least one statement.

> $ grep 5LEVEL .config
> # CONFIG_X86_5LEVEL is not set
>
> and it builds fine here.
>

I guess it depends on the compiler version. GCC 10 gives me this

<source>: In function 'foo':
<source>:4:5: error: label at end of compound statement
4 | bar:
| ^~~

but GCC 13 seems to be fine with it.

https://godbolt.org/z/KnWbY8vEY