public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104930] New: built-in function requires "-flax-vector-conversions" to get better warning
@ 2022-03-15  9:50 linkw at gcc dot gnu.org
  2022-03-15  9:54 ` [Bug target/104930] " linkw at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-03-15  9:50 UTC (permalink / raw)
  To: gcc-bugs

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); }
      |                                 ^~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-03-23  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-15  9:50 [Bug target/104930] New: built-in function requires "-flax-vector-conversions" to get better warning linkw at gcc dot gnu.org
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

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).