public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mjires at suse dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/112784] New: ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops
Date: Thu, 30 Nov 2023 14:11:31 +0000	[thread overview]
Message-ID: <bug-112784-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 112784
           Summary: ICE in smallest_mode_for_size, at stor-layout.cc:356 |
                    -finline-stringops
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mjires at suse dot cz
                CC: aoliva at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase c-c++-common/torture/builtin-clear-padding-2.c
results in ICE with new -finline-stringops.


$ cat builtin-clear-padding-2.c
struct S {
  int e;
} __attribute__((aligned(128)));

int main() {
  struct S s1;
  struct S s2;
  int v = __builtin_memcmp(&s1, &s2, sizeof(s1));
}


$ gcc builtin-clear-padding-2.c -mavx512cd -finline-stringops
during RTL pass: expand
builtin-clear-padding-2.c: In function ‘main’:
builtin-clear-padding-2.c:8:11: internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356
    8 |   int v = __builtin_memcmp(&s1, &s2, sizeof(s1));
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x10111ef smallest_mode_for_size(poly_int<1u, unsigned long>, mode_class)
        /home/mjires/git/GCC/master/gcc/stor-layout.cc:356
0xc19bc2 smallest_int_mode_for_size(poly_int<1u, unsigned long>)
        /home/mjires/git/GCC/master/gcc/machmode.h:916
0xc19bc2 emit_block_cmp_via_loop
        /home/mjires/git/GCC/master/gcc/expr.cc:2705
0xab40ab expand_builtin_memcmp
        /home/mjires/git/GCC/master/gcc/builtins.cc:4825
0xabea1f expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
        /home/mjires/git/GCC/master/gcc/builtins.cc:7893
0xc0e9e4 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/mjires/git/GCC/master/gcc/expr.cc:12304
0xc1b4d5 store_expr(tree_node*, rtx_def*, int, bool, bool)
        /home/mjires/git/GCC/master/gcc/expr.cc:6711
0xc21870 expand_assignment(tree_node*, tree_node*, bool)
        /home/mjires/git/GCC/master/gcc/expr.cc:6432
0xc21870 expand_assignment(tree_node*, tree_node*, bool)
        /home/mjires/git/GCC/master/gcc/expr.cc:5947
0xae9026 expand_call_stmt
        /home/mjires/git/GCC/master/gcc/cfgexpand.cc:2830
0xae9026 expand_gimple_stmt_1
        /home/mjires/git/GCC/master/gcc/cfgexpand.cc:3881
0xae9026 expand_gimple_stmt
        /home/mjires/git/GCC/master/gcc/cfgexpand.cc:4045
0xaea307 expand_gimple_basic_block
        /home/mjires/git/GCC/master/gcc/cfgexpand.cc:6101
0xaebf66 execute
        /home/mjires/git/GCC/master/gcc/cfgexpand.cc:6836
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.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap --enable-checking
--enable-languages=c,c++,fortran,lto
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20231130 (experimental) (GCC)

             reply	other threads:[~2023-11-30 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 14:11 mjires at suse dot cz [this message]
2023-12-09  2:58 ` [Bug middle-end/112784] ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops -mavx512cd aoliva at gcc dot gnu.org
2023-12-11 18:32 ` cvs-commit at gcc dot gnu.org
2023-12-11 18:47 ` aoliva 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-112784-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).