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

* [Bug target/104930] built-in function requires "-flax-vector-conversions" to get better warning
  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 ` linkw at gcc dot gnu.org
  2022-03-15  9:58 ` linkw at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-03-15  9:54 UTC (permalink / raw)
  To: gcc-bugs

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

Kewen Lin <linkw at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |linkw at gcc dot gnu.org

--- Comment #1 from Kewen Lin <linkw at gcc dot gnu.org> ---
Although it's related to error messages change and users can get more
reasonable error messages with extra option -flax-vector-conversions, I think
we still want the previous behavior?

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

* [Bug target/104930] built-in function requires "-flax-vector-conversions" to get better warning
  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
  3 siblings, 0 replies; 5+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-03-15  9:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Kewen Lin <linkw at gcc dot gnu.org> ---
It's regressed from r12-5752-gd08236359eb229, in the new bif infrastructure we
don't use the type opaque_V4SI_type_node for prototype of overloaded built-in
functions any more.

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

* [Bug target/104930] overloaded built-in functions require "-flax-vector-conversions" to get better warning
  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 ` linkw at gcc dot gnu.org
  2022-03-23  9:20 ` linkw at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-03-23  9:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Kewen Lin <linkw at gcc dot gnu.org> ---
Created attachment 52669
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52669&action=edit
A trial patch

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

* [Bug target/104930] overloaded built-in functions require "-flax-vector-conversions" to get better warning
  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
                   ` (2 preceding siblings ...)
  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
  3 siblings, 0 replies; 5+ messages in thread
From: linkw at gcc dot gnu.org @ 2022-03-23  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Kewen Lin <linkw at gcc dot gnu.org> ---
Hi @Peter and @Segher, do you agree that the previous behavior is better? That
is users don't need one extra option ‘-flax-vector-conversions’ to get more
accurate warnings.

The associated trial patch tries to use opaque_V4SI_type_node like before in
the new bif framework, it does fix the issue for bif vsx_xxpermdi. If getting
back the previous behavior is on the right track, I'll refine it (and also need
to go through all other overload built-in functions).

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