public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/35903] false Warray-bounds warning when passing quoted string to function strcmp(arg,"no");
Date: Fri, 19 Feb 2010 23:56:00 -0000	[thread overview]
Message-ID: <20100219235613.14748.qmail@sourceware.org> (raw)
In-Reply-To: <bug-35903-12775@http.gcc.gnu.org/bugzilla/>



------- Comment #9 from manu at gcc dot gnu dot org  2010-02-19 23:56 -------
This is not an uninitialized issue. 

The reason this requires -O2 is that -Warray-bounds requires VRP to warn. The
gimple output already looks quite different.

-funsigned-char:

       <D.1565>:
        [pr35903.i : 309:15] D.1567 = __s1D.796 + 3;
        [pr35903.i : 309:15] D.1568 = [pr35903.i : 309] *D.1567;
        [pr35903.i : 310:11] D.1569 = (intD.0) D.1568;
        [pr35903.i : 318:12] D.1570 = [pr35903.i : 311] &[pr35903.i : 311]
"AA"[0] + 3;
        [pr35903.i : 318:12] D.1571 = [pr35903.i : 318] *D.1570;
        [pr35903.i : 310:11] D.1572 = (intD.0) D.1571;
        [pr35903.i : 308:10] __resultD.797 = D.1569 - D.1572;
        <D.1566>:
        <D.1556>:

-fsigned-char

     <D.1566>:
        [pr35903.i : 309:15] D.1568 = __s1D.796 + 3;
        [pr35903.i : 309:15] D.1569 = [pr35903.i : 309] *D.1568;
        [pr35903.i : 310:11] D.1570 = (intD.0) D.1569;
        [pr35903.i : 311:12] D.1540 = (const unsigned charD.10 *) [pr35903.i :
318] "AA";
        [pr35903.i : 318:12] D.1571 = D.1540 + 3;
        [pr35903.i : 318:12] D.1572 = [pr35903.i : 318] *D.1571;
        [pr35903.i : 310:11] D.1573 = (intD.0) D.1572;
        [pr35903.i : 308:10] __resultD.797 = D.1570 - D.1573;
        <D.1567>:
        <D.1557>:
        <D.1547>:


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|24639                       |
              nThis|                            |
            Summary|false uninitialized warning |false Warray-bounds warning
                   |when passing quoted string  |when passing quoted string
                   |to function                 |to function
                   |strcmp(arg,"no");           |strcmp(arg,"no");


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35903


  parent reply	other threads:[~2010-02-19 23:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10 18:44 [Bug c/35903] New: false " rsa at us dot ibm dot com
2008-04-10 18:58 ` [Bug c/35903] " rsa at us dot ibm dot com
2008-04-10 18:59 ` rsa at us dot ibm dot com
2009-10-16 16:51 ` [Bug middle-end/35903] " cepeda at gmail dot com
2009-10-17 11:03 ` manu at gcc dot gnu dot org
2009-10-22 17:56 ` manu at gcc dot gnu dot org
2009-10-22 18:30 ` cepeda at gmail dot com
2009-10-22 18:32 ` cepeda at gmail dot com
2010-01-02 19:24 ` [Bug middle-end/35903] false uninitialized " rguenth at gcc dot gnu dot org
2010-02-19 23:56 ` manu at gcc dot gnu dot org [this message]
2010-02-20  0:19 ` [Bug middle-end/35903] false Warray-bounds " manu at gcc dot gnu dot 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=20100219235613.14748.qmail@sourceware.org \
    --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).