Bug 47611 - [trans-mem] memory allocated by default new/new_vec operator can be considered as transaction local
Summary: [trans-mem] memory allocated by default new/new_vec operator can be considere...
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: trans-mem
: P5 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-04 20:27 UTC by Patrick Marlier
Modified: 2011-11-21 16:39 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-02-04 21:11:43


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Marlier 2011-02-04 20:27:16 UTC
This is an improvement with a *LOW* priority. Only if spare time (hey could be a nice homework).

See comments in 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46941
Comment 1 Aldy Hernandez 2011-02-04 21:11:43 UTC
Bringing in a note from the other PR...

The reason memory allocated by the C++ new operator does not get
optimized by the TM-memopt pass is not because of a missing ECF_MALLOC
attribute, but because the alias oracle in GCC considers the chunk of memory as
possibly able to escape from the current function.

That is, the following hunk of code returns true in the TM-memopt pass:

      if (ptr_deref_may_alias_global_p (x))

Apparently, since new/delete operators may be overridden by class specific
hooks, the memory must be considered escaped.
Comment 2 torvald 2011-11-21 16:39:40 UTC
If the alias oracle considers the memory region returned from new/delete to be potentially escaping to code outside of the transaction, then I think we need to respect this.  If you think this should not be possible, please file another bug against the alias oracle.