public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bergner 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 18:38:33 +0000 [thread overview] Message-ID: <bug-106755-4-EWWl5wynDM@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 --- Comment #4 from Peter Bergner <bergner at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > 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). Yes, I came to the same conclusion and sent Steve a patch offline that fixes the issue. > -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. Ah, I didn't realize we could increase the warning level. Cool! It seems -Wstrict-aliasing=2 is enough to catch the problem: gcc -O3 -Wall -c -fmessage-length=0 -mcpu=power8 -mtune=power8 -Wstrict-aliasing=2 -m64 ../src/vec_bug6.c ../src/vec_bug6.c: In function ‘test_muludq’: ../src/vec_bug6.c:969:45: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 969 | k = (vui32_t) test_vec_muludq((vui128_t* )&l, (vui128_t)i, (vui128_t)j); ...
next prev parent reply other threads:[~2022-08-26 18:38 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 ` [Bug target/106755] " pinskia at gcc dot gnu.org 2022-08-26 18:38 ` bergner at gcc dot gnu.org [this message] 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-EWWl5wynDM@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: linkBe 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).