public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
@ 2023-05-12 10:32 jamborm at gcc dot gnu.org
  2023-05-12 11:22 ` [Bug target/109825] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-05-12 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109825
           Summary: [14 Regression] ICE in ix86_widen_mult_cost, at
                    config/i386/i386.cc:20442 since
                    r14-666-g608e7f3ab47fe7
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org
                CC: uros at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

Compiling our gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c with -Os
-ftree-slp-vectorize -mavx512vl (or -Oz, for that matter) leads to an
ICE:

/tmp$ ~/gcc/small/inst/bin/gcc -Os -ftree-slp-vectorize -mavx512vl
~/gcc/small/src/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c -S
during GIMPLE pass: slp
/home/mjambor/gcc/small/src/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c: In
function ‘foo1’:
/home/mjambor/gcc/small/src/gcc/testsuite/gcc.dg/vect/slp-widen-mult-u8.c:15:1:
internal compiler error: in ix86_widen_mult_cost, at config/i386/i386.cc:20442
   15 | foo1(int len) {
      | ^~~~
0x82f95a ix86_widen_mult_cost
        /home/mjambor/gcc/small/src/gcc/config/i386/i386.cc:20442
0x82f95a ix86_vector_costs::add_stmt_cost(int, vect_cost_for_stmt,
_stmt_vec_info*, _slp_tree*, tree_node*, int, vect_cost_model_location)
        /home/mjambor/gcc/small/src/gcc/config/i386/i386.cc:23479
0x11fe9b2 add_stmt_cost(vector_costs*, int, vect_cost_for_stmt,
_stmt_vec_info*, _slp_tree*, tree_node*, int, vect_cost_model_location)
        /home/mjambor/gcc/small/src/gcc/tree-vectorizer.h:1779
0x11fe9b2 add_stmt_cost(vector_costs*, stmt_info_for_cost*)
        /home/mjambor/gcc/small/src/gcc/tree-vectorizer.h:1801
0x11fe9b2 vect_bb_vectorization_profitable_p
        /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:6928
0x1202f3e vect_slp_region
        /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:7441
0x1203eec vect_slp_bbs
        /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:7611
0x12041cc vect_slp_function(function*)
        /home/mjambor/gcc/small/src/gcc/tree-vect-slp.cc:7712
0x120e3d1 execute
        /home/mjambor/gcc/small/src/gcc/tree-vectorizer.cc:1529


I have bisected this to r14-666-g608e7f3ab47fe7:

commit 608e7f3ab47fe746279c552c3574147aa3d8ee76 (HEAD)
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed May 10 22:40:53 2023 +0200

    i386: Add missing vector extend patterns [PR92658]

    Add missing insn pattern for v2qi -> v2si vector extend and named
    expanders to activate generation of vector extends to 8-byte and 4-byte
    vectors.

    gcc/ChangeLog:

            PR target/92658
            * config/i386/mmx.md (sse4_1_<code>v2qiv2si2): New insn pattern.
            (<insn>v4qiv4hi2): New expander.
            (<insn>v2hiv2si2): Ditto.
            (<insn>v2qiv2si2): Ditto.
            (<insn>v2qiv2hi2): Ditto.

    gcc/testsuite/ChangeLog:

            PR target/92658
            * gcc.target/i386/pr92658-sse4-4b.c: New test.
            * gcc.target/i386/pr92658-sse4-8b.c: New test.

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
@ 2023-05-12 11:22 ` rguenth at gcc dot gnu.org
  2023-05-12 11:35 ` ubizjak at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-12 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think this was just fixed?

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
  2023-05-12 11:22 ` [Bug target/109825] " rguenth at gcc dot gnu.org
@ 2023-05-12 11:35 ` ubizjak at gmail dot com
  2023-05-12 11:40 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2023-05-12 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #1)
> I think this was just fixed?

No, the asked mode is V2HImode, so it should also be added.

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
  2023-05-12 11:22 ` [Bug target/109825] " rguenth at gcc dot gnu.org
  2023-05-12 11:35 ` ubizjak at gmail dot com
@ 2023-05-12 11:40 ` ubizjak at gmail dot com
  2023-05-12 11:49 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2023-05-12 11:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #2)
