public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/105329] Bogus restrict warning when assigning 1-char string literal to std::string
Date: Fri, 22 Apr 2022 10:31:55 +0000	[thread overview]
Message-ID: <bug-105329-4-6C5w0HBxqp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105329-4@http.gcc.gnu.org/bugzilla/>

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aldyh at gcc dot gnu.org

--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Andrew Macleod from comment #3)

> p vr.dump(stderr)
> const size_type [1, 9223372036854775807]
> 
> I also have a breakpoint in set_range_info for this name which hasn't been
> triggered.   So either the set routine have been bypassed or perhaps
> inlining is setting this global value?
> 
> Im still trying to figure out who and where has decided that __nleft_49 is
> [2, 0x7FFFFFFFFFFFFFFF] instead of [2, 0xFFFFFFFFFFFFFFFFFFFF]

Global ranges can also be set via duplicate_ssa_name_range_info, which is used
by the inliner.

It looks like [1, 9223372036854775807] was originally calculated in evrp for
__nleft_64:

=========== BB 45 ============
Imports: _27  __s_53(D)  
Exports: _27  _34  __s_53(D)  __nleft_64  
         _34 : _27(I)  __s_53(D)(I)  
         __nleft_64 : _27(I)  _34  __s_53(D)(I)  
_27     char * [1B, -2B]
__s_53(D)       const char * [0B, -3B]
Relational : (__s_53(D) < _26)
Relational : (_27 > __s_53(D))
    <bb 45> :
    _34 = _27 - __s_53(D);
    __nleft_64 = (const size_type) _34;
    if (_34 == 1)
      goto <bb 46>; [34.00%]
    else
      goto <bb 47>; [66.00%]

_34 : long int [1, +INF]
__nleft_64 : long unsigned int [1, 9223372036854775807]
45->46  (T) _27 :       char * [1B, -2B]
45->46  (T) _34 :       long int [1, 1]
45->46  (T) __s_53(D) :         const char * [0B, -3B]
45->46  (T) __nleft_64 :        long unsigned int [1, 9223372036854775807]
45->47  (F) _27 :       char * [1B, -2B]
45->47  (F) _34 :       long int [2, +INF]
45->47  (F) __s_53(D) :         const char * [0B, -3B]
45->47  (F) __nleft_64 :        long unsigned int [1, 9223372036854775807]

This was later renamed to __nleft_40, and then copied by the IPA inliner to
__nleft_47 and ultimately to __nleft_49.

  parent reply	other threads:[~2022-04-22 10:31 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  7:41 [Bug c++/105329] New: " boris at kolpackov dot net
2022-04-21 11:15 ` [Bug tree-optimization/105329] " rguenth at gcc dot gnu.org
2022-04-21 20:50 ` amacleod at redhat dot com
2022-04-21 22:51 ` amacleod at redhat dot com
2022-04-22 10:31 ` aldyh at gcc dot gnu.org [this message]
2022-04-25 17:50 ` amacleod at redhat dot com
2022-04-25 22:25 ` mattias.ellert at physics dot uu.se
2022-04-26 15:04 ` [Bug tree-optimization/105329] [12 Regression] Bogus restrict warning when assigning 1-char string literal to std::string since r12-3347-g8af8abfbbace49e6 marxin at gcc dot gnu.org
2022-05-02 12:44 ` [Bug tree-optimization/105329] [12/13 " rguenth at gcc dot gnu.org
2022-05-02 12:45 ` rguenth at gcc dot gnu.org
2022-05-02 12:46 ` rguenth at gcc dot gnu.org
2022-05-02 12:57 ` rguenth at gcc dot gnu.org
2022-05-02 13:22 ` rguenth at gcc dot gnu.org
2022-05-02 13:33 ` jakub at gcc dot gnu.org
2022-05-02 13:58 ` jakub at gcc dot gnu.org
2022-05-02 16:04 ` jakub at gcc dot gnu.org
2022-05-02 19:43 ` jakub at gcc dot gnu.org
2022-05-02 22:08 ` redi at gcc dot gnu.org
2022-05-06  3:59 ` mattias.ellert at physics dot uu.se
2022-05-06  8:33 ` jakub at gcc dot gnu.org
2022-05-20  8:13 ` rguenth at gcc dot gnu.org
2022-07-26 12:05 ` jakub at gcc dot gnu.org
2022-09-12  9:37 ` cvs-commit at gcc dot gnu.org
2022-09-29 15:19 ` msebor at gcc dot gnu.org
2022-09-30 16:55 ` dan at stahlke dot org
2022-09-30 17:16 ` dan at stahlke dot org
2023-02-21 18:30 ` 49tbwddbqeazdawz at chyen dot cc
2023-02-21 19:28 ` redi at gcc dot gnu.org
2023-02-22 17:28 ` 49tbwddbqeazdawz at chyen dot cc
2023-02-22 17:52 ` redi at gcc dot gnu.org
2023-02-24 14:10 ` wielkiegie at gmail dot com
2023-05-08 12:24 ` [Bug tree-optimization/105329] [12/13/14 " rguenth 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-105329-4-6C5w0HBxqp@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).