public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/116666] New: [15 Regression] firefox  does not compile
@ 2024-09-10 18:52 pinskia at gcc dot gnu.org
  2024-09-10 18:52 ` [Bug c++/116666] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-09-10 18:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 116666
           Summary: [15 Regression] firefox  does not compile
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Created attachment 59090
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59090&action=edit
testcase

From https://paste.gentoo.zip/UA93hCd1 :
```
 6:01.89 [swgl 0.1.0] cargo:warning=In file included from src/glsl.h:7,
 6:01.89 [swgl 0.1.0] cargo:warning=                 from src/gl.cc:92:
 6:01.89 [swgl 0.1.0] cargo:warning=src/vector_type.h: In instantiation of
'struct glsl::VectorType<__vector(4) int, 4>':
 6:01.89 [swgl 0.1.0] cargo:warning=src/glsl.h:59:63:   required from here
 6:01.89 [swgl 0.1.0] cargo:warning=   59 | SI bool test_equal(Bool cond) {
return test_none(cond != cond.x); }
 6:01.89 [swgl 0.1.0] cargo:warning=      |                                    
                          ^
```

attached is basically vector_type.h  + part of glsl.h which causes the failure.

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

* [Bug c++/116666] [15 Regression] firefox  does not compile
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
@ 2024-09-10 18:52 ` pinskia at gcc dot gnu.org
  2024-09-10 18:53 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-09-10 18:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection
   Target Milestone|---                         |15.0

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

* [Bug c++/116666] [15 Regression] firefox  does not compile
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
  2024-09-10 18:52 ` [Bug c++/116666] " pinskia at gcc dot gnu.org
@ 2024-09-10 18:53 ` pinskia at gcc dot gnu.org
  2024-09-10 18:59 ` [Bug c++/116666] [15 Regression] firefox does not compile since r15-2331 jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-09-10 18:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I can finish reducing this later today after I finish some other stuff.

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
  2024-09-10 18:52 ` [Bug c++/116666] " pinskia at gcc dot gnu.org
  2024-09-10 18:53 ` pinskia at gcc dot gnu.org
@ 2024-09-10 18:59 ` jakub at gcc dot gnu.org
  2024-09-10 19:11 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-09-10 18:59 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[15 Regression] firefox     |[15 Regression] firefox
                   |does not compile            |does not compile since
                   |                            |r15-2331
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |ppalka at gcc dot gnu.org
           Keywords|needs-bisection             |

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r15-2331-g523836716137d0f7f4088c85752a980f5f971b36

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-09-10 18:59 ` [Bug c++/116666] [15 Regression] firefox does not compile since r15-2331 jakub at gcc dot gnu.org
@ 2024-09-10 19:11 ` pinskia at gcc dot gnu.org
  2024-09-10 19:29 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-09-10 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---


  VectorType<mask_type, N> operator==(VectorType x) const {
    return VectorType<mask_type, N>::wrap(data == x.data);
  }
  VectorType<mask_type, N> operator!=(VectorType x) const {
    return VectorType<mask_type, N>::wrap(data != x.data);
  }
  VectorType<mask_type, N> operator<(VectorType x) const {
    return VectorType<mask_type, N>::wrap(data < x.data);
  }
  VectorType<mask_type, N> operator>(VectorType x) const {
    return VectorType<mask_type, N>::wrap(data > x.data);
  }
  VectorType<mask_type, N> operator<=(VectorType x) const {
    return VectorType<mask_type, N>::wrap(data <= x.data);
  }
  VectorType<mask_type, N> operator>=(VectorType x) const {
    return VectorType<mask_type, N>::wrap(data >= x.data);
  }


