public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/112784] New: ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops
@ 2023-11-30 14:11 mjires at suse dot cz
  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
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mjires at suse dot cz @ 2023-11-30 14:11 UTC (permalink / raw)
  To: gcc-bugs

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)

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

* [Bug middle-end/112784] ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops -mavx512cd
  2023-11-30 14:11 [Bug middle-end/112784] New: ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops mjires at suse dot cz
@ 2023-12-09  2:58 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: aoliva at gcc dot gnu.org @ 2023-12-09  2:58 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |aoliva at gcc dot gnu.org
   Last reconfirmed|                            |2023-12-09

--- Comment #1 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Mine.

Patch at https://gcc.gnu.org/pipermail/gcc-patches/2023-December/639985.html

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

* [Bug middle-end/112784] ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops -mavx512cd
  2023-11-30 14:11 [Bug middle-end/112784] New: ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops mjires at suse dot cz
  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
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-11 18:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>:

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

commit r14-6431-ga8a3d832e609501002dee54150abfd96a28fe532
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Mon Dec 11 15:09:28 2023 -0300

    -finline-stringops: avoid too-wide smallest_int_mode_for_size [PR112784]

    smallest_int_mode_for_size may abort when the requested mode is not
    available.  Call int_mode_for_size instead, that signals the
    unsatisfiable request in a more graceful way.


    for  gcc/ChangeLog

            PR middle-end/112784
            * expr.cc (emit_block_move_via_loop): Call int_mode_for_size
            for maybe-too-wide sizes.
            (emit_block_cmp_via_loop): Likewise.

    for  gcc/testsuite/ChangeLog

            PR middle-end/112784
            * gcc.target/i386/avx512cd-inline-stringops-pr112784.c: New.

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

* [Bug middle-end/112784] ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops -mavx512cd
  2023-11-30 14:11 [Bug middle-end/112784] New: ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops mjires at suse dot cz
  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
  2 siblings, 0 replies; 4+ messages in thread
From: aoliva at gcc dot gnu.org @ 2023-12-11 18:47 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

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

--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Fixed

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

end of thread, other threads:[~2023-12-11 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30 14:11 [Bug middle-end/112784] New: ICE in smallest_mode_for_size, at stor-layout.cc:356 | -finline-stringops mjires at suse dot cz
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

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).