public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
@ 2023-06-28 15:34 law at gcc dot gnu.org
  2023-06-28 19:34 ` [Bug tree-optimization/110460] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: law at gcc dot gnu.org @ 2023-06-28 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110460
           Summary: [14 Regression] ft32 ICE on 931110-1.c with new
                    TYPE_PRECISION checking
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

commit fe48f2651334bc4d96b6df6b2bb6b29fcb732a83
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Jun 9 09:31:14 2023 +0200

    Prevent TYPE_PRECISION on VECTOR_TYPEs

    The following makes sure that using TYPE_PRECISION on VECTOR_TYPE
    ICEs when tree checking is enabled.  This should avoid wrong-code
    in cases like PR110182 and instead ICE.

    It also introduces a TYPE_PRECISION_RAW accessor and adjusts
    places I found that are eligible to use that.

            * tree.h (TYPE_PRECISION): Check for non-VECTOR_TYPE.
            (TYPE_PRECISION_RAW): Provide raw access to the precision
            field.
            * tree.cc (verify_type_variant): Compare TYPE_PRECISION_RAW.
            (gimple_canonical_types_compatible_p): Likewise.
            * tree-streamer-out.cc (pack_ts_type_common_value_fields):
            Stream TYPE_PRECISION_RAW.
            * tree-streamer-in.cc (unpack_ts_type_common_value_fields):
            Likewise.
            * lto-streamer-out.cc (hash_tree): Hash TYPE_PRECISION_RAW.

    gcc/lto/
            * lto-common.cc (compare_tree_sccs_1): Use TYPE_PRECISION_RAW.


One example on ft32-elf:

Tests that now fail, but worked before (13 tests):

ft32-sim: gcc.c-torture/execute/931110-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
ft32-sim: gcc.c-torture/execute/931110-1.c   -O3 -g  (test for excess errors)
ft32-sim: gcc.dg/pr108095.c (test for excess errors)

And if you dig into the 931110-1.c failure you find:
ft32-sim: gcc.c-torture/execute/931110-1.c   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error: tree check: expected none of vector_type, have vector_type in
type_has_mode_precision_p, at tree.h:6644)
ft32-sim: gcc.c-torture/execute/931110-1.c   -O3 -g  (internal compiler error:
tree check: expected none of vector_type, have vector_type in
type_has_mode_precision_p, at tree.h:6644)

It looks like SCALAR_DEST in vectorizable_operation is actually a vector type
-- meaning that STMT was already vectorized.

This is the patch I'm testing.  There are other failures that don't seem to be
fixed by this patch.  Anyway, the whole point of the change is to find these
lurking bugs.

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index d642d3c257f..3dd8a284577 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -6481,6 +6481,10 @@ vectorizable_operation (vec_info *vinfo,
   scalar_dest = gimple_assign_lhs (stmt);
   vectype_out = STMT_VINFO_VECTYPE (stmt_info);

+  /* STMT may have already been vectorized.  */
+  if (VECTOR_TYPE_P (TREE_TYPE (scalar_dest)))
+    return false;
+
   /* Most operations cannot handle bit-precision types without extra
      truncations.  */
   bool mask_op_p = VECTOR_BOOLEAN_TYPE_P (vectype_out);

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

* [Bug tree-optimization/110460] [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
  2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
@ 2023-06-28 19:34 ` pinskia at gcc dot gnu.org
  2023-06-29  7:35 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-28 19:34 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |14.0

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

* [Bug tree-optimization/110460] [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
  2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
  2023-06-28 19:34 ` [Bug tree-optimization/110460] " pinskia at gcc dot gnu.org
@ 2023-06-29  7:35 ` rguenth at gcc dot gnu.org
  2023-06-29  7:38 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-29  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2023-06-29

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine - I'll have a look what happens here.

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

* [Bug tree-optimization/110460] [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
  2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
  2023-06-28 19:34 ` [Bug tree-optimization/110460] " pinskia at gcc dot gnu.org
  2023-06-29  7:35 ` rguenth at gcc dot gnu.org
@ 2023-06-29  7:38 ` rguenth at gcc dot gnu.org
  2023-06-29  8:42 ` ro at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-29  7:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So we're trying vectorizing SImode vector<2> short as SImode vector<1> int. 
Usually the vectorizer fends off existing vector code quite early which doesn't
work here for some reason.

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

* [Bug tree-optimization/110460] [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
  2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-06-29  7:38 ` rguenth at gcc dot gnu.org
@ 2023-06-29  8:42 ` ro at gcc dot gnu.org
  2023-06-29  9:57 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ro at gcc dot gnu.org @ 2023-06-29  8:42 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|ft32-elf, moxie-elf         |ft32-elf, moxie-elf, sparc,
                   |                            |powerpc64, aarch64
                 CC|                            |ro at gcc dot gnu.org

--- Comment #3 from Rainer Orth <ro at gcc dot gnu.org> ---
I'm seeing quite a number of the same error on sparc-sun-solaris2.11, and
gcc-testresults shows more on aarch64 and powerpc64*.

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

* [Bug tree-optimization/110460] [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
  2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-06-29  8:42 ` ro at gcc dot gnu.org
@ 2023-06-29  9:57 ` cvs-commit at gcc dot gnu.org
  2023-06-29  9:59 ` rguenth at gcc dot gnu.org
  2023-06-29 10:33 ` manuel.lauss at googlemail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-29  9:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r14-2186-gcd23ed2119120bd7b710fbe679fdfcb8f4461800
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Jun 29 10:23:29 2023 +0200

    tree-optimization/110460 - fend off vector types from vectorizer

    The following makes fending off existing vector types from vectorization
    also apply to word_mode vector types.  I've chosen to add a positive
    list of allowed scalar types here for clarity.

            PR tree-optimization/110460
            * tree-vect-stmts.cc (get_related_vectype_for_scalar_type):
            Only allow integral, pointer and scalar float type scalar_type.

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

* [Bug tree-optimization/110460] [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
  2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-06-29  9:57 ` cvs-commit at gcc dot gnu.org
@ 2023-06-29  9:59 ` rguenth at gcc dot gnu.org
  2023-06-29 10:33 ` manuel.lauss at googlemail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-06-29  9:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

* [Bug tree-optimization/110460] [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking
  2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-06-29  9:59 ` rguenth at gcc dot gnu.org
@ 2023-06-29 10:33 ` manuel.lauss at googlemail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: manuel.lauss at googlemail dot com @ 2023-06-29 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel Lauss <manuel.lauss at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manuel.lauss at googlemail dot com

--- Comment #6 from Manuel Lauss <manuel.lauss at googlemail dot com> ---
*** Bug 110482 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2023-06-29 10:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-28 15:34 [Bug tree-optimization/110460] New: [14 Regression] ft32 ICE on 931110-1.c with new TYPE_PRECISION checking law at gcc dot gnu.org
2023-06-28 19:34 ` [Bug tree-optimization/110460] " pinskia at gcc dot gnu.org
2023-06-29  7:35 ` rguenth at gcc dot gnu.org
2023-06-29  7:38 ` rguenth at gcc dot gnu.org
2023-06-29  8:42 ` ro at gcc dot gnu.org
2023-06-29  9:57 ` cvs-commit at gcc dot gnu.org
2023-06-29  9:59 ` rguenth at gcc dot gnu.org
2023-06-29 10:33 ` manuel.lauss at googlemail 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).