Go patch committed: Fix bug taking address of variable
Ian Lance Taylor
iant@google.com
Thu May 12 21:56:00 GMT 2011
This patch to the Go frontend fixes a bug when taking the address of a
variable when the address of the variable does not escape the function.
When the address does escape the variable is moved onto the heap, to
avoid danling pointers. When the address does not escape this is not
necessary. However, gcc requires that TREE_ADDRESSABLE be set in that
case, and the Go frontend was not doing that. This patch fixes that
bug. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.
Ian
2011-05-12 Ian Lance Taylor <iant@google.com>
* go-gcc.cc (Gcc_backend::local_variable): Add is_address_taken
parameter.
(Gcc_backend::parameter_variable): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 10372 bytes
Desc: patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110512/ff922782/attachment.bin>
More information about the Gcc-patches
mailing list