These all should be VectorType<mask_index, N>, mask_type here is a vector type.
So yes the newer GCC is correct.

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-09-10 19:11 ` pinskia at gcc dot gnu.org
@ 2024-09-10 19:29 ` pinskia at gcc dot gnu.org
  2024-09-10 19:38 ` ppalka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-09-10 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> Started with r15-2331-g523836716137d0f7f4088c85752a980f5f971b36

What happens before this patch is mask_type stays mask_index for the template
argument as the dependent attribute was not being applied (correctly).

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-09-10 19:29 ` pinskia at gcc dot gnu.org
@ 2024-09-10 19:38 ` ppalka at gcc dot gnu.org
  2024-09-10 19:42 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-09-10 19:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
<stdin>: In instantiation of ‘struct glsl::VectorType<__vector(4) int, 4>’:
<stdin>:577:63:   required from here
<stdin>:106:13: error: invalid vector type for attribute ‘vector_size’
<stdin>:108:22: error: invalid vector type for attribute ‘vector_size’
<stdin>:110:13: error: invalid vector type for attribute ‘vector_size’

Agreed.  It looks like the code is trying to apply the vector_size attribute to
an already vector type.  Before r15-2331 we would prematurely strip the
vector_size attribute on the dependent alias when used as a template argument
for a dependent specialization, even though it affects the identity of the
type, so VectorType<mask_type, N> is equivalent to VectorType<mask_index, N>. 
Now we don't, which AFAICT is the more desirable/consistent behavior.

Though I wonder why Clang accepts the testcase given that it also rejects
applying vector_size to a vector type directly:

template<class T>
struct X {
  typedef T A __attribute__((vector_size(16)));
  typedef A B __attribute__((vector_size(16))); // error
};

template struct X<int>;

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-09-10 19:38 ` ppalka at gcc dot gnu.org
@ 2024-09-10 19:42 ` pinskia at gcc dot gnu.org
  2024-09-10 20:25 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-09-10 19:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
On the clang not rejecting the code, there is a clang specific path used for
vector_type so that code is not used for clang.

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-09-10 19:42 ` pinskia at gcc dot gnu.org
@ 2024-09-10 20:25 ` pinskia at gcc dot gnu.org
  2024-09-10 23:38 ` sjames at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-09-10 20:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note for recent GCC, CONVERT and SHUFFLE should be defined as:

#  define CONVERT(vector, type) __builtin_convertvector(vector.data,
type::data_type)
#  define SHUFFLE(a, b, ...) __builtin_shufflevector(a.data, b.data,
__VA_ARGS__)

GCC 15 will produce much better code for both of these with these definitions.

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-09-10 20:25 ` pinskia at gcc dot gnu.org
@ 2024-09-10 23:38 ` sjames at gcc dot gnu.org
  2024-09-18 17:38 ` sjames at gcc dot gnu.org
  2024-09-18 17:44 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-09-10 23:38 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=99785

--- Comment #8 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #7)
> Note for recent GCC, CONVERT and SHUFFLE should be defined as:
> 
> #  define CONVERT(vector, type) __builtin_convertvector(vector.data,
> type::data_type)
> #  define SHUFFLE(a, b, ...) __builtin_shufflevector(a.data, b.data,
> __VA_ARGS__)
> 
> GCC 15 will produce much better code for both of these with these
> definitions.

It doesn't build for me -- maybe the same as the issue mentioned in PR99785 at
the end.

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2024-09-10 23:38 ` sjames at gcc dot gnu.org
@ 2024-09-18 17:38 ` sjames at gcc dot gnu.org
  2024-09-18 17:44 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-09-18 17:38 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://phabricator.service
                   |                            |s.mozilla.com/D222067

--- Comment #9 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Sam James from comment #8)

They ended up (thank you!) handling it in
https://phabricator.services.mozilla.com/D222067.

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

* [Bug c++/116666] [15 Regression] firefox  does not compile since r15-2331
  2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2024-09-18 17:38 ` sjames at gcc dot gnu.org
@ 2024-09-18 17:44 ` jakub at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-09-18 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
"__builtin_shufflevector instead of __builtin_shuffle for better code
generation"
is certainly not true.  Both of the builtins are different and they have their
pros and cons.  For the swgl code if it has been written with
__builtin_shufflevector in mind, it can result in better code, sure, or if one
uses something that can't be expressed by __builtin_shuffle.
On the other side, __builtin_shuffle allows non-constant permutations,
something __builtin_shufflevector doesn't allow.

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

end of thread, other threads:[~2024-09-18 17:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-10 18:52 [Bug c++/116666] New: [15 Regression] firefox does not compile pinskia at gcc dot gnu.org
2024-09-10 18:52 ` [Bug c++/116666] " pinskia at gcc dot gnu.org
2024-09-10 18:53 ` pinskia at gcc dot gnu.org
2024-09-10 18:59 ` [Bug c++/116666] [15 Regression] firefox does not compile since r15-2331 jakub at gcc dot gnu.org
2024-09-10 19:11 ` pinskia at gcc dot gnu.org
2024-09-10 19:29 ` pinskia at gcc dot gnu.org
2024-09-10 19:38 ` ppalka at gcc dot gnu.org
2024-09-10 19:42 ` pinskia at gcc dot gnu.org
2024-09-10 20:25 ` pinskia at gcc dot gnu.org
2024-09-10 23:38 ` sjames at gcc dot gnu.org
2024-09-18 17:38 ` sjames at gcc dot gnu.org
2024-09-18 17:44 ` jakub 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).