public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/106755] Incorrect code gen for altivec intrinsics with constant inputs
Date: Fri, 26 Aug 2022 17:31:03 +0000	[thread overview]
Message-ID: <bug-106755-4-aK5aBVOdnR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106755-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Peter Bergner from comment #2)
> That said, -Wall and -Wstrict-aliasing do not flag
> any warnings with the code.  I suppose they could miss some issues in the
> test case code???

typedef __vector unsigned int vui32_t;
...
typedef __vector unsigned __int128 vui128_t;
...

static inline vui128_t
vec_muludq (vui128_t *mulu, vui128_t a, vui128_t b)
{
...
  *mulu = (vui128_t) t;
...

int
test_muludq (void)
{
  vui32_t i, j, k, l /*, m*/;
....
  k = (vui32_t) test_vec_muludq((vui128_t* )&l, (vui128_t)i, (vui128_t)j);
....
  print_vint128_prod ("2**96-1 * 2**96-1 ", k, i, j, l);


So yes there is aliasing violation as you do the store as vui128_t aka
"__vector unsigned __int128" (which has the same aliasing set) as "__int128"
but then do the load from it as vui32_t aka "__vector unsigned int vui32_t"
(which is the same aliasing set as int). 

-Wstrict-aliasing=3 might warn about this case I can't remember exactly of the
levels of the options but the -Wstrict-aliasing warnings are always not going
to happen, sometimes it is easier to read the code.

  parent reply	other threads:[~2022-08-26 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 14:30 [Bug c/106755] New: " munroesj at gcc dot gnu.org
2022-08-26 15:18 ` [Bug c/106755] " bergner at gcc dot gnu.org
2022-08-26 16:35 ` bergner at gcc dot gnu.org
2022-08-26 17:31 ` pinskia at gcc dot gnu.org [this message]
2022-08-26 18:38 ` [Bug target/106755] " bergner at gcc dot gnu.org
2022-08-26 21:01 ` segher 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-106755-4-aK5aBVOdnR@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).