public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "patrick at rivosinc dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/112733] New: [14 Regression] ICE: Segmentation fault in wide-int.cc during GIMPLE pass: sccp
Date: Mon, 27 Nov 2023 19:12:53 +0000	[thread overview]
Message-ID: <bug-112733-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 112733
           Summary: [14 Regression] ICE: Segmentation fault in wide-int.cc
                    during GIMPLE pass: sccp
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick at rivosinc dot com
  Target Milestone: ---

Reconfirmed using r14-5889-gc9d691a7daa. This has not been bisected.

Using godbolt to check - this is broken on trunk x86, arm, riscv.
Regression from 13.2 where this compiles on x86, arm, riscv.

> cat red.c
char a, c;
short b;
void d() {
  signed char *e = &a;
  c = 0 != d;
  *e &= c;
  for (; b; --b)
    *e &= 128;
}

> /scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc red.c -S -O2 -freport-bug
during GIMPLE pass: sccp
red.c: In function 'd':
red.c:3:6: internal compiler error: Segmentation fault
    3 | void d() {
      |      ^
0x12884a3 crash_signal
        ../../../gcc/gcc/toplev.cc:316
0x7fb10de4251f ???
        ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x163ac0e wi_pack
        ../../../gcc/gcc/wide-int.cc:1303
0x1642d17 wi::divmod_internal(long*, unsigned int*, long*, long const*,
unsigned int, unsigned int, long const*, unsigned int, unsigned int, signop,
wi::overflow_type*)
        ../../../gcc/gcc/wide-int.cc:1988
0xecaf5c wi::binary_traits<generic_wide_int<wi::extended_tree<131072> >,
generic_wide_int<wi::extended_tree<131072> >,
wi::int_traits<generic_wide_int<wi::extended_tree<131072> > >::precision_type,
wi::int_traits<generic_wide_int<wi::extended_tree<131072> >
>::precision_type>::result_type
wi::mod_trunc<generic_wide_int<wi::extended_tree<131072> >,
generic_wide_int<wi::extended_tree<131072> >
>(generic_wide_int<wi::extended_tree<131072> > const&,
generic_wide_int<wi::extended_tree<131072> > const&, signop,
wi::overflow_type*)
        ../../../gcc/gcc/wide-int.h:3382
0xeac199 bool wi::multiple_of_p<generic_wide_int<wi::extended_tree<131072> >,
generic_wide_int<wi::extended_tree<131072> >
>(generic_wide_int<wi::extended_tree<131072> > const&,
generic_wide_int<wi::extended_tree<131072> > const&, signop)
        ../../../gcc/gcc/wide-int.h:3549
0xeac199 multiple_of_p(tree_node*, tree_node const*, tree_node const*, bool)
        ../../../gcc/gcc/fold-const.cc:14554
riscv64-unknown-linux-gnu-gcc: internal compiler error: Segmentation fault
signal terminated program cc1
Please submit a full bug report, with preprocessed source.
See <https://gcc.gnu.org/bugs/> for instructions.


-freport bug does not seem to be working for me so here's the -v output:

> /scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/libexec/gcc/riscv64-unknown-linux-gnu/14.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with:
/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/../gcc/configure
--target=riscv64-unknown-linux-gnu
--prefix=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv
--with-sysroot=/scratch/tc-testing/tc-nov-27-trunk/build-rv64gcv/sysroot
--with-pkgversion=gc9d691a7daa --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=../../gcc --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc
--with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2   
-mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2    -mcmodel=medlow'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231127 (experimental) (gc9d691a7daa)

             reply	other threads:[~2023-11-27 19:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 19:12 patrick at rivosinc dot com [this message]
2023-11-27 19:16 ` [Bug middle-end/112733] " pinskia at gcc dot gnu.org
2023-11-27 19:16 ` pinskia at gcc dot gnu.org
2023-11-27 19:21 ` pinskia at gcc dot gnu.org
2023-11-27 19:25 ` pinskia at gcc dot gnu.org
2023-11-28  9:02 ` rguenth at gcc dot gnu.org
2023-11-28  9:35 ` jakub at gcc dot gnu.org
2023-11-28 14:34 ` jakub at gcc dot gnu.org
2023-11-28 14:48 ` jakub at gcc dot gnu.org
2023-11-28 15:56 ` jakub at gcc dot gnu.org
2023-11-28 16:01 ` jakub at gcc dot gnu.org
2023-11-28 17:37 ` jakub at gcc dot gnu.org
2023-11-28 17:43 ` jakub at gcc dot gnu.org
2023-11-29  9:29 ` jakub at gcc dot gnu.org
2023-11-29 11:27 ` cvs-commit at gcc dot gnu.org
2023-11-30  8:15 ` cvs-commit at gcc dot gnu.org
2023-11-30  8:16 ` jakub at gcc dot gnu.org
2023-12-15 14:05 ` cvs-commit at gcc dot gnu.org
2023-12-16  0:38 ` cvs-commit at gcc dot gnu.org
2023-12-17 13:55 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-112733-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).