public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mpe+gcc at ellerman dot id.au" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/115289] New: PPC: Document the machine constraint 'Y' and make it non-internal
Date: Thu, 30 May 2024 07:27:56 +0000	[thread overview]
Message-ID: <bug-115289-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115289

            Bug ID: 115289
           Summary: PPC: Document the machine constraint 'Y' and make it
                    non-internal
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpe+gcc at ellerman dot id.au
  Target Milestone: ---

Please document the "Y" inline asm constraint for powerpc. It's needed to
correctly pass arbitrary pointer arguments to inline asm using a DS-form
instruction.

The Linux Kernel plans to use the constraint, see:

 
https://lore.kernel.org/linuxppc-dev/20240529123029.146953-1-mpe@ellerman.id.au/

A minimal reproducer for the problem seen in the kernel is below.

$ cat test.c
struct {
  long a;
  long b;
  short c;
  char d[8];
} e;

void f(void) {
  unsigned long v = 0;
  unsigned long *g = (unsigned long *)&e.d;
  asm goto("std%X0 %1,%0        # put_user\n" : "=m"(*g) : "r"(v) : : out);
out:
}

$ gcc-14 -Wall -nostdinc -O2 -c -o test.o test.c
/tmp/ccsSkWJz.s: Assembler messages:
/tmp/ccsSkWJz.s:21: Error: operand out of domain (18 is not a multiple of 4)

             reply	other threads:[~2024-05-30  7:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30  7:27 mpe+gcc at ellerman dot id.au [this message]
2024-05-30 14:29 ` [Bug target/115289] " segher at gcc dot gnu.org
2024-05-31 16:09 ` segher at gcc dot gnu.org
2024-05-31 16:17 ` segher at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-115289-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).