public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35392] Warning "array subscript is above array bounds" in inline fct
       [not found] <bug-35392-4@http.gcc.gnu.org/bugzilla/>
@ 2013-02-26  9:32 ` amylaar at gcc dot gnu.org
  2013-02-26 10:17 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 6+ messages in thread
From: amylaar at gcc dot gnu.org @ 2013-02-26  9:32 UTC (permalink / raw)
  To: gcc-bugs


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

Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:

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

--- Comment #5 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2013-02-26 09:31:49 UTC ---
GCC 4.8.0 revision 196254 does not warn for the reduced testcase on
i686-pc-linux-gnu.  It also doesn't warn for the original testcase
once the spurious linebreak inside the asm string on line 88
(probably an artifact of the web page formatting) is removed).


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/35392] Warning "array subscript is above array bounds" in inline fct
       [not found] <bug-35392-4@http.gcc.gnu.org/bugzilla/>
  2013-02-26  9:32 ` [Bug c/35392] Warning "array subscript is above array bounds" in inline fct amylaar at gcc dot gnu.org
@ 2013-02-26 10:17 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-26 10:17 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-26 10:16:20 UTC ---
Thus, fixed for 4.8.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/35392] Warning "array subscript is above array bounds" in inline fct
  2008-02-27 13:35 [Bug c/35392] New: " etienne_lorrain at yahoo dot fr
                   ` (2 preceding siblings ...)
  2009-07-31 16:46 ` manu at gcc dot gnu dot org
@ 2010-01-02 19:19 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-02 19:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2010-01-02 19:19 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-02 19:19:14
               date|                            |


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/35392] Warning "array subscript is above array bounds" in inline fct
  2008-02-27 13:35 [Bug c/35392] New: " etienne_lorrain at yahoo dot fr
  2008-11-15  0:09 ` [Bug c/35392] " pinskia at gcc dot gnu dot org
  2009-04-18  9:34 ` manu at gcc dot gnu dot org
@ 2009-07-31 16:46 ` manu at gcc dot gnu dot org
  2010-01-02 19:19 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-07-31 16:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from manu at gcc dot gnu dot org  2009-07-31 16:46 -------
A reduced testcase:

extern inline const char *
_strnchr (const char *str, char c, unsigned size);

extern inline void *
_memcpy (void *dst, const void *src, const unsigned size)
{
  if (__builtin_constant_p (size))
    {
      if (size == 5)
        {
          ((unsigned *) dst)[0] = ((const unsigned *) src)[0];
          ((unsigned char *) dst)[4] = ((const unsigned char *) src)[4];
          return dst;
        }
    }
  return dst;
}

extern inline unsigned
_strlen (const char *str)
{

  return _strnchr (str, '\0', (~0)) - str;
}

extern inline char *
_strncpy (char *dst, const char *src, unsigned size)
{
  unsigned len = _strlen (src);
  if (len > size)
    len = size;

  _memcpy (dst, src, len);
  dst[len] = '\0';
  return dst;
}

extern inline char *
_strcpy (char *dst, const char *src)
{
  return _strncpy (dst, src, (~0));
}

extern inline char *
_strcat (char *dst, const char *src)
{
  _strcpy (dst + _strlen (dst), src);
  return dst;
}


struct treat_directory_str
{
  unsigned nb;
};

void DOS_analyse (struct treat_directory_str *opaque)
{
  char pattern[52] = "A:\\*.*";
  char *pat = pattern;
  _strcat (pat, "*.*");
  opaque->nb++;
}



It is weird that removing the last line of DOS_analyse silences the warning.


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/35392] Warning "array subscript is above array bounds" in inline fct
  2008-02-27 13:35 [Bug c/35392] New: " etienne_lorrain at yahoo dot fr
  2008-11-15  0:09 ` [Bug c/35392] " pinskia at gcc dot gnu dot org
@ 2009-04-18  9:34 ` manu at gcc dot gnu dot org
  2009-07-31 16:46 ` manu at gcc dot gnu dot org
  2010-01-02 19:19 ` rguenth at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-04-18  9:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from manu at gcc dot gnu dot org  2009-04-18 09:34 -------
This is probably not fixed by the patch to PR 36902. They are totally different
problems.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/35392] Warning "array subscript is above array bounds" in inline fct
  2008-02-27 13:35 [Bug c/35392] New: " etienne_lorrain at yahoo dot fr
@ 2008-11-15  0:09 ` pinskia at gcc dot gnu dot org
  2009-04-18  9:34 ` manu at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-11-15  0:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-11-15 00:07 -------


*** This bug has been marked as a duplicate of 36902 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-02-26 10:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-35392-4@http.gcc.gnu.org/bugzilla/>
2013-02-26  9:32 ` [Bug c/35392] Warning "array subscript is above array bounds" in inline fct amylaar at gcc dot gnu.org
2013-02-26 10:17 ` rguenth at gcc dot gnu.org
2008-02-27 13:35 [Bug c/35392] New: " etienne_lorrain at yahoo dot fr
2008-11-15  0:09 ` [Bug c/35392] " pinskia at gcc dot gnu dot org
2009-04-18  9:34 ` manu at gcc dot gnu dot org
2009-07-31 16:46 ` manu at gcc dot gnu dot org
2010-01-02 19:19 ` rguenth at gcc dot gnu dot org

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