Skip to content

error: cannot jump from this asm goto statement to one of its possible targets #1886

Description

@nathanchance

With perf: Simplify find_get_pmu_context() (hash may have changed, check for the most recent core/guards branch):

$ make -skj"$(nproc)" ARCH=powerpc CC=clang CROSS_COMPILE=powerpc-linux-gnu- LLVM_IAS=0 mrproper 44x/akebono_defconfig kernel/events/core.o
kernel/events/core.c:4807:4: error: cannot jump from this asm goto statement to one of its possible targets
 4807 |                         WARN_ON_ONCE(epc->ctx != ctx);
      |                         ^
include/asm-generic/bug.h:113:3: note: expanded from macro 'WARN_ON_ONCE'
  113 |                 __WARN_FLAGS(BUGFLAG_ONCE |                     \
      |                 ^
arch/powerpc/include/asm/bug.h:101:2: note: expanded from macro '__WARN_FLAGS'
  101 |         WARN_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags), __label_warn_on); \
      |         ^
arch/powerpc/include/asm/bug.h:77:2: note: expanded from macro 'WARN_ENTRY'
   77 |         asm_volatile_goto(                              \
      |         ^
include/linux/compiler_types.h:328:33: note: expanded from macro 'asm_volatile_goto'
  328 | #define asm_volatile_goto(x...) asm goto(x)
      |                                 ^
kernel/events/core.c:4776:4: note: possible target of asm goto statement
 4776 |                         WARN_ON_ONCE(epc->ctx != ctx);
      |                         ^
include/asm-generic/bug.h:113:3: note: expanded from macro 'WARN_ON_ONCE'
  113 |                 __WARN_FLAGS(BUGFLAG_ONCE |                     \
      |                 ^
arch/powerpc/include/asm/bug.h:104:9: note: expanded from macro '__WARN_FLAGS'
  104 |                                                                 \
      |                                                                 ^
kernel/events/core.c:4783:8: note: jump exits scope of variable with __attribute__((cleanup))
 4783 |         void *new __free(kfree) = kzalloc(sizeof(*epc), GFP_KERNEL);
      |               ^
kernel/events/core.c:4776:4: error: cannot jump from this asm goto statement to one of its possible targets
 4776 |                         WARN_ON_ONCE(epc->ctx != ctx);
      |                         ^
include/asm-generic/bug.h:113:3: note: expanded from macro 'WARN_ON_ONCE'
  113 |                 __WARN_FLAGS(BUGFLAG_ONCE |                     \
      |                 ^
arch/powerpc/include/asm/bug.h:101:2: note: expanded from macro '__WARN_FLAGS'
  101 |         WARN_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags), __label_warn_on); \
      |         ^
arch/powerpc/include/asm/bug.h:77:2: note: expanded from macro 'WARN_ENTRY'
   77 |         asm_volatile_goto(                              \
      |         ^
include/linux/compiler_types.h:328:33: note: expanded from macro 'asm_volatile_goto'
  328 | #define asm_volatile_goto(x...) asm goto(x)
      |                                 ^
kernel/events/core.c:4807:4: note: possible target of asm goto statement
 4807 |                         WARN_ON_ONCE(epc->ctx != ctx);
      |                         ^
include/asm-generic/bug.h:113:3: note: expanded from macro 'WARN_ON_ONCE'
  113 |                 __WARN_FLAGS(BUGFLAG_ONCE |                     \
      |                 ^
arch/powerpc/include/asm/bug.h:104:9: note: expanded from macro '__WARN_FLAGS'
  104 |                                                                 \
      |                                                                 ^
kernel/events/core.c:4783:8: note: jump bypasses initialization of variable with __attribute__((cleanup))
 4783 |         void *new __free(kfree) = kzalloc(sizeof(*epc), GFP_KERNEL);
      |               ^
2 errors generated.

Looking at the preprocessed source, I wonder if something is going sideways with __label_warn_on in __WARN_FLAGS()?

For what it is worth, this code may be killed for an independent reason: https://lore.kernel.org/bb8b901b51f1beaaf9fa86ce8ce9b8191817b3e1.1687539638.git.christophe.leroy@csgroup.eu/

Metadata

Metadata

Labels

[BUG] llvmA bug that should be fixed in upstream LLVM[FIXED][LLVM] 17This bug was fixed in LLVM 17.0asm gotorelated to the implementation of asm goto

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions