public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/96446] New: ICE when spilling an MMA accumulator
@ 2020-08-03 20:10 bergner at gcc dot gnu.org
  2020-08-03 20:12 ` [Bug target/96446] " bergner at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-08-03 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96446
           Summary: ICE when spilling an MMA accumulator
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

We get an ICE when we are forced to spill an MMA accumulator that has a zero
value.  We seem to be missing a alternative that accepts the value zero in the
move pattern.  This is broken on trunk and the GCC 10 branch.

bergner@pike:~/gcc/BUGS$ cat quad-ice.c 
extern void bar (void);
void
foo (__vector_quad *dst)
{
  __vector_quad acc;
  __builtin_mma_xxsetaccz (&acc);
  bar ();
  *dst = acc;
}

bergner@pike:~/gcc/BUGS$
/home/bergner/gcc/build/gcc-fsf-mainline-base-debug/gcc/xgcc
-B/home/bergner/gcc/build/gcc-fsf-mainline-base-debug/gcc -S -O2 -mcpu=power10
quad-ice.c 
quad-ice.c: In function ‘foo’:
quad-ice.c:9:1: error: could not split insn
    9 | }
      | ^
(insn 15 41 16 (set (reg:PXI 32 0 [orig:117 _1 ] [117])
        (const_int 0 [0])) "quad-ice.c":8:8 2001 {*movpxi}
     (nil))
during RTL pass: final
quad-ice.c:9:1: internal compiler error: in final_scan_insn_1, at final.c:3073
0x11109e6b _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /home/bergner/gcc/gcc-fsf-mainline-base/gcc/rtl-error.c:108
0x10a741bf final_scan_insn_1
        /home/bergner/gcc/gcc-fsf-mainline-base/gcc/final.c:3073
0x10a74a4b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
        /home/bergner/gcc/gcc-fsf-mainline-base/gcc/final.c:3152
0x10a6f807 final_1
        /home/bergner/gcc/gcc-fsf-mainline-base/gcc/final.c:2020
0x10a7b6f7 rest_of_handle_final
        /home/bergner/gcc/gcc-fsf-mainline-base/gcc/final.c:4658
0x10a7be3f execute
        /home/bergner/gcc/gcc-fsf-mainline-base/gcc/final.c:4736
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug target/96446] ICE when spilling an MMA accumulator
  2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
@ 2020-08-03 20:12 ` bergner at gcc dot gnu.org
  2020-08-05 14:55 ` segher at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-08-03 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |powerpc*-*-*
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |bergner at gcc dot gnu.org
                 CC|                            |dje at gcc dot gnu.org,
                   |                            |segher at gcc dot gnu.org,
                   |                            |wschmidt at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-08-03

--- Comment #1 from Peter Bergner <bergner at gcc dot gnu.org> ---
Confirmed and Mine.

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

* [Bug target/96446] ICE when spilling an MMA accumulator
  2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
  2020-08-03 20:12 ` [Bug target/96446] " bergner at gcc dot gnu.org
@ 2020-08-05 14:55 ` segher at gcc dot gnu.org
  2020-08-05 15:42 ` bergner at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: segher at gcc dot gnu.org @ 2020-08-05 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
*movpxi tries to not split xxsetaccz insns, but that one is only for
fpr_reg_operand as operands[0], while *movpxi uses something more
general.

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

* [Bug target/96446] ICE when spilling an MMA accumulator
  2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
  2020-08-03 20:12 ` [Bug target/96446] " bergner at gcc dot gnu.org
  2020-08-05 14:55 ` segher at gcc dot gnu.org
@ 2020-08-05 15:42 ` bergner at gcc dot gnu.org
  2020-08-06 15:10 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-08-05 15:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #2)
> *movpxi tries to not split xxsetaccz insns, but that one is only for
> fpr_reg_operand as operands[0], while *movpxi uses something more
> general.

As we discussed offline, I have already moved xxsetaccz into the movpxi pattern
and I changed the xxsetaccz pattern (needed for the builtin expansion) into a
define_expand that just calls gen_movpxi.  This fixes the ICE above.  However,
I've hit a somewhat related issue with both __vector_pair and __vector_quad
vars being passed as a parameter to an unprototyped function leading to another
ICE or infinite loop.  I'm still digging into that.

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

* [Bug target/96446] ICE when spilling an MMA accumulator
  2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-08-05 15:42 ` bergner at gcc dot gnu.org
@ 2020-08-06 15:10 ` cvs-commit at gcc dot gnu.org
  2020-08-06 15:30 ` bergner at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-06 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Peter Bergner <bergner@gcc.gnu.org>:

