public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113416] New: ICE: in force_constant_size, at gimplify.cc:742 (in convert_move, at expr.cc:223) with -march=rv64gcv (-march=rv32gcv) and -ftree-parallelize-loops=2
@ 2024-01-16  7:17 zsojka at seznam dot cz
  2024-01-17  2:55 ` [Bug target/113416] " pinskia at gcc dot gnu.org
  2024-01-17  3:00 ` [Bug tree-optimization/113416] " pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: zsojka at seznam dot cz @ 2024-01-16  7:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113416
           Summary: ICE: in force_constant_size, at gimplify.cc:742 (in
                    convert_move, at expr.cc:223) with -march=rv64gcv
                    (-march=rv32gcv) and -ftree-parallelize-loops=2
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: riscv64-unknown-linux-gnu

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

This has been reduced from gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-27.c ;
it fails the same way with -ftree-parallelize-loops=2.

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O -march=rv64gcv -ftree-parallelize-loops=2
testcase.c 
during GIMPLE pass: parloops
testcase.c: In function 'f':
testcase.c:4:1: internal compiler error: in force_constant_size, at
gimplify.cc:743
    4 | f(long out, int n)
      | ^
0xa18136 force_constant_size
        /repo/gcc-trunk/gcc/gimplify.cc:743
0x134e297 gimple_add_tmp_var(tree_node*)
        /repo/gcc-trunk/gcc/gimplify.cc:781
0x1304676 create_tmp_var(tree_node*, char const*)
        /repo/gcc-trunk/gcc/gimple-expr.cc:491
0x1780c4d separate_decls_in_region
        /repo/gcc-trunk/gcc/tree-parloops.cc:2125
0x1782dd1 gen_parallel_loop
        /repo/gcc-trunk/gcc/tree-parloops.cc:3162
0x1784a48 parallelize_loops
        /repo/gcc-trunk/gcc/tree-parloops.cc:4140
0x1785dc1 execute
        /repo/gcc-trunk/gcc/tree-parloops.cc:4228
0x1785dc1 execute
        /repo/gcc-trunk/gcc/tree-parloops.cc:4207
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.


$ riscv64-unknown-linux-gnu-gcc -O -march=rv32gcv -mabi=ilp32
-ftree-parallelize-loops=2 testcase.c 
during RTL pass: expand
testcase.c: In function 'f._loopfn.0':
testcase.c:6:17: internal compiler error: in convert_move, at expr.cc:223
    6 |   for (int i; i < n; i++) {
      |                 ^
0x9f3dd1 convert_move(rtx_def*, rtx_def*, int)
        /repo/gcc-trunk/gcc/expr.cc:223
0x127807a store_expr(tree_node*, rtx_def*, int, bool, bool)
        /repo/gcc-trunk/gcc/expr.cc:6810
0x1279909 expand_assignment(tree_node*, tree_node*, bool)
        /repo/gcc-trunk/gcc/expr.cc:6443
0x112715c expand_gimple_stmt_1
        /repo/gcc-trunk/gcc/cfgexpand.cc:3966
0x112715c expand_gimple_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:4064
0x112e2be expand_gimple_basic_block
        /repo/gcc-trunk/gcc/cfgexpand.cc:6120
0x112fec7 execute
        /repo/gcc-trunk/gcc/cfgexpand.cc:6855
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.


$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-7258-20240115151353-g731444b3c39-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-7258-20240115151353-g731444b3c39-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

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

* [Bug target/113416] ICE: in force_constant_size, at gimplify.cc:742 (in convert_move, at expr.cc:223) with -march=rv64gcv (-march=rv32gcv) and -ftree-parallelize-loops=2
  2024-01-16  7:17 [Bug target/113416] New: ICE: in force_constant_size, at gimplify.cc:742 (in convert_move, at expr.cc:223) with -march=rv64gcv (-march=rv32gcv) and -ftree-parallelize-loops=2 zsojka at seznam dot cz
@ 2024-01-17  2:55 ` pinskia at gcc dot gnu.org
  2024-01-17  3:00 ` [Bug tree-optimization/113416] " pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-17  2:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I thought I saw something similar before for aarch64 and SVE. Maybe OpenMP .

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

* [Bug tree-optimization/113416] ICE: in force_constant_size, at gimplify.cc:742 (in convert_move, at expr.cc:223) with -march=rv64gcv (-march=rv32gcv) and -ftree-parallelize-loops=2
  2024-01-16  7:17 [Bug target/113416] New: ICE: in force_constant_size, at gimplify.cc:742 (in convert_move, at expr.cc:223) with -march=rv64gcv (-march=rv32gcv) and -ftree-parallelize-loops=2 zsojka at seznam dot cz
  2024-01-17  2:55 ` [Bug target/113416] " pinskia at gcc dot gnu.org
@ 2024-01-17  3:00 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-17  3:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|x86_64-pc-linux-gnu         |
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
          Component|target                      |tree-optimization
   Last reconfirmed|                            |2024-01-17
             Target|riscv64-unknown-linux-gnu   |riscv64-unknown-linux-gnu
                   |                            |aarch64-linux-gnu

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

Also fails a similar way with ARMv9-a's SVE:
```
#include <arm_sve.h>

void
f(char* out, int n, svint8_t v2)
{
  for (int i = 0; i < n; i++) {
    *(svint8_t *)(out + i) = v2;
  }
}
```

Compile with ` -O2 -g0 -march=armv9-a -ftree-parallelize-loops=2`.

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

end of thread, other threads:[~2024-01-17  3:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16  7:17 [Bug target/113416] New: ICE: in force_constant_size, at gimplify.cc:742 (in convert_move, at expr.cc:223) with -march=rv64gcv (-march=rv32gcv) and -ftree-parallelize-loops=2 zsojka at seznam dot cz
2024-01-17  2:55 ` [Bug target/113416] " pinskia at gcc dot gnu.org
2024-01-17  3:00 ` [Bug tree-optimization/113416] " 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).