Skip to content

gcc 16: "bp cannot be used in 'asm' here" in haswell sup kernels #970

Backlog

Description

@jpittner2

When trying to compile the Dirac program, which employes BLIS, on a gentoo linux with
gcc (Gentoo 16.2.1_p20260926 p1) 16.2.1 20260926
I got an error message:
/quantchem/dirac/build/_deps/blis-src/kernels/haswell/3/sup/bli_gemmsup_rv_haswell_asm_d6x8m.c:1770:1: error: bp cannot be used in 'asm' here
1770 | }

BLIS commit: 358e689 (pulled in by DIRAC)
Compiler: gcc 16.2.1 20260926 (Gentoo 16.2.1_p20260926 p1), x86_64 Linux
Configuration: haswell

Compile command (as generated by the BLIS build):

gcc -O2 -O3 -fomit-frame-pointer -mavx2 -mfma -mfpmath=sse -march=haswell
    -fPIC -std=c99 -D_POSIX_C_SOURCE=200112L -pthread -Iinclude/haswell
    -I frame/include -DBLIS_CNAME=haswell -DBLIS_CNAME_UPPER=HASWELL
    -DBLIS_IS_BUILDING_LIBRARY -c bli_gemmsup_rv_haswell_asm_d6x8m.c

Observations:

  • gcc 14 and gcc 15 compile the file without error.
  • With gcc 16, -fno-stack-protector, -fno-stack-clash-protection or -O2 do not help.
  • Adding -fno-tree-vectorize makes it compile. It looks like gcc 16
    vectorizes the C code around the asm block in a way that requires a
    frame pointer, so rbp in the clobber list is rejected despite
    -fomit-frame-pointer.

Workaround: append -fno-tree-vectorize to CKOPTFLAGS in config/haswell/make_defs.mk.

Jiri Pittner

Activity

  1. added a commit that references this issue on Dec 2, 2026
    50aa84e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions