public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103231] [12 Regression] ICE (nondeterministic) on valid code at -O1 on x86_64-linux-gnu: Segmentation fault since r12-5014-g6b8b959675a3e14c
Date: Sun, 14 Nov 2021 15:55:16 +0000	[thread overview]
Message-ID: <bug-103231-4-Vl8j7U997V@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103231-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from Martin Liška <marxin at gcc dot gnu.org> ---
But yes, with ulimit -s 512, one can reduce it to:

$ cat pr103231.c
long g_1496_BK8K8el_2738;
int fn1_l_1522;
int fn1_l_2664;
long fn1_l_1761;
unsigned int fn1_l_1812;
int fn1_l_2189;
int fn1_by;
int fn1_l_2688;
short fn1_l_1852;
short fn1_l_2352;
void fn1() {
  unsigned l_2456;
LABEL_5959g:
  __builtin_printf("l_2456=%llu\n", l_2456);
LABEL_TaTak:
  if (fn1_by)
    if (fn1_l_2189) goto LABEL_5959g;
  int BK8K8hl_2189 = fn1_l_2352 * (~fn1_l_1852 & g_1496_BK8K8el_2738);
  short dg = l_2456 & fn1_l_1761;
  l_2456 = dg;
  if (fn1_l_1522) fn1_l_1761 = ~BK8K8hl_2189;
  short Bm9m9El_1852 = ~(~0 && fn1_l_2688);
  unsigned Bm9m9Fl_1522 = -Bm9m9El_1852;
  if (fn1_l_1812) fn1_l_1852 = ~fn1_l_2664 ^ Bm9m9Fl_1522;
  goto LABEL_TaTak;
}

with the following back-trace:

