public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103121] [12 Regression] Warnings in cp/optimize.c causing build failure
Date: Mon, 08 Nov 2021 19:50:10 +0000	[thread overview]
Message-ID: <bug-103121-4-DgxfdtyfCN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103121-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Martin Sebor <msebor at gcc dot gnu.org> ---
The [1, 1] range comes from a call to qry->range_of_expr (vr, exp, stmt) in in
get_size_range() in pointer-query.cc:

(gdb) p debug(gimple_bb(stmt))
<bb 4> [local count: 118111600]:
_4 = _1 + 1;
grp_name_37 = __builtin_alloca (_4);
p_38 = _32->identifier.id.str;
q_39 = _35->identifier.id.str;
if (_1 != 0)
  goto <bb 16>; [89.00%]
else
  goto <bb 12>; [11.00%]

$3 = void
(gdb) n    
326           max = wi::to_wide (vr.max ());
(gdb) p range_type
$4 = VR_RANGE
(gdb) p debug_tree(vr.min())
 <integer_cst 0x7ffff6da91e0 type <integer_type 0x7ffff78b69d8 size_t> constant
1>
$5 = void
(gdb) p debug_tree(vr.max())
 <integer_cst 0x7ffff6da91e0 type <integer_type 0x7ffff78b69d8 size_t> constant
1>
$6 = void
(gdb) up
#1  0x0000000001513720 in gimple_call_alloc_size (stmt=0x7ffff4c23d80, 
    rng1=0x7fffffffc980, qry=0x7fffffffd8a0)
    at /src/gcc/master/gcc/pointer-query.cc:506
506         if (!get_size_range (qry, size, stmt, r, SR_ALLOW_ZERO |
SR_USE_LARGEST))
(gdb) 
#2  0x000000000151a68c in handle_ssa_name (ptr=0x7ffff4d0ebd0, addr=false, 
    ostype=1, pref=0x7fffffffd230, snlim=..., qry=0x7fffffffd978)
    at /src/gcc/master/gcc/pointer-query.cc:2088
2088          if (gimple_call_alloc_size (stmt, wr, rvals))
(gdb) 
#3  0x000000000151bd4c in compute_objsize_r (ptr=0x7ffff4d0ebd0, 
    stmt=0x7ffff4de2730, addr=false, ostype=1, pref=0x7fffffffd230, 
    snlim=..., qry=0x7fffffffd978)
    at /src/gcc/master/gcc/pointer-query.cc:2380
2380          return handle_ssa_name (ptr, addr, ostype, pref, snlim, qry);
(gdb) 
#4  0x0000000001519e17 in handle_mem_ref (mref=0x7ffff47f8a00, 
    stmt=0x7ffff4de2730, ostype=1, pref=0x7fffffffd230, snlim=..., 
    qry=0x7fffffffd978) at /src/gcc/master/gcc/pointer-query.cc:1976
1976      if (!compute_objsize_r (mrefop, stmt, false, ostype, pref, snlim,
qry))
(gdb) 
#5  0x000000000151b844 in compute_objsize_r (ptr=0x7ffff47f8a00, 
    stmt=0x7ffff4de2730, addr=false, ostype=1, pref=0x7fffffffd230, 
    snlim=..., qry=0x7fffffffd978)
    at /src/gcc/master/gcc/pointer-query.cc:2314
2314          return handle_mem_ref (ptr, stmt, ostype, pref, snlim, qry);
(gdb) 
#6  0x000000000151befc in compute_objsize (ptr=0x7ffff47f8a00, 
    stmt=0x7ffff4de2730, ostype=1, pref=0x7fffffffd230, 
    ptr_qry=0x7fffffffd978) at /src/gcc/master/gcc/pointer-query.cc:2414
2414      if (!compute_objsize_r (ptr, stmt, false, ostype, pref, snlim,
ptr_qry))
(gdb) 
#7  0x000000000192c0df in strlen_pass::maybe_warn_overflow (
    this=0x7fffffffd880, stmt=0x7ffff4de2730, call_lhs=true, 
    len=0x7ffff78ff4e0, si=0x0, plus_one=false, rawmem=false)
    at /src/gcc/master/gcc/tree-ssa-strlen.c:2038
2038      tree destsize = compute_objsize (dest, stmt, ostype, &aref,
&ptr_qry);
(gdb) dg stmt
# .MEM_53 = VDEF <.MEM_36>
*grp_name_37 = 0;
$7 = (gimple *) 0x7ffff4de2730

  parent reply	other threads:[~2021-11-08 19:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07 22:33 [Bug other/103121] New: Warnings danglin at gcc dot gnu.org
2021-11-08  8:19 ` [Bug other/103121] [12 Regression] Warnings in cp/optimize.c causing build failure pinskia at gcc dot gnu.org
2021-11-08  9:24 ` [Bug tree-optimization/103121] " rguenth at gcc dot gnu.org
2021-11-08 13:19 ` dave.anglin at bell dot net
2021-11-08 16:08 ` msebor at gcc dot gnu.org
2021-11-08 16:19 ` danglin at gcc dot gnu.org
2021-11-08 19:00 ` msebor at gcc dot gnu.org
2021-11-08 19:04 ` msebor at gcc dot gnu.org
2021-11-08 19:36 ` amacleod at redhat dot com
2021-11-08 19:50 ` msebor at gcc dot gnu.org [this message]
2021-11-08 20:07 ` amacleod at redhat dot com
2021-11-08 20:48 ` msebor at gcc dot gnu.org
2021-11-08 21:11 ` amacleod at redhat dot com
2021-11-08 21:48 ` msebor at gcc dot gnu.org
2021-11-08 22:35 ` msebor at gcc dot gnu.org
2021-11-09  0:01 ` amacleod at redhat dot com
2021-11-09  1:11 ` msebor at gcc dot gnu.org
2021-11-09  7:20 ` aldyh at gcc dot gnu.org
2021-11-09  7:24 ` aldyh at gcc dot gnu.org
2021-11-09  8:22 ` rguenth at gcc dot gnu.org
2022-01-18 14:34 ` rguenth at gcc dot gnu.org
2022-01-18 20:18 ` amacleod at redhat dot com
2022-01-19  7:36 ` rguenther at suse dot de
2022-01-19 17:50 ` amacleod at redhat dot com
2022-01-20  7:22 ` rguenther at suse dot de
2022-01-20  7:25 ` rguenth at gcc dot gnu.org
2022-01-20 15:49 ` amacleod at redhat dot com
2022-01-20 16:14 ` msebor at gcc dot gnu.org
2022-01-20 17:14 ` danglin at gcc dot gnu.org
2022-01-21  7:27 ` rguenther at suse dot de
2022-01-21 16:16 ` msebor at gcc dot gnu.org
2022-01-21 17:53 ` amacleod at redhat dot com
2022-01-21 18:59 ` msebor 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-103121-4-DgxfdtyfCN@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).