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 tree-optimization/102949] [12 regression] gcc.dg/vect/slp-reduc-1.c FAIL
Date: Thu, 28 Oct 2021 08:10:09 +0000	[thread overview]
Message-ID: <bug-102949-4-Iu0nG6rjhT@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102949-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Hm, I tried --target=sparcv8-sun-solaris2.11 but that seems to fail to
reproduce any vectorization with -O2 -ftree-vectorize.  If I add -mvis I get
something
that could resemble the code you quote:

main1:
        save    %sp, -104, %sp
        cmp     %i0, 0
        ble,pn  %icc, .LL6
         mov    30, %g1
        sethi   %hi(.LLC0), %g3
        sethi   %hi(uc), %g1
        sll     %i0, 4, %i0
        or      %g1, %lo(uc), %g1
        sethi   %hi(ub), %g2
        ldd     [%g3+%lo(.LLC0)], %f12
        or      %g2, %lo(ub), %g2
        sethi   %hi(.LLC1), %g3
        add     %i0, %g1, %i0
        ldd     [%g3+%lo(.LLC1)], %f14
.LL3:
        ldd     [%g1], %f18
        ldd     [%g1+8], %f16
        ldd     [%g2], %f10
        ldd     [%g2+8], %f8
        fpsub32 %f10, %f18, %f10
        fpsub32 %f8, %f16, %f8
        add     %g1, 16, %g1
        fpadd32 %f14, %f10, %f14
        fpadd32 %f12, %f8, %f12
        cmp     %i0, %g1
        bne,pt  %icc, .LL3
         add    %g2, 16, %g2

here it should be that %g1 is '&uc[0]' initially and maintain alignment.

But somehow we end up with:

        .section        ".data"
        .align 4
        .type   uc, #object
        .size   uc, 64
uc:
        .long   0
        .long   1
        .long   2
        .long   3

so 'uc' is not properly aligned even though the vectorizer thinks it forces
that.  And the rev in question likely caused that to misbehave.

  parent reply	other threads:[~2021-10-28  8:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 14:54 [Bug tree-optimization/102949] New: " ro at gcc dot gnu.org
2021-10-26 14:54 ` [Bug tree-optimization/102949] " ro at gcc dot gnu.org
2021-10-27  6:52 ` rguenth at gcc dot gnu.org
2021-10-28  8:10 ` rguenth at gcc dot gnu.org [this message]
2021-10-28  8:19 ` ro at CeBiTec dot Uni-Bielefeld.DE
2021-10-28  8:23 ` ebotcazou at gcc dot gnu.org
2021-10-28  8:25 ` rguenth at gcc dot gnu.org
2021-10-28  9:02 ` cvs-commit at gcc dot gnu.org
2021-10-28  9:03 ` rguenth at gcc dot gnu.org
2021-10-29  7:02 ` ro at CeBiTec dot Uni-Bielefeld.DE

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-102949-4-Iu0nG6rjhT@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).