https://gcc.gnu.org/g:9c376d1c166e7c8b10bba6f1675d2471ffe8447f

commit r11-2595-g9c376d1c166e7c8b10bba6f1675d2471ffe8447f
Author: Peter Bergner <bergner@linux.ibm.com>
Date:   Thu Aug 6 10:03:03 2020 -0500

    rs6000: Don't ICE when spilling an MMA accumulator

    When we spill an accumulator that has a known zero value, LRA will emit
    a new (set (reg:PXI ...) 0) insn, but it does not use the mma_xxsetaccz
    pattern to do it, leading to an unrecognized insn ICE.  The solution here
    is to move the xxsetaccz instruction into the movpxi pattern and have the
    xxsetaccz pattern call the move pattern.

    2020-08-06  Peter Bergner  <bergner@linux.ibm.com>

    gcc/
            PR target/96446
            * config/rs6000/mma.md (*movpxi): Add xxsetaccz generation.
            Disable split for zero constant source operand.
            (mma_xxsetaccz): Change to define_expand.  Call gen_movpxi.

    gcc/testsuite/
            PR target/96446
            * gcc.target/powerpc/pr96446.c: New test.

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

* [Bug target/96446] ICE when spilling an MMA accumulator
  2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-08-06 15:10 ` cvs-commit at gcc dot gnu.org
@ 2020-08-06 15:30 ` bergner at gcc dot gnu.org
  2020-08-08 22:01 ` cvs-commit at gcc dot gnu.org
  2020-08-10  3:18 ` bergner at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-08-06 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.3

--- Comment #5 from Peter Bergner <bergner at gcc dot gnu.org> ---
Fixed on trunk.  Waiting for it to bake there for a day or two before
backporting to the GCC 10 branch.

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

* [Bug target/96446] ICE when spilling an MMA accumulator
  2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-08-06 15:30 ` bergner at gcc dot gnu.org
@ 2020-08-08 22:01 ` cvs-commit at gcc dot gnu.org
  2020-08-10  3:18 ` bergner at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-08 22:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Peter Bergner
<bergner@gcc.gnu.org>:

https://gcc.gnu.org/g:38b240a9dc7186a51e577dd3ff73c31af3cfb0ab

commit r10-8594-g38b240a9dc7186a51e577dd3ff73c31af3cfb0ab
Author: Peter Bergner <bergner@linux.ibm.com>
Date:   Thu Aug 6 10:03:03 2020 -0500

    rs6000: Don't ICE when spilling an MMA accumulator

    When we spill an accumulator that has a known zero value, LRA will emit
    a new (set (reg:PXI ...) 0) insn, but it does not use the mma_xxsetaccz
    pattern to do it, leading to an unrecognized insn ICE.  The solution here
    is to move the xxsetaccz instruction into the movpxi pattern and have the
    xxsetaccz pattern call the move pattern.

    2020-08-06  Peter Bergner  <bergner@linux.ibm.com>

    gcc/
            PR target/96446
            * config/rs6000/mma.md (*movpxi): Add xxsetaccz generation.
            Disable split for zero constant source operand.
            (mma_xxsetaccz): Change to define_expand.  Call gen_movpxi.

    gcc/testsuite/
            PR target/96446
            * gcc.target/powerpc/pr96446.c: New test.

    (cherry picked from commit 9c376d1c166e7c8b10bba6f1675d2471ffe8447f)

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

* [Bug target/96446] ICE when spilling an MMA accumulator
  2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-08-08 22:01 ` cvs-commit at gcc dot gnu.org
@ 2020-08-10  3:18 ` bergner at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: bergner at gcc dot gnu.org @ 2020-08-10  3:18 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Peter Bergner <bergner at gcc dot gnu.org> ---
Fixed everywhere.

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

end of thread, other threads:[~2020-08-10  3:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-03 20:10 [Bug target/96446] New: ICE when spilling an MMA accumulator bergner at gcc dot gnu.org
2020-08-03 20:12 ` [Bug target/96446] " bergner at gcc dot gnu.org
2020-08-05 14:55 ` segher at gcc dot gnu.org
2020-08-05 15:42 ` bergner at gcc dot gnu.org
2020-08-06 15:10 ` cvs-commit at gcc dot gnu.org
2020-08-06 15:30 ` bergner at gcc dot gnu.org
2020-08-08 22:01 ` cvs-commit at gcc dot gnu.org
2020-08-10  3:18 ` bergner 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).