#0  0x0000000001218987 in range_query::get_tree_range (this=0x7fffffffd4a0,
r=..., expr=0x7ffff76200d8, stmt=<optimized out>) at
/home/marxin/Programming/gcc/gcc/value-query.cc:213
#1  0x0000000001bcb812 in fold_using_range::range_of_range_op
(this=0x7ffffff8396f, r=..., s=0x7ffff776c108, src=...) at
/home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:617
#2  0x0000000001bcce12 in fold_using_range::fold_stmt (this=0x7ffffff8396f,
r=..., s=0x7ffff776c108, src=..., name=0x7ffff776b360) at
/home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:552
#3  0x0000000001bc14a7 in gimple_ranger::fold_range_internal
(this=this@entry=0x7fffffffd4a0, r=..., s=s@entry=0x7ffff776c108,
name=name@entry=0x7ffff776b360) at
/home/marxin/Programming/gcc/gcc/gimple-range.cc:243
#4  0x0000000001bc1757 in gimple_ranger::range_of_stmt (this=0x7fffffffd4a0,
r=..., s=0x7ffff776c108, name=0x7ffff776b360) at
/home/marxin/Programming/gcc/gcc/gimple-range.cc:296
#5  0x0000000001bc1dc0 in gimple_ranger::range_of_expr (this=0x7fffffffd4a0,
r=..., expr=0x7ffff776b360, stmt=<optimized out>) at
/home/marxin/Programming/gcc/gcc/gimple-range.cc:113
#6  0x0000000001bcb7e0 in fold_using_range::range_of_range_op
(this=0x7ffffff87c4f, r=..., s=0x7ffff776d140, src=...) at
/home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:600
#7  0x0000000001bcce12 in fold_using_range::fold_stmt (this=0x7ffffff87c4f,
r=..., s=0x7ffff776d140, src=..., name=0x7ffff776b3a8) at
/home/marxin/Programming/gcc/gcc/gimple-range-fold.cc:552
#8  0x0000000001bc14a7 in gimple_ranger::fold_range_internal
(this=this@entry=0x7fffffffd4a0, r=..., s=s@entry=0x7ffff776d140,
name=name@entry=0x7ffff776b3a8) at
/home/marxin/Programming/gcc/gcc/gimple-range.cc:243
...
#164 0x0000000001bc1757 in gimple_ranger::range_of_stmt (this=0x7fffffffd4a0,
r=..., s=0x7ffff773f500, name=0x7ffff776b708) at
/home/marxin/Programming/gcc/gcc/gimple-range.cc:296
#165 0x0000000001bc1dc0 in gimple_ranger::range_of_expr (this=0x7fffffffd4a0,
r=..., expr=0x7ffff776b708, stmt=<optimized out>) at
/home/marxin/Programming/gcc/gcc/gimple-range.cc:113
#166 0x0000000001bfec29 in (anonymous namespace)::format_integer (dir=...,
arg=0x7ffff776b708, query=0x7fffffffd4a0) at
/home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:1386
#167 0x0000000001bf8de4 in (anonymous namespace)::format_directive (info=...,
res=0x7fffffffcf80, dir=..., query=<optimized out>) at
/home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:3091
#168 0x0000000001bfc092 in (anonymous namespace)::compute_format_length
(query=0x7fffffffd4a0, res=0x7fffffffcf80, info=...) at
/home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:4033
#169 handle_printf_call (gsi=gsi@entry=0x7fffffffd880, ptr_qry=...) at
/home/marxin/Programming/gcc/gcc/gimple-ssa-sprintf.c:4703
#170 0x000000000112a8de in strlen_pass::check_and_optimize_call
(this=0x7fffffffd480, zero_write=0x7fffffffd28f) at
/home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5379
#171 0x000000000112b592 in strlen_pass::check_and_optimize_stmt
(this=0x7fffffffd480, cleanup_eh=<optimized out>) at
/home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5583
#172 0x000000000112b9d6 in strlen_pass::before_dom_children
(this=0x7fffffffd480, bb=0x7ffff760d270) at
/home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5767
#173 0x0000000001b8de48 in dom_walker::walk (this=0x7fffffffd480,
bb=0x7ffff760d270) at /home/marxin/Programming/gcc/gcc/domwalk.c:309
#174 0x000000000112befb in (anonymous namespace)::printf_strlen_execute
(fun=0x7ffff7764000, warn_only=<optimized out>) at
/home/marxin/Programming/gcc/gcc/tree-ssa-strlen.c:5831
#175 0x0000000000e2effa in execute_one_pass (pass=0x2a1a250) at
/home/marxin/Programming/gcc/gcc/passes.c:2567
#176 0x0000000000e2f8f3 in execute_pass_list_1 (pass=0x2a1a250) at
/home/marxin/Programming/gcc/gcc/passes.c:2656
#177 0x0000000000e2f905 in execute_pass_list_1 (pass=0x2a17cc0) at
/home/marxin/Programming/gcc/gcc/passes.c:2657
#178 0x0000000000e2f936 in execute_pass_list (fn=0x7ffff7764000,
pass=<optimized out>) at /home/marxin/Programming/gcc/gcc/passes.c:2667
#179 0x0000000000a73975 in cgraph_node::expand (this=0x7ffff7616220) at
/home/marxin/Programming/gcc/gcc/context.h:48
#180 cgraph_node::expand (this=0x7ffff7616220) at
/home/marxin/Programming/gcc/gcc/cgraphunit.c:1781
#181 0x0000000000a74fef in expand_all_functions () at
/home/marxin/Programming/gcc/gcc/cgraphunit.c:1992
#182 symbol_table::compile (this=0x7ffff7605000) at
/home/marxin/Programming/gcc/gcc/cgraphunit.c:2356
#183 symbol_table::compile (this=0x7ffff7605000) at
/home/marxin/Programming/gcc/gcc/cgraphunit.c:2267
#184 0x0000000000a77c58 in symbol_table::finalize_compilation_unit
(this=0x7ffff7605000) at /home/marxin/Programming/gcc/gcc/cgraphunit.c:2537
#185 0x0000000000f1e662 in compile_file () at
/home/marxin/Programming/gcc/gcc/toplev.c:479
#186 0x00000000008b969b in do_compile (no_backend=false) at
/home/marxin/Programming/gcc/gcc/toplev.c:2156
#187 toplev::main (this=this@entry=0x7fffffffdb9e, argc=<optimized out>,
argc@entry=14, argv=<optimized out>, argv@entry=0x7fffffffdce8) at
/home/marxin/Programming/gcc/gcc/toplev.c:2308
#188 0x00000000008bb615 in main (argc=14, argv=0x7fffffffdce8) at
/home/marxin/Programming/gcc/gcc/main.c:39

  parent reply	other threads:[~2021-11-14 15:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14 10:31 [Bug tree-optimization/103231] New: ICE (nondeterministic) on valid code at -O1 on x86_64-linux-gnu: Segmentation fault zhendong.su at inf dot ethz.ch
2021-11-14 10:34 ` Jan Hubicka
2021-11-14 10:34 ` [Bug tree-optimization/103231] " hubicka at kam dot mff.cuni.cz
2021-11-14 10:37 ` pinskia at gcc dot gnu.org
2021-11-14 10:54 ` marxin at gcc dot gnu.org
2021-11-14 10:55 ` [Bug tree-optimization/103231] [12 Regression] ICE (nondeterministic) on valid code at -O1 on x86_64-linux-gnu: Segmentation fault since r12-5014-g6b8b959675a3e14c marxin at gcc dot gnu.org
2021-11-14 11:02 ` marxin at gcc dot gnu.org
2021-11-14 11:05 ` zhendong.su at inf dot ethz.ch
2021-11-14 11:08 ` aldyh at gcc dot gnu.org
2021-11-14 11:08 ` aldyh at gcc dot gnu.org
2021-11-14 15:37 ` zhendong.su at inf dot ethz.ch
2021-11-14 15:45 ` marxin at gcc dot gnu.org
2021-11-14 15:55 ` marxin at gcc dot gnu.org [this message]
2021-11-15  9:08 ` [Bug tree-optimization/103231] [12 Regression] ICE (nondeterministic/stack overflow) " rguenth at gcc dot gnu.org
2021-11-19 19:04 ` amacleod at redhat dot com
2021-11-24 14:06 ` cvs-commit at gcc dot gnu.org
2021-11-24 14:07 ` amacleod at redhat dot com
2021-11-29 14:31 ` law 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-103231-4-Vl8j7U997V@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).