public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102976] New: MMA test case emits wrong code when building a vector pair
@ 2021-10-28  0:33 bergner at gcc dot gnu.org
  2021-10-28  0:35 ` [Bug target/102976] " bergner at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bergner at gcc dot gnu.org @ 2021-10-28  0:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102976
           Summary: MMA test case emits wrong code when building a vector
                    pair
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

The following test case generates wrong code using trunk and GCC11:

[bergner@pike debug]$ cat bug.c 
#include <altivec.h>
void
bug (__vector_pair *dst)
{
  register vector unsigned char vec0 asm ("vs44");
  register vector unsigned char vec1 asm ("vs32");
  __builtin_vsx_build_pair (dst, vec0, vec1);
}
[bergner@pike debug]$ gcc -S -O2 -mcpu=power10 bug.c
[bergner@pike debug]$ cat bug.s 
bug:
        xxlor 0,32,32
        xxlor 1,32,32
        stxvp 0,0(3)
        blr

The above only copies one of the inputs into the output pair, when it should
copy both r44 and r32, like so:
bug:
        xxlor 0,44,44
        xxlor 1,32,32
        stxvp 0,0(3)
        blr

This is due to a missing early clobber in the MMA patterns.  I have a fix I'm
testing.

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

end of thread, other threads:[~2022-02-23 18:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28  0:33 [Bug target/102976] New: MMA test case emits wrong code when building a vector pair bergner at gcc dot gnu.org
2021-10-28  0:35 ` [Bug target/102976] " bergner at gcc dot gnu.org
2021-10-28  0:35 ` bergner at gcc dot gnu.org
2021-10-28  1:44 ` bergner at gcc dot gnu.org
2021-11-16 18:15 ` cvs-commit at gcc dot gnu.org
2021-11-29 17:12 ` cvs-commit at gcc dot gnu.org
2022-01-15  6:00 ` cvs-commit at gcc dot gnu.org
2022-02-23 18:08 ` bergner 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).