This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/35903] false Warray-bounds warning when passing quoted string to function strcmp(arg,"no");



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]