public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115289] New: PPC: Document the machine constraint 'Y' and make it non-internal
@ 2024-05-30  7:27 mpe+gcc at ellerman dot id.au
  2024-05-30 14:29 ` [Bug target/115289] " segher at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mpe+gcc at ellerman dot id.au @ 2024-05-30  7:27 UTC (permalink / raw)
  To: gcc-bugs

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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/115289] PPC: Document the machine constraint 'Y' and make it non-internal
  2024-05-30  7:27 [Bug target/115289] New: PPC: Document the machine constraint 'Y' and make it non-internal mpe+gcc at ellerman dot id.au
@ 2024-05-30 14:29 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: segher at gcc dot gnu.org @ 2024-05-30 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

Segher Boessenkool <segher at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-05-30

--- Comment #1 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Yup.  Thanks for the report!

Note that you usually want "YZ", not just "Y", so that things always work (with
just "Y" reloading does not always work).

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/115289] PPC: Document the machine constraint 'Y' and make it non-internal
  2024-05-30  7:27 [Bug target/115289] New: PPC: Document the machine constraint 'Y' and make it non-internal mpe+gcc at ellerman dot id.au
  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
  2 siblings, 0 replies; 4+ messages in thread
From: segher at gcc dot gnu.org @ 2024-05-31 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Note that the testcase isn't valid C (you cannot validly access an array of
char as a long int), but the problem is there anyway.  I'll try to write a
better testcase.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/115289] PPC: Document the machine constraint 'Y' and make it non-internal
  2024-05-30  7:27 [Bug target/115289] New: PPC: Document the machine constraint 'Y' and make it non-internal mpe+gcc at ellerman dot id.au
  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
  2 siblings, 0 replies; 4+ messages in thread
From: segher at gcc dot gnu.org @ 2024-05-31 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Segher Boessenkool <segher at gcc dot gnu.org> ---
This needs backports all the way back to GCC 10 (well, as far back as we can
go, anyway :-) ).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-31 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-30  7:27 [Bug target/115289] New: PPC: Document the machine constraint 'Y' and make it non-internal mpe+gcc at ellerman dot id.au
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

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).