public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "141242068 at smail dot nju.edu.cn" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/110603] New: GCC, ICE: internal compiler error: in verify_range, at value-range.cc:1104
Date: Sun, 09 Jul 2023 11:34:35 +0000	[thread overview]
Message-ID: <bug-110603-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2023-07-09 11:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-09 11:34 141242068 at smail dot nju.edu.cn [this message]
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

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