public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105049] New: ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop
@ 2022-03-24 22:41 zsojka at seznam dot cz
  2022-03-25  7:22 ` [Bug tree-optimization/105049] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zsojka at seznam dot cz @ 2022-03-24 22:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105049
           Summary: ICE: in build_vector_from_val, at tree.cc:2119 with -O
                    -fno-tree-forwprop
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-forwprop testcase.c 
during GIMPLE pass: veclower2
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: in build_vector_from_val, at
tree.cc:2119
    6 | foo (void)
      | ^~~
0x8077e9 build_vector_from_val(tree_node*, tree_node*)
        /repo/gcc-trunk/gcc/tree.cc:2119
0x15ff0aa expand_vector_operations_1
        /repo/gcc-trunk/gcc/tree-vect-generic.cc:2176
0x15ff0aa expand_vector_operations
        /repo/gcc-trunk/gcc/tree-vect-generic.cc:2372
0x15ff0aa execute
        /repo/gcc-trunk/gcc/tree-vect-generic.cc:2418
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-7804-20220324143116-g346ab5a54a8-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-7804-20220324143116-g346ab5a54a8-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.1 20220324 (experimental) (GCC)

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

* [Bug tree-optimization/105049] ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop
  2022-03-24 22:41 [Bug tree-optimization/105049] New: ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop zsojka at seznam dot cz
@ 2022-03-25  7:22 ` rguenth at gcc dot gnu.org
  2022-03-25  7:42 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-25  7:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Last reconfirmed|                            |2022-03-25

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.

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

* [Bug tree-optimization/105049] ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop
  2022-03-24 22:41 [Bug tree-optimization/105049] New: ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop zsojka at seznam dot cz
  2022-03-25  7:22 ` [Bug tree-optimization/105049] " rguenth at gcc dot gnu.org
@ 2022-03-25  7:42 ` rguenth at gcc dot gnu.org
  2022-03-25 12:15 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-25  7:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
We have

  return VIEW_CONVERT_EXPR<U>( VEC_PERM_EXPR < {<<< Unknown tree:
compound_literal_expr
        V D.1984 = { 0 }; >>>, { 0 }} , {<<< Unknown tree:
compound_literal_expr
        V D.1985 = { 0 }; >>>, { 0 }} , { 0, 0 } >  & {(short int) SAVE_EXPR
<c>, (short int) SAVE_EXPR <c>});

where we gimplify the init CTORs to

  _1 = {{ 0 }, { 0 }};
  _2 = {{ 0 }, { 0 }};

instead of to vector constants.  That later runs into a bug in uniform_vector_p
which doesn't handle CTORs of vector elements correctly.  Only forwprop
eventually folds those.

I have a patch to fix both issues.

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

* [Bug tree-optimization/105049] ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop
  2022-03-24 22:41 [Bug tree-optimization/105049] New: ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop zsojka at seznam dot cz
  2022-03-25  7:22 ` [Bug tree-optimization/105049] " rguenth at gcc dot gnu.org
  2022-03-25  7:42 ` rguenth at gcc dot gnu.org
@ 2022-03-25 12:15 ` cvs-commit at gcc dot gnu.org
  2022-03-25 12:16 ` rguenth at gcc dot gnu.org
  2022-12-07  2:28 ` [Bug tree-optimization/105049] [12 Regression] " pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-25 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:0b0fc52b0412cc1608f4f0edb8a0ab2495619c4e

commit r12-7813-g0b0fc52b0412cc1608f4f0edb8a0ab2495619c4e
Author: Richard Biener <rguenther@suse.de>
Date:   Fri Mar 25 08:43:45 2022 +0100

    middle-end/105049 - fix uniform_vector_p and vector CTOR gimplification

    We have

      return VIEW_CONVERT_EXPR<U>( VEC_PERM_EXPR < {<<< Unknown tree:
compound_literal_expr
            V D.1984 = { 0 }; >>>, { 0 }} , {<<< Unknown tree:
compound_literal_expr
            V D.1985 = { 0 }; >>>, { 0 }} , { 0, 0 } >  & {(short int)
SAVE_EXPR <c>, (short int) SAVE_EXPR <c>});

    where we gimplify the init CTORs to

      _1 = {{ 0 }, { 0 }};
      _2 = {{ 0 }, { 0 }};

    instead of to vector constants.  That later runs into a bug in
    uniform_vector_p which doesn't handle CTORs of vector elements
    correctly.

    The following adjusts uniform_vector_p to handle CTORs of vector
    elements.

    2022-03-25  Richard Biener  <rguenther@suse.de>

            PR middle-end/105049
            * tree.cc (uniform_vector_p): Recurse for VECTOR_CST or
            CONSTRUCTOR first elements.

            * gcc.dg/pr105049.c: New testcase.

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

* [Bug tree-optimization/105049] ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop
  2022-03-24 22:41 [Bug tree-optimization/105049] New: ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-03-25 12:15 ` cvs-commit at gcc dot gnu.org
@ 2022-03-25 12:16 ` rguenth at gcc dot gnu.org
  2022-12-07  2:28 ` [Bug tree-optimization/105049] [12 Regression] " pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-25 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

* [Bug tree-optimization/105049] [12 Regression] ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop
  2022-03-24 22:41 [Bug tree-optimization/105049] New: ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-03-25 12:16 ` rguenth at gcc dot gnu.org
@ 2022-12-07  2:28 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-07  2:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
            Summary|ICE: in                     |[12 Regression] ICE: in
                   |build_vector_from_val, at   |build_vector_from_val, at
                   |tree.cc:2119 with -O        |tree.cc:2119 with -O
                   |-fno-tree-forwprop          |-fno-tree-forwprop

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

end of thread, other threads:[~2022-12-07  2:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24 22:41 [Bug tree-optimization/105049] New: ICE: in build_vector_from_val, at tree.cc:2119 with -O -fno-tree-forwprop zsojka at seznam dot cz
2022-03-25  7:22 ` [Bug tree-optimization/105049] " rguenth at gcc dot gnu.org
2022-03-25  7:42 ` rguenth at gcc dot gnu.org
2022-03-25 12:15 ` cvs-commit at gcc dot gnu.org
2022-03-25 12:16 ` rguenth at gcc dot gnu.org
2022-12-07  2:28 ` [Bug tree-optimization/105049] [12 Regression] " pinskia 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).