public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cnsun at uwaterloo dot ca" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/100576] New: ICE at -O1 and above: in decompose, at wide-int.h:984
Date: Wed, 12 May 2021 23:00:36 +0000	[thread overview]
Message-ID: <bug-100576-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 100576
           Summary: ICE at -O1 and above: in decompose, at wide-int.h:984
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cnsun at uwaterloo dot ca
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/scratch/software/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/configure
--enable-languages=c,c++,lto --enable-checking-yes --enable-multiarch
--prefix=/scratch/software/gcc-trunk --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210511 (experimental) [master revision
:61d4686bb:71d38ec80008afdbb9a059253407d80598b765c0] (GCC)

$ cat mutant.c
const char si16_4_rep[] = {0x12};
eq_si16_x() {
  int n, b = sizeof si16_4_rep;
  const *p, *q = si16_4_rep;
  n += memcmp(p, q, b);
  if (n)
    __builtin_abort();
}

$ gcc-trunk -O1 mutant.c
mutant.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | eq_si16_x() {
      | ^~~~~~~~~
mutant.c: In function ‘eq_si16_x’:
mutant.c:4:10: warning: type defaults to ‘int’ in declaration of ‘p’
[-Wimplicit-int]
    4 |   const *p, *q = si16_4_rep;
      |          ^
mutant.c:4:14: warning: type defaults to ‘int’ in declaration of ‘q’
[-Wimplicit-int]
    4 |   const *p, *q = si16_4_rep;
      |              ^
mutant.c:4:18: warning: initialization of ‘const int *’ from incompatible
pointer type ‘const char *’ [-Wincompatible-pointer-types]
    4 |   const *p, *q = si16_4_rep;
      |                  ^~~~~~~~~~
mutant.c:5:8: warning: implicit declaration of function ‘memcmp’
[-Wimplicit-function-declaration]
    5 |   n += memcmp(p, q, b);
      |        ^~~~~~
mutant.c:1:1: note: include ‘<string.h>’ or provide a declaration of ‘memcmp’
  +++ |+#include <string.h>
    1 | const char si16_4_rep[] = {0x12};
mutant.c:5:21: warning: ‘memcmp’ argument 3 type is ‘int’ where ‘long unsigned
int’ is expected in a call to built-in function declared without prototype
[-Wbuiltin-declaration-mismatch]
    5 |   n += memcmp(p, q, b);
      |                     ^
<built-in>: note: built-in ‘memcmp’ declared here
during RTL pass: expand
mutant.c:5:8: internal compiler error: in decompose, at wide-int.h:984
    5 |   n += memcmp(p, q, b);
      |        ^~~~~~~~~~~~~~~
0x679a02 wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> >
>::decompose(long*, unsigned int, generic_wide_int<wide_int_ref_storage<false,
false> > const&)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/wide-int.h:984
0x67e3d1 wi::int_traits<generic_wide_int<wide_int_storage> >::decompose(long*,
unsigned int, generic_wide_int<wide_int_storage> const&)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/tree.h:3479
0x67e3d1 wide_int_ref_storage<true,
false>::wide_int_ref_storage<generic_wide_int<wide_int_storage>
>(generic_wide_int<wide_int_storage> const&, unsigned int)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/wide-int.h:1034
0x67e3d1 generic_wide_int<wide_int_ref_storage<true, false>
>::generic_wide_int<generic_wide_int<wide_int_storage>
>(generic_wide_int<wide_int_storage> const&, unsigned int)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/wide-int.h:790
0x67e3d1 bool wi::ltu_p<generic_wide_int<wide_int_ref_storage<false, false> >,
generic_wide_int<wide_int_storage>
>(generic_wide_int<wide_int_ref_storage<false, false> > const&,
generic_wide_int<wide_int_storage> const&)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/wide-int.h:1937
0x67e3d1 bool wi::leu_p<generic_wide_int<wide_int_storage>,
generic_wide_int<wide_int_ref_storage<false, false> >
>(generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_ref_storage<false, false> > const&)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/wide-int.h:1979
0x67e3d1 check_nul_terminated_array(tree_node*, tree_node*, tree_node*)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/builtins.c:1228
0xa0ad9e check_access(tree_node*, tree_node*, tree_node*, tree_node*,
tree_node*, access_mode, access_data const*)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/builtins.c:4669
0xa0d0e7 check_read_access
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/builtins.c:4909
0xa0e1a1 check_read_access
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/builtins.c:4904
0xa0e1a1 expand_builtin_memcmp
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/builtins.c:7049
0xa12154 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/builtins.c:10226
0xb6243c expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/expr.c:11405
0xb6cf58 store_expr(tree_node*, rtx_def*, int, bool, bool)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/expr.c:5986
0xb6e59f expand_assignment(tree_node*, tree_node*, bool)
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/expr.c:5721
0xa3cb0b expand_call_stmt
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/cfgexpand.c:2841
0xa3cb0b expand_gimple_stmt_1
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/cfgexpand.c:3847
0xa3cb0b expand_gimple_stmt
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/cfgexpand.c:4011
0xa42809 expand_gimple_basic_block
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/cfgexpand.c:6048
0xa4445f execute
        /tmp/tmp.BriefQJ2R3-gcc-builder/gcc/gcc/cfgexpand.c:6732
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

             reply	other threads:[~2021-05-12 23:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 23:00 cnsun at uwaterloo dot ca [this message]
2021-05-13  7:42 ` [Bug c/100576] [11/12 Regression] ICE at -O1 and above: in decompose, at wide-int.h:984 since r11-2928-gd14c547abd484d35 marxin at gcc dot gnu.org
2021-05-16 18:51 ` pinskia at gcc dot gnu.org
2021-05-17 11:36 ` [Bug middle-end/100576] " rguenth at gcc dot gnu.org
2021-05-17 18:02 ` jakub at gcc dot gnu.org
2021-05-17 18:16 ` jakub at gcc dot gnu.org
2021-05-19 10:06 ` cvs-commit at gcc dot gnu.org
2021-05-19 10:06 ` [Bug middle-end/100576] [11 " jakub at gcc dot gnu.org
2021-05-31 14:08 ` cvs-commit at gcc dot gnu.org
2021-05-31 14:57 ` jakub 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-100576-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).