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/14236] dynamically-sized arrays break alloca()


------- Additional Comments From aoliva at gcc dot gnu dot org  2005-02-14 16:29 -------
Yes, it is natural, once you look into the mechanisms used to implement the
features.  However, if you focus on the definitions:

- memory allocated for dynamic-sized arrays is released at the time the array
goes out of scope

- memory allocated with alloca() is released at the time the function that calls
alloca() returns

then there's no reason to expect dynamic-sized arrays and alloca() to interfere
with each other.

I agree that implementing them in such a way that they don't interfere is
probably impossible with a single stack, but that still doesn't make it right.

-- 


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


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