> (In reply to Richard Biener from comment #1)
> > I think this was just fixed?
> 
> No, the asked mode is V2HImode, so it should also be added.

OTOH, it is a bit strange to report some fake cost for unsupported modes.
Should we return an arbitrary high value for unsupported modes instead of just
ICEing?

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-05-12 11:40 ` ubizjak at gmail dot com
@ 2023-05-12 11:49 ` ubizjak at gmail dot com
  2023-05-13  0:03 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2023-05-12 11:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
Like this:

--cut here--
diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
index 62fe06fdbaa..e6091b8bd35 100644
--- a/gcc/config/i386/i386.cc
+++ b/gcc/config/i386/i386.cc
@@ -20417,14 +20417,12 @@ ix86_widen_mult_cost (const struct processor_costs
*cost,
   int basic_cost = 0;
   switch (mode)
     {
-    case V4HImode:
     case V8HImode:
     case V16HImode:
       if (!uns_p || mode == V16HImode)
        extra_cost = cost->sse_op * 2;
       basic_cost = cost->mulss * 2 + cost->sse_op * 4;
       break;
-    case V2SImode:
     case V4SImode:
     case V8SImode:
       /* pmulhw/pmullw can be used.  */
@@ -20441,7 +20439,8 @@ ix86_widen_mult_cost (const struct processor_costs
*cost,
       basic_cost = cost->mulss * 2 + cost->sse_op * 4;
       break;
     default:
-      gcc_unreachable();
+      /* Not implemented.  */
+      return 1000;
     }
   return ix86_vec_cost (mode, basic_cost + extra_cost);
 }
--cut here--

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-05-12 11:49 ` ubizjak at gmail dot com
@ 2023-05-13  0:03 ` pinskia at gcc dot gnu.org
  2023-05-13  0:06 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-13  0:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |slyfox at gcc dot gnu.org

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 109838 has been marked as a duplicate of this bug. ***

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-05-13  0:03 ` pinskia at gcc dot gnu.org
@ 2023-05-13  0:06 ` pinskia at gcc dot gnu.org
  2023-05-13  8:31 ` ubizjak at gmail dot com
  2023-05-14 19:59 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-05-13  0:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-05-13

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

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-05-13  0:06 ` pinskia at gcc dot gnu.org
@ 2023-05-13  8:31 ` ubizjak at gmail dot com
  2023-05-14 19:59 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2023-05-13  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |haochen.jiang at intel dot com

--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> ---
*** Bug 109807 has been marked as a duplicate of this bug. ***

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

* [Bug target/109825] [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7
  2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-05-13  8:31 ` ubizjak at gmail dot com
@ 2023-05-14 19:59 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2023-05-14 19:59 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #8 from Uroš Bizjak <ubizjak at gmail dot com> ---
Dup.

*** This bug has been marked as a duplicate of bug 109807 ***

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

end of thread, other threads:[~2023-05-14 19:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 10:32 [Bug target/109825] New: [14 Regression] ICE in ix86_widen_mult_cost, at config/i386/i386.cc:20442 since r14-666-g608e7f3ab47fe7 jamborm at gcc dot gnu.org
2023-05-12 11:22 ` [Bug target/109825] " rguenth at gcc dot gnu.org
2023-05-12 11:35 ` ubizjak at gmail dot com
2023-05-12 11:40 ` ubizjak at gmail dot com
2023-05-12 11:49 ` ubizjak at gmail dot com
2023-05-13  0:03 ` pinskia at gcc dot gnu.org
2023-05-13  0:06 ` pinskia at gcc dot gnu.org
2023-05-13  8:31 ` ubizjak at gmail dot com
2023-05-14 19:59 ` ubizjak at gmail dot com

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