public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98681] New: aarch64: Invalid ubfiz instruction rejected by assembler
@ 2021-01-14 13:31 acoplan at gcc dot gnu.org
  2021-01-14 13:31 ` [Bug target/98681] " acoplan at gcc dot gnu.org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: acoplan at gcc dot gnu.org @ 2021-01-14 13:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98681
           Summary: aarch64: Invalid ubfiz instruction rejected by
                    assembler
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

AArch64 GCC generates an invalid ubfiz instruction for the following testcase:

extern unsigned char a[];
int b;
void c() {
  for (int d; d < 120; d += 6)
    a[d] = b << -64;
}

$ aarch64-elf-gcc -c test.c -O3
test.c: In function 'c':
test.c:5:14: warning: left shift count is negative [-Wshift-count-negative]
    5 |     a[d] = b << -64;
      |              ^~
/tmp/ccelsQle.s: Assembler messages:
/tmp/ccelsQle.s:14: Error: immediate value out of range 0 to 31 at operand 3 --
`ubfiz w1,w1,-64,8'

Although this testcase invokes UB, it was reduced from a testcase which
ostensibly does not. In any case, we should not generate invalid assembly here.

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

end of thread, other threads:[~2021-04-22 17:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 13:31 [Bug target/98681] New: aarch64: Invalid ubfiz instruction rejected by assembler acoplan at gcc dot gnu.org
2021-01-14 13:31 ` [Bug target/98681] " acoplan at gcc dot gnu.org
2021-01-14 13:45 ` [Bug target/98681] [8/9/10/11 Regression] " ktkachov at gcc dot gnu.org
2021-01-14 13:56 ` rguenth at gcc dot gnu.org
2021-01-15  2:26 ` pinskia at gcc dot gnu.org
2021-01-22 15:35 ` jakub at gcc dot gnu.org
2021-01-22 15:51 ` jakub at gcc dot gnu.org
2021-01-22 16:37 ` rearnsha at gcc dot gnu.org
2021-01-22 16:47 ` jakub at gcc dot gnu.org
2021-01-22 17:36 ` jakub at gcc dot gnu.org
2021-01-22 17:56 ` jakub at gcc dot gnu.org
2021-01-26 13:50 ` cvs-commit at gcc dot gnu.org
2021-01-26 14:00 ` [Bug target/98681] [8/9/10 " jakub at gcc dot gnu.org
2021-01-29 19:20 ` cvs-commit at gcc dot gnu.org
2021-01-29 19:24 ` [Bug target/98681] [8/9 " jakub at gcc dot gnu.org
2021-04-20 23:31 ` cvs-commit at gcc dot gnu.org
2021-04-22 16:50 ` cvs-commit at gcc dot gnu.org
2021-04-22 17:11 ` jakub 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).