public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/110603] New: GCC, ICE: internal compiler error: in verify_range, at value-range.cc:1104
@ 2023-07-09 11:34 141242068 at smail dot nju.edu.cn
  2023-07-09 14:57 ` [Bug tree-optimization/110603] [14 Regression] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: 141242068 at smail dot nju.edu.cn @ 2023-07-09 11:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110603
           Summary: GCC, ICE: internal compiler error: in verify_range, at
                    value-range.cc:1104
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 141242068 at smail dot nju.edu.cn
  Target Milestone: ---

The testing program:
```
typedef long unsigned int size_t;
void *memcpy(void *, const void *, size_t);
int snprintf(char *restrict, size_t, const char *restrict, ...);

extern char a[2];
void test_func_on_line_62(void) {
  memcpy(a, "12", sizeof("12") - 1);
  const int res = snprintf(0, 0, "%s", a);
  if (res <= 3)
    do {
      extern void f(void);
      f();
    } while (0);
}
```

When attempting to compile it with `gcc-14 -O2 small.c`, gcc-14 crashes:
```
during GIMPLE pass: strlen
<source>: In function 'test_func_on_line_62':
<source>:6:6: internal compiler error: in verify_range, at value-range.cc:1104
    6 | void test_func_on_line_62(void) {
      |      ^~~~~~~~~~~~~~~~~~~~
0x213b0ee internal_error(char const*, ...)
        ???:0
0x9ca9f8 fancy_abort(char const*, int, char const*)
        ???:0
0x13df0f7 irange::set(tree_node*, generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&, value_range_kind)
        ???:0
0x1e24a5d handle_printf_call(gimple_stmt_iterator*, pointer_query&)
        ???:0
0x12d3d86 strlen_pass::check_and_optimize_call(bool*)
        ???:0
0x12d4109 strlen_pass::check_and_optimize_stmt(bool*)
        ???:0
0x12d4494 strlen_pass::before_dom_children(basic_block_def*)
        ???:0
0x1d98997 dom_walker::walk(basic_block_def*)
        ???:0
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.
```

This crash can be verified at https://gcc.godbolt.org/z/439GM47z9

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

end of thread, other threads:[~2024-01-29  9:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-09 11:34 [Bug c/110603] New: GCC, ICE: internal compiler error: in verify_range, at value-range.cc:1104 141242068 at smail dot nju.edu.cn
2023-07-09 14:57 ` [Bug tree-optimization/110603] [14 Regression] " pinskia at gcc dot gnu.org
2023-07-10  6:36 ` rguenth at gcc dot gnu.org
2023-10-17 12:10 ` rguenth at gcc dot gnu.org
2024-01-02 20:39 ` doko at gcc dot gnu.org
2024-01-09 18:06 ` [Bug tree-optimization/110603] [14 Regression] GCC, ICE: internal compiler error: in verify_range, at value-range.cc:1104 since r14-255 jakub at gcc dot gnu.org
2024-01-10 10:31 ` aldyh at gcc dot gnu.org
2024-01-23 11:16 ` jakub at gcc dot gnu.org
2024-01-27 12:48 ` jakub at gcc dot gnu.org
2024-01-29  9:21 ` cvs-commit at gcc dot gnu.org
2024-01-29  9:30 ` jakub 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).