[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-29 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

Peter Bergner  changed:

   What|Removed |Added

  Known to fail||10.0, 11.0, 12.0, 13.0
 Status|ASSIGNED|RESOLVED
   Assignee|segher at gcc dot gnu.org  |bergner at gcc dot 
gnu.org
 Resolution|--- |FIXED

--- Comment #14 from Peter Bergner  ---
Fixed everywhere.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #13 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Peter Bergner
:

https://gcc.gnu.org/g:3927bd9f9150576f2905c8930732c419f1850fca

commit r10-10966-g3927bd9f9150576f2905c8930732c419f1850fca
Author: Peter Bergner 
Date:   Sat Aug 27 19:44:16 2022 -0500

rs6000: Allow conversions of MMA pointer types [PR106017]

GCC incorrectly disables conversions between MMA pointer types, which
are allowed with clang.  The original intent was to disable conversions
between MMA types and other other types, but pointer conversions should
have been allowed.  The fix is to just remove the MMA pointer conversion
handling code altogether.

gcc/
PR target/106017
* config/rs6000/rs6000.c (rs6000_invalid_conversion): Remove
handling
of MMA pointer conversions.

gcc/testsuite/
PR target/106017
* gcc.target/powerpc/pr106017.c: New test.

(cherry picked from commit 1ae1325f24cea1698b56e4299d95446a1f7b90a2)

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #12 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Peter Bergner
:

https://gcc.gnu.org/g:f494a85f0bf653c3128b376c1abf821a27748c11

commit r11-10227-gf494a85f0bf653c3128b376c1abf821a27748c11
Author: Peter Bergner 
Date:   Sat Aug 27 19:44:16 2022 -0500

rs6000: Allow conversions of MMA pointer types [PR106017]

GCC incorrectly disables conversions between MMA pointer types, which
are allowed with clang.  The original intent was to disable conversions
between MMA types and other other types, but pointer conversions should
have been allowed.  The fix is to just remove the MMA pointer conversion
handling code altogether.

gcc/
PR target/106017
* config/rs6000/rs6000.c (rs6000_invalid_conversion): Remove
handling
of MMA pointer conversions.

gcc/testsuite/
PR target/106017
* gcc.target/powerpc/pr106017.c: New test.

(cherry picked from commit 1ae1325f24cea1698b56e4299d95446a1f7b90a2)

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #11 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Peter Bergner
:

https://gcc.gnu.org/g:22ff125247ff5328ad4544aef939d491618d714d

commit r12-8726-g22ff125247ff5328ad4544aef939d491618d714d
Author: Peter Bergner 
Date:   Sat Aug 27 19:44:16 2022 -0500

rs6000: Allow conversions of MMA pointer types [PR106017]

GCC incorrectly disables conversions between MMA pointer types, which
are allowed with clang.  The original intent was to disable conversions
between MMA types and other other types, but pointer conversions should
have been allowed.  The fix is to just remove the MMA pointer conversion
handling code altogether.

gcc/
PR target/106017
* config/rs6000/rs6000.cc (rs6000_invalid_conversion): Remove
handling
of MMA pointer conversions.

gcc/testsuite/
PR target/106017
* gcc.target/powerpc/pr106017.c: New test.

(cherry picked from commit 1ae1325f24cea1698b56e4299d95446a1f7b90a2)

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #10 from CVS Commits  ---
The master branch has been updated by Peter Bergner :

https://gcc.gnu.org/g:1ae1325f24cea1698b56e4299d95446a1f7b90a2

commit r13-2239-g1ae1325f24cea1698b56e4299d95446a1f7b90a2
Author: Peter Bergner 
Date:   Sat Aug 27 19:44:16 2022 -0500

rs6000: Allow conversions of MMA pointer types [PR106017]

GCC incorrectly disables conversions between MMA pointer types, which
are allowed with clang.  The original intent was to disable conversions
between MMA types and other other types, but pointer conversions should
have been allowed.  The fix is to just remove the MMA pointer conversion
handling code altogether.

gcc/
PR target/106017
* config/rs6000/rs6000.cc (rs6000_invalid_conversion): Remove
handling
of MMA pointer conversions.

gcc/testsuite/
PR target/106017
* gcc.target/powerpc/pr106017.c: New test.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #9 from Peter Bergner  ---
(In reply to Peter Bergner from comment #7)
> I think we just want to remove the entire section in
> rs6000_invalid_conversion() that checks the XOmode/OOmode pointer
> conversions.  Doing that fixes the ICE and fixes the PR106015 ICE too.  I'm
> doing a bootstrap and regtest of that patch now.

Testing was clean, so I'll submit the patch.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #8 from Peter Bergner  ---
*** Bug 106015 has been marked as a duplicate of this bug. ***

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-08-27 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #7 from Peter Bergner  ---
I think we just want to remove the entire section in
rs6000_invalid_conversion() that checks the XOmode/OOmode pointer conversions. 
Doing that fixes the ICE and fixes the PR106015 ICE too.  I'm doing a bootstrap
and regtest of that patch now.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-06-17 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

Peter Bergner  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-06-17 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #6 from Segher Boessenkool  ---
FWIW, reinterpret_cast allows exactly the same things as C casts (but with the
obvious C++ extensions: member objects, member functions, C++'s concept of
lvalue, that kins of thing).  It is not similar to bit_cast at all.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-06-17 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

Segher Boessenkool  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |segher at gcc dot 
gnu.org

--- Comment #5 from Segher Boessenkool  ---
Okay, I'll handle it.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-06-17 Thread nemanja.i.ibm at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #4 from Nemanja Ivanovic  ---
(In reply to Peter Bergner from comment #2)
> (In reply to Segher Boessenkool from comment #1)
> > So the restriction in rs6000_invalid_conversion errors for valid C programs.
> > What was it intended to accomplish?
> 
> We do not want or allow automatic conversions between the opaque
> __vector_pair and __vector_quad types and other types and those are
> correctly disallowed there.  Conversions between those types needs to go
> through the builtins defined for that.
> 
> As for the pointer conversions tested there, I guess they came along for the
> ride?  Nemanja, do you remember the history there?  Or does LLVM allow the
> pointer conversions and it's just GCC that complains?

Yes, the desired semantics are to disallow implicit or explicit conversions
from these types to any other types. But pointer casts (presumably including
reinterpret_cast in C++) should be fair game. Clang allows these conversions.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-06-17 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #3 from Segher Boessenkool  ---
(In reply to Peter Bergner from comment #2)
> We do not want or allow automatic conversions between the opaque
> __vector_pair and __vector_quad types and other types and those are
> correctly disallowed there.

Of course, but that is not what this is about...

> As for the pointer conversions tested there, I guess they came along for the
> ride?  Nemanja, do you remember the history there?  Or does LLVM allow the
> pointer conversions and it's just GCC that complains?

... this is.

Possibly the restriction prevents some ICEs elsewhere, but those just need to
be solved then, not hidden.

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-06-17 Thread bergner at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

--- Comment #2 from Peter Bergner  ---
(In reply to Segher Boessenkool from comment #1)
> So the restriction in rs6000_invalid_conversion errors for valid C programs.
> What was it intended to accomplish?

We do not want or allow automatic conversions between the opaque __vector_pair
and __vector_quad types and other types and those are correctly disallowed
there.  Conversions between those types needs to go through the builtins
defined for that.

As for the pointer conversions tested there, I guess they came along for the
ride?  Nemanja, do you remember the history there?  Or does LLVM allow the
pointer conversions and it's just GCC that complains?

[Bug target/106017] [PowerPC] No array-to-pointer conversion for MMA accumulator

2022-06-17 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106017

Segher Boessenkool  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2022-06-17

--- Comment #1 from Segher Boessenkool  ---
Confirmed.

C allows to convert a pointer to data to any other pointer to data (possibly
modulo alignment restrictions).  What is *not* valid is accessing anything via
a type not compatible with its effective type (or via a character type).

So the restriction in rs6000_invalid_conversion errors for valid C programs.
What was it intended to accomplish?