public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected
[not found] <bug-44384-4@http.gcc.gnu.org/bugzilla/>
@ 2011-03-28 15:06 ` jakub at gcc dot gnu.org
2011-03-29 20:42 ` meklund at cisco dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-28 15:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44384
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-28 14:05:34 UTC ---
__builtin_object_size is a builtin for -D_FORTIFY_SOURCE checking, it is not a
generic object size computation function, and for strcpy IMHO we don't want to
treat each dimension as a field separator.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected
[not found] <bug-44384-4@http.gcc.gnu.org/bugzilla/>
2011-03-28 15:06 ` [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected jakub at gcc dot gnu.org
@ 2011-03-29 20:42 ` meklund at cisco dot com
2011-03-30 8:55 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 5+ messages in thread
From: meklund at cisco dot com @ 2011-03-29 20:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44384
--- Comment #2 from Mark Eklund <meklund at cisco dot com> 2011-03-29 20:31:15 UTC ---
I use FORTIFY_SOURCE with a USE_FORTIFY_LEVEL of 2
and was surprised that the below code allowed
writing into fu[4][0]. I expected that at a
level of 1, but not 2.
#include <string.h>
int bar ()
{
char fu[10][10];
strcpy(fu[3], "ten counts");
return 0;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected
[not found] <bug-44384-4@http.gcc.gnu.org/bugzilla/>
2011-03-28 15:06 ` [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected jakub at gcc dot gnu.org
2011-03-29 20:42 ` meklund at cisco dot com
@ 2011-03-30 8:55 ` rguenth at gcc dot gnu.org
2011-04-21 15:17 ` meklund at cisco dot com
2023-06-25 0:33 ` [Bug middle-end/44384] " pinskia at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-30 8:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44384
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-30 08:47:32 UTC ---
The FE is also not very helpful when decaying arrays to pointers or when
generating array accesses.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected
[not found] <bug-44384-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2011-03-30 8:55 ` rguenth at gcc dot gnu.org
@ 2011-04-21 15:17 ` meklund at cisco dot com
2023-06-25 0:33 ` [Bug middle-end/44384] " pinskia at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: meklund at cisco dot com @ 2011-04-21 15:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44384
--- Comment #4 from Mark Eklund <meklund at cisco dot com> 2011-04-21 15:17:37 UTC ---
Although "subobject" isn't well defined in the documentation,
the below comments from tree-object-size.c revision r171388
lines 63-68 would indicate that subobject is the innermost array.
/*
*
* object_sizes[0] is upper bound for number of bytes till the end of
* the object.
* object_sizes[1] is upper bound for number of bytes till the end of
* the subobject (innermost array or field with address taken).
* object_sizes[2] is lower bound for number of bytes till the end of
* the object and object_sizes[3] lower bound for subobject.
*/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected
[not found] <bug-44384-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2011-04-21 15:17 ` meklund at cisco dot com
@ 2023-06-25 0:33 ` pinskia at gcc dot gnu.org
4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-25 0:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44384
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |siddhesh at gcc dot gnu.org
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 110373 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-25 0:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-44384-4@http.gcc.gnu.org/bugzilla/>
2011-03-28 15:06 ` [Bug c/44384] builtin_object_size_ treatment of multidimensional arrays is unexpected jakub at gcc dot gnu.org
2011-03-29 20:42 ` meklund at cisco dot com
2011-03-30 8:55 ` rguenth at gcc dot gnu.org
2011-04-21 15:17 ` meklund at cisco dot com
2023-06-25 0:33 ` [Bug middle-end/44384] " pinskia at gcc dot gnu.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).