public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739
@ 2021-06-01  4:04 cnsun at uwaterloo dot ca
  2021-06-01  6:33 ` [Bug middle-end/100843] [12 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: cnsun at uwaterloo dot ca @ 2021-06-01  4:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100843
           Summary: ICE with -O1: in try_store_by_multiple_pieces, at
                    builtins.c:6739
           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.4wFFqTQrHF-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 20210601 (experimental) [master revision
:54832e2f6:28daadc98094501175c9dfe4a985871fa6aa4f94] (GCC)

$ cat mutant.c
char c;
void *memset();
test_integer_conversion_memset(void *d) { memset(d, '\0', c); }

$ gcc-trunk -O1 mutant.c
mutant.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    3 | test_integer_conversion_memset(void *d) { memset(d, '\0', c); }
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mutant.c: In function ‘test_integer_conversion_memset’:
mutant.c:3:59: warning: ‘memset’ argument 3 promotes to ‘int’ where ‘long
unsigned int’ is expected in a call to built-in function declared without
prototype [-Wbuiltin-declaration-mismatch]
    3 | test_integer_conversion_memset(void *d) { memset(d, '\0', c); }
      |                                                           ^
mutant.c:2:7: note: built-in ‘memset’ declared here
    2 | void *memset();
      |       ^~~~~~
during RTL pass: expand
mutant.c:3:43: internal compiler error: in try_store_by_multiple_pieces, at
builtins.c:6739
    3 | test_integer_conversion_memset(void *d) { memset(d, '\0', c); }
      |                                           ^~~~~~~~~~~~~~~~~~
0x681394 try_store_by_multiple_pieces(rtx_def*, rtx_def*, unsigned int,
unsigned long, unsigned long, rtx_def*, char, unsigned int)
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/builtins.c:6739
0xb720bd clear_storage_hints(rtx_def*, rtx_def*, block_op_methods, unsigned
int, long, unsigned long, unsigned long, unsigned long, unsigned int)
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/expr.c:3201
0xa099a2 expand_builtin_memset_args
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/builtins.c:6969
0xa1bbfe expand_builtin_memset
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/builtins.c:6685
0xa1bbfe expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/builtins.c:10187
0xb6be8c expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/expr.c:11429
0xa45f49 expand_expr
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/expr.h:301
0xa45f49 expand_call_stmt
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/cfgexpand.c:2846
0xa45f49 expand_gimple_stmt_1
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/cfgexpand.c:3850
0xa45f49 expand_gimple_stmt
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/cfgexpand.c:4014
0xa4b8a9 expand_gimple_basic_block
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/cfgexpand.c:6056
0xa4d77f execute
        /tmp/tmp.4wFFqTQrHF-gcc-builder/gcc/gcc/cfgexpand.c:6782
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.

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

* [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739
  2021-06-01  4:04 [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 cnsun at uwaterloo dot ca
@ 2021-06-01  6:33 ` rguenth at gcc dot gnu.org
  2021-06-01  7:14 ` [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776 marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  6:33 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |12.0
            Summary|ICE with -O1: in            |[12 Regression] ICE with
                   |try_store_by_multiple_piece |-O1: in
                   |s, at builtins.c:6739       |try_store_by_multiple_piece
                   |                            |s, at builtins.c:6739
                 CC|                            |aoliva at gcc dot gnu.org,
                   |                            |hjl.tools at gmail dot com

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Forgot who of the two of you added the code.  ISTR a dup as well.

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

* [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776
  2021-06-01  4:04 [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 cnsun at uwaterloo dot ca
  2021-06-01  6:33 ` [Bug middle-end/100843] [12 Regression] " rguenth at gcc dot gnu.org
@ 2021-06-01  7:14 ` marxin at gcc dot gnu.org
  2021-11-19 13:13 ` aoliva at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-01  7:14 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12 Regression] ICE with    |[12 Regression] ICE with
                   |-O1: in                     |-O1: in
                   |try_store_by_multiple_piece |try_store_by_multiple_piece
                   |s, at builtins.c:6739       |s, at builtins.c:6739 since
                   |                            |r12-397-gda9e6e63d1ae22e530
                   |                            |ec7baf59f6ed028bf05776
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-06-01
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776.

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

* [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776
  2021-06-01  4:04 [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 cnsun at uwaterloo dot ca
  2021-06-01  6:33 ` [Bug middle-end/100843] [12 Regression] " rguenth at gcc dot gnu.org
  2021-06-01  7:14 ` [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776 marxin at gcc dot gnu.org
@ 2021-11-19 13:13 ` aoliva at gcc dot gnu.org
  2021-12-09  5:07 ` aoliva at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: aoliva at gcc dot gnu.org @ 2021-11-19 13:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |aoliva at gcc dot gnu.org

--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Mine.  bug 100518 seems related, but not necessarily the same issue.

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

* [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776
  2021-06-01  4:04 [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 cnsun at uwaterloo dot ca
                   ` (2 preceding siblings ...)
  2021-11-19 13:13 ` aoliva at gcc dot gnu.org
@ 2021-12-09  5:07 ` aoliva at gcc dot gnu.org
  2021-12-15  5:25 ` cvs-commit at gcc dot gnu.org
  2021-12-15  5:27 ` aoliva at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aoliva at gcc dot gnu.org @ 2021-12-09  5:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Created attachment 51954
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51954&action=edit
candidate patch under testing

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

* [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776
  2021-06-01  4:04 [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 cnsun at uwaterloo dot ca
                   ` (3 preceding siblings ...)
  2021-12-09  5:07 ` aoliva at gcc dot gnu.org
@ 2021-12-15  5:25 ` cvs-commit at gcc dot gnu.org
  2021-12-15  5:27 ` aoliva at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-15  5:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS 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:c95a9f1ee7ebd461cbced455271a993bae3a42b6

commit r12-5983-gc95a9f1ee7ebd461cbced455271a993bae3a42b6
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Dec 15 02:22:33 2021 -0300

    [PR100843] store by mult pieces: punt on max_len < min_len

    The testcase confuses the code that detects min and max len for the
    memset, so max_len ends up less than min_len.  That shouldn't be
    possible, but the testcase requires us to handle this case.

    The store-by-mult-pieces algorithm actually relies on min and max
    lengths, so if we find them to be inconsistent, the best we can do is
    punting.


    for  gcc/ChangeLog

            PR middle-end/100843
            * builtins.c (try_store_by_multiple_pieces): Fail if min_len
            is greater than max_len.

    for  gcc/testsuite/ChangeLog

            PR middle-end/100843
            * gcc.dg/pr100843.c: New.

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

* [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776
  2021-06-01  4:04 [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 cnsun at uwaterloo dot ca
                   ` (4 preceding siblings ...)
  2021-12-15  5:25 ` cvs-commit at gcc dot gnu.org
@ 2021-12-15  5:27 ` aoliva at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: aoliva at gcc dot gnu.org @ 2021-12-15  5:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2021-12-15  5:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-01  4:04 [Bug c/100843] New: ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 cnsun at uwaterloo dot ca
2021-06-01  6:33 ` [Bug middle-end/100843] [12 Regression] " rguenth at gcc dot gnu.org
2021-06-01  7:14 ` [Bug middle-end/100843] [12 Regression] ICE with -O1: in try_store_by_multiple_pieces, at builtins.c:6739 since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776 marxin at gcc dot gnu.org
2021-11-19 13:13 ` aoliva at gcc dot gnu.org
2021-12-09  5:07 ` aoliva at gcc dot gnu.org
2021-12-15  5:25 ` cvs-commit at gcc dot gnu.org
2021-12-15  5:27 ` 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).