[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Richard Biener changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-23 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #21 from Richard Biener --- Author: rguenth Date: Fri May 23 10:11:03 2014 New Revision: 210848 URL: http://gcc.gnu.org/viewcvs?rev=210848&root=gcc&view=rev Log: 2014-05-22 Paul Eggert PR other/56955 * doc/extend.texi (Fu

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-22 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Paul Eggert changed: What|Removed |Added Attachment #32832|0 |1 is obsolete|

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-21 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #19 from rguenther at suse dot de --- On May 21, 2014 5:14:27 PM CEST, eggert at gnu dot org wrote: >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 > >--- Comment #18 from Paul Eggert --- >(In reply to Richard Biener from commen

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-21 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #18 from Paul Eggert --- (In reply to Richard Biener from comment #16) > void foo (int *p) > { > int *q = realloc (p, sizeof (int)); > *q = 2; > } > > may I remove the store *q = 2 as dead? Yes, the consensus nowadays is that y

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-21 Thread sunfish at mozilla dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #17 from Dan Gohman --- (In reply to Richard Biener from comment #16) > One reason for why realloc is "hard" is that there is no language that says > it is undefined to access the object via the old pointer, but there is only > langua

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #16 from Richard Biener --- One reason for why realloc is "hard" is that there is no language that says it is undefined to access the object via the old pointer, but there is only language that says the old and the new pointer values

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-21 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #14 from Paul Eggert --- (In reply to Dan Gohman from comment #13) > *p can't alias a or b without violating the weaker assumption. Sorry, you've lost me there. Pointers in realloc'ed storage can alias already-existing pointers, an

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread sunfish at mozilla dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #13 from Dan Gohman --- (In reply to Paul Eggert from comment #12) > (In reply to Rich Felker from comment #10) > > This assumption only aids > > optimization in the case where a pointer residing in the obtained memory is > > used (e.

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #12 from Paul Eggert --- (In reply to Rich Felker from comment #10) > This assumption only aids > optimization in the case where a pointer residing in the obtained memory is > used (e.g. dereferenced or compared with another pointer)

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #11 from Paul Eggert --- Created attachment 32834 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32834&action=edit Sample illustrating GCC's optimization with __attribute__ ((malloc))

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #10 from Rich Felker --- I don't see how it's at all helpful for GCC to assume that memory obtained by __attribute__((__malloc__)) functions does not contain pointers to anything that existed before the call. This assumption only aids

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Paul Eggert changed: What|Removed |Added Attachment #32831|0 |1 is obsolete|

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #8 from Paul Eggert --- Comment on attachment 32831 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32831 Clarify documentation for __attribute__ ((malloc)). >Index: gcc/ChangeLog >===

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread carlos at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Carlos O'Donell changed: What|Removed |Added CC||carlos at redhat dot com --- Comment #

[Bug other/56955] documentation for attribute malloc contradicts itself

2014-05-20 Thread eggert at gnu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 Paul Eggert changed: What|Removed |Added CC||eggert at gnu dot org --- Comment #6 from

[Bug other/56955] documentation for attribute malloc contradicts itself

2013-04-26 Thread davidxl at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 davidxl at google dot com changed: What|Removed |Added CC||davidxl at google dot c

[Bug other/56955] documentation for attribute malloc contradicts itself

2013-04-15 Thread sunfish at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #4 from Dan Gohman 2013-04-15 14:53:06 UTC --- (In reply to comment #3) > Well, it _is_ actually about the content. There must be no way to compute > a valid pointer to another object from the contents of the pointed-to > mem

[Bug other/56955] documentation for attribute malloc contradicts itself

2013-04-15 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #3 from Richard Biener 2013-04-15 10:19:22 UTC --- (In reply to comment #2) > (In reply to comment #1) > > I think it is talking about the memory returned by malloc/calloc will not > > point > > to another memory location whi

[Bug other/56955] documentation for attribute malloc contradicts itself

2013-04-14 Thread sunfish at google dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #2 from Dan Gohman 2013-04-14 19:47:42 UTC --- (In reply to comment #1) > I think it is talking about the memory returned by malloc/calloc will not > point > to another memory location while realloc can. I agree that's esse

[Bug other/56955] documentation for attribute malloc contradicts itself

2013-04-14 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56955 --- Comment #1 from Andrew Pinski 2013-04-14 19:05:00 UTC --- I think it is talking about the memory returned by malloc/calloc will not point to another memory location while realloc can.