public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/105463] [12/13 Regression] MVE: Wrong code, incorrect alignment assumption
Date: Tue, 03 May 2022 11:31:58 +0000	[thread overview]
Message-ID: <bug-105463-4-3QgsZ334T6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105463-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We vectorize correctly using a 1-byte aligned load:

void __GIMPLE (ssa,guessed_local(1073741824))
bar (const unsigned char * block)
{
  vector(4) unsigned int vect__3.5;
  unsigned int buf[4];

  __BB(2,guessed_local(1073741824)):
  vect__3.5_14 = __MEM <vector(4) unsigned int, 8> ((char *
{ref-all})block_2(D));
  __MEM <vector(4) unsigned int> ((char * {ref-all})&buf) = vect__3.5_14;
  foo (&buf);
  buf ={v} _Literal (unsigned int[4]) {CLOBBER(eol)};
  return;

and expand to

(insn 9 8 10 (set (reg:V4SI 118 [ vect__3.5 ])
        (unspec:V4SI [
                (mem:V4SI (reg/v/f:SI 114 [ block ]) [0 MEM <vector(4) unsigned
int> [(char * {ref-all})block_2(D)]+0 S16 A8])
            ] UNSPEC_MISALIGNED_ACCESS)) "t.c":5:3 -1
     (nil))

which also looks OK.  'buf' is appropriately aligned:

(insn 10 9 0 (set (mem/c:V4SI (reg/f:SI 117) [0 MEM <vector(4) unsigned int>
[(char * {ref-all})&buf]+0 S16 A64])
        (reg:V4SI 118 [ vect__3.5 ])) "t.c":5:3 -1

and it's OK till the very end:

(insn 9 12 10 2 (set (reg:V4SI 28 s12 [orig:118 vect__3.5 ] [118])
        (unspec:V4SI [
                (mem:V4SI (reg:SI 3 r3 [120]) [0 MEM <vector(4) unsigned int>
[(char * {ref-all})block_2(D)]+0 S16 A8])
            ] UNSPEC_MISALIGNED_ACCESS)) "t.c":5:3 4951
{*movmisalignv4si_mve_load}
     (expr_list:REG_DEAD (reg:SI 3 r3 [120])
        (nil)))

so it's a bug in the machine description somehow.

  reply	other threads:[~2022-05-03 11:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03  9:52 [Bug target/105463] New: " acoplan at gcc dot gnu.org
2022-05-03 11:31 ` rguenth at gcc dot gnu.org [this message]
2022-05-03 11:34 ` [Bug target/105463] " rguenth at gcc dot gnu.org
2022-05-03 13:29 ` acoplan at gcc dot gnu.org
2022-05-03 13:42 ` [Bug target/105463] [11/12/13 " rguenth at gcc dot gnu.org
2022-05-03 14:59 ` rearnsha at gcc dot gnu.org
2022-05-03 16:19 ` acoplan at gcc dot gnu.org
2022-05-13 10:25 ` cvs-commit at gcc dot gnu.org
2022-05-13 10:31 ` [Bug target/105463] [11/12 " rearnsha at gcc dot gnu.org
2022-07-26 11:34 ` rguenth at gcc dot gnu.org
2022-09-02 10:16 ` cvs-commit at gcc dot gnu.org
2022-09-02 11:20 ` [Bug target/105463] [11 " cvs-commit at gcc dot gnu.org
2022-09-02 11:21 ` rearnsha 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-105463-4-3QgsZ334T6@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).