public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/110962] New: RISC-V vector Fortran ICE in expand_expr_real_2
@ 2023-08-09 19:10 jeremy.bennett at embecosm dot com
  2023-08-10 13:18 ` [Bug middle-end/110962] " cvs-commit at gcc dot gnu.org
  2023-08-14 14:47 ` jeremy.bennett at embecosm dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jeremy.bennett at embecosm dot com @ 2023-08-09 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110962
           Summary: RISC-V vector Fortran ICE in expand_expr_real_2
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jeremy.bennett at embecosm dot com
  Target Milestone: ---

Created attachment 55712
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55712&action=edit
Fortran source for test case

The following code (testcase.f90) causes an ICE when using RISC-V vector as
target.

SUBROUTINE a(b,c,d)
  LOGICAL,DIMENSION(INOUT)  :: b
  LOGICAL e
  REAL, DIMENSION(IN)     ::  c
  REAL, DIMENSION(INOUT)  ::  d
  REAL, DIMENSION(SIZE(c))   :: f
  WHERE (b.AND.e)
     WHERE (f>=0.)
        d = g
     ENDWHERE
  ENDWHERE
END SUBROUTINE a

Compiled with:

riscv64-unknown-linux-gnu-gfortran -march=rv64gcv -mabi=lp64d \
   -c -Ofast --param=riscv-autovec-preference=scalable testcase.f90

Output is:

during RTL pass: expand
testcase.f90:1:12:

    1 | SUBROUTINE a(b,c,d)
      |            ^
internal compiler error: in expand_expr_real_2, at expr.cc:10566
0x830f6d expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        /home/jeremy/gittrees/mustang/gcc/gcc/expr.cc:10566
0xc04ab0 expand_gimple_stmt_1
        /home/jeremy/gittrees/mustang/gcc/gcc/cfgexpand.cc:3983
0xc04ab0 expand_gimple_stmt
        /home/jeremy/gittrees/mustang/gcc/gcc/cfgexpand.cc:4044
0xc097c6 expand_gimple_basic_block
        /home/jeremy/gittrees/mustang/gcc/gcc/cfgexpand.cc:6096
0xc0b176 execute
        /home/jeremy/gittrees/mustang/gcc/gcc/cfgexpand.cc:6831
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.

System information
------------------

Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gfortran
COLLECT_LTO_WRAPPER=/home/jeremy/gittrees/mustang/install/libexec/gcc/riscv64-unknown-linux-gnu/14.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /home/jeremy/gittrees/mustang/gcc/configure
--target=riscv64-unknown-linux-gnu
--prefix=/home/jeremy/gittrees/mustang/install
--with-sysroot=/home/jeremy/gittrees/mustang/install/sysroot
--with-pkgversion=g5c27c911f6b --with-system-zlib --enable-shared --enable-tls
--enable-languages=c,c++,fortran --disable-libmudflap --disable-libssp
--disable-libquadmath --disable-libsanitizer --disable-nls --disable-bootstrap
--src=/home/jeremy/gittrees/mustang/gcc --enable-multilib --with-abi=lp64d
--with-arch=rv64gc --with-tune= --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2
   -mcmodel=medany' 'CXXFLAGS_FOR_TARGET=-O2    -mcmodel=medany'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230809 (experimental) (g5c27c911f6b)

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

* [Bug middle-end/110962] RISC-V vector Fortran ICE in expand_expr_real_2
  2023-08-09 19:10 [Bug middle-end/110962] New: RISC-V vector Fortran ICE in expand_expr_real_2 jeremy.bennett at embecosm dot com
@ 2023-08-10 13:18 ` cvs-commit at gcc dot gnu.org
  2023-08-14 14:47 ` jeremy.bennett at embecosm dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-10 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pan Li <panli@gcc.gnu.org>:

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

commit r14-3126-gda7b43fb0224cdce5157a747fdd6975b7c81c6cf
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Thu Aug 10 18:37:05 2023 +0800

    RISC-V: Add MASK vec_duplicate pattern[PR110962]

    This patch fix bug:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110962

    SUBROUTINE a(b,c,d)
      LOGICAL,DIMENSION(INOUT)  :: b
      LOGICAL e
      REAL, DIMENSION(IN)     ::  c
      REAL, DIMENSION(INOUT)  ::  d
      REAL, DIMENSION(SIZE(c))   :: f
      WHERE (b.AND.e)
         WHERE (f>=0.)
            d = g
         ENDWHERE
      ENDWHERE
    END SUBROUTINE a

       PR target/110962

    gcc/ChangeLog:
            PR target/110962
            * config/riscv/autovec.md (vec_duplicate<mode>): New pattern.

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

* [Bug middle-end/110962] RISC-V vector Fortran ICE in expand_expr_real_2
  2023-08-09 19:10 [Bug middle-end/110962] New: RISC-V vector Fortran ICE in expand_expr_real_2 jeremy.bennett at embecosm dot com
  2023-08-10 13:18 ` [Bug middle-end/110962] " cvs-commit at gcc dot gnu.org
@ 2023-08-14 14:47 ` jeremy.bennett at embecosm dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jeremy.bennett at embecosm dot com @ 2023-08-14 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jeremy Bennett <jeremy.bennett at embecosm dot com> changed:

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

--- Comment #2 from Jeremy Bennett <jeremy.bennett at embecosm dot com> ---
Confirmed patch resolves the issue.

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

end of thread, other threads:[~2023-08-14 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-09 19:10 [Bug middle-end/110962] New: RISC-V vector Fortran ICE in expand_expr_real_2 jeremy.bennett at embecosm dot com
2023-08-10 13:18 ` [Bug middle-end/110962] " cvs-commit at gcc dot gnu.org
2023-08-14 14:47 ` jeremy.bennett at embecosm 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).