summaryrefslogtreecommitdiff
path: root/libitm
diff options
context:
space:
mode:
authortorvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-05 16:34:12 +0000
committertorvald <torvald@138bc75d-0d04-0410-961f-82ee72b054a4>2012-03-05 16:34:12 +0000
commit876d7b2146a66ac35d26d2545226a3869f555d5a (patch)
tree4cf06fc2f46eedd93cb75822cf369c5e2dd7c844 /libitm
parent2c2e3eafde42435a1e8284cc37f6574c49b39a4e (diff)
downloadgcc-876d7b2146a66ac35d26d2545226a3869f555d5a.tar.gz
libitm: Don't execute memtransfer/memset if size isn't larger than zero.
libitm/ * dispatch.h (CREATE_DISPATCH_METHODS_MEM): Don't execute memtransfer/memset if size isn't larger than zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184941 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libitm')
-rw-r--r--libitm/ChangeLog5
-rw-r--r--libitm/dispatch.h6
2 files changed, 9 insertions, 2 deletions
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index 1be02b525b4..9a3e484fc8a 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-05 Torvald Riegel <triegel@redhat.com>
+
+ * dispatch.h (CREATE_DISPATCH_METHODS_MEM): Don't execute
+ memtransfer/memset if size isn't larger than zero.
+
2012-03-02 Torvald Riegel <triegel@redhat.com>
* libitm.texi: Link to specification and add a usage example.
diff --git a/libitm/dispatch.h b/libitm/dispatch.h
index d059c493507..6a9e62ef6c0 100644
--- a/libitm/dispatch.h
+++ b/libitm/dispatch.h
@@ -102,11 +102,13 @@
virtual void memtransfer(void *dst, const void* src, size_t size, \
bool may_overlap, ls_modifier dst_mod, ls_modifier src_mod) \
{ \
- memtransfer_static(dst, src, size, may_overlap, dst_mod, src_mod); \
+ if (size > 0) \
+ memtransfer_static(dst, src, size, may_overlap, dst_mod, src_mod); \
} \
virtual void memset(void *dst, int c, size_t size, ls_modifier mod) \
{ \
- memset_static(dst, c, size, mod); \
+ if (size > 0) \
+ memset_static(dst, c, size, mod); \
}
#define CREATE_DISPATCH_METHODS_MEM_PV() \