Skip to content

Superfluous dialect symbol in inline assembly #157250

Closed

Description

@fuhsnn

Bug report

Bug description:

This inline assembly block has an extra { at the start that is likely a typo:

__asm__("{movq %%rsp, %0" : "=r" (result));

In GCC style inline assembly syntax, { initiates an dialect selector block [1] and this case forms an unfinished section of that.
It being silently accepted by current GCC/Clang is likely just them being permissive.

[1] https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Multiple-assembler-dialects-in-asm-templates

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Sep 10, 2026
  2. encukou commented on Oct 15, 2026

    @encukou
    Member

    Sorry for missing this issue/PR.
    The line was changed in #158167 to:

        __asm__ ("{movq %%rsp, %0|mov %0, rsp}" : "=r" (result));
    

    Do we need a GCC #ifdef for this?

  3. fuhsnn commented on Oct 15, 2026

    @fuhsnn
    ContributorAuthor

    Thanks for informing!

    Do we need a GCC #ifdef for this?

    Not for slimcc, I just implemented support for these (including the permissive behavior)

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

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions