public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "linkw at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/104930] New: built-in function requires "-flax-vector-conversions" to get better warning
Date: Tue, 15 Mar 2022 09:50:07 +0000	[thread overview]
Message-ID: <bug-104930-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 104930
           Summary: built-in function requires "-flax-vector-conversions"
                    to get better warning
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linkw at gcc dot gnu.org
  Target Milestone: ---

----- Test case -----

$cat new_test.c

typedef vector unsigned int v4u;

extern v4u vg;

v4u testXXPERMDI(void) { return __builtin_vsx_xxpermdi(vg, vg); }

----- Option -----

-mcpu=power9

===

GCC emits:

new_test.c: In function ‘testXXPERMDI’:
new_test.c:5:1: note: use ‘-flax-vector-conversions’ to permit conversions
between vectors with differing element types or numbers of subparts
    5 | v4u testXXPERMDI(void) { return __builtin_vsx_xxpermdi(vg, vg); }
      | ^~~
new_test.c:5:56: error: incompatible type for argument 1 of
‘__builtin_vsx_xxpermdi’
    5 | v4u testXXPERMDI(void) { return __builtin_vsx_xxpermdi(vg, vg); }
      |                                                        ^~
      |                                                        |
      |                                                        v4u {aka
__vector(4) unsigned int}
new_test.c:5:56: note: expected ‘__vector signed char’ {aka ‘__vector(16)
signed cha ’} but argument is of type ‘v4u’ {aka ‘__vector(4) unsigned int’}
new_test.c:5:60: error: incompatible type for argument 2 of
‘__builtin_vsx_xxpermdi’
    5 | v4u testXXPERMDI(void) { return __builtin_vsx_xxpermdi(vg, vg); }
      |                                                            ^~
      |                                                            |
      |                                                            v4u {aka
__vector(4) unsigned int}
new_test.c:5:60: note: expected ‘__vector signed char’ {aka ‘__vector(16)
signed cha ’} but argument is of type ‘v4u’ {aka ‘__vector(4) unsigned int’}
new_test.c:5:33: error: too few arguments to function ‘__builtin_vsx_xxpermdi’
    5 | v4u testXXPERMDI(void) { return __builtin_vsx_xxpermdi(vg, vg); }
      |                                 ^~~~~~~~~~~~~~~~~~~~~~

But with r12-5751-gc9dd01314d8467, it only has:

new_test.c: In function ‘testXXPERMDI’:
new_test.c:5:33: error: too few arguments to function ‘__builtin_vsx_xxpermdi’
    5 | v4u testXXPERMDI(void) { return __builtin_vsx_xxpermdi(vg, vg); }
      |                                 ^~~~~~~~~~~~~~~~~~~~~~

             reply	other threads:[~2022-03-15  9:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15  9:50 linkw at gcc dot gnu.org [this message]
2022-03-15  9:54 ` [Bug target/104930] " linkw at gcc dot gnu.org
2022-03-15  9:58 ` linkw at gcc dot gnu.org
2022-03-23  9:13 ` [Bug target/104930] overloaded built-in functions require " linkw at gcc dot gnu.org
2022-03-23  9:20 ` linkw 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-104930-4@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).