aboutsummaryrefslogtreecommitdiff
path: root/libitm
diff options
context:
space:
mode:
authorTorvald Riegel <triegel@redhat.com>2012-03-05 16:34:12 +0000
committerTorvald Riegel <torvald@gcc.gnu.org>2012-03-05 16:34:12 +0000
commitd28b0b0861af105bb15a5ed60488469a0dcbeb67 (patch)
tree4cf06fc2f46eedd93cb75822cf369c5e2dd7c844 /libitm
parent034209bc2fc3ca7ebec8ec3d28b94fbb9d00029d (diff)
downloadgcc-d28b0b0861af105bb15a5ed60488469a0dcbeb67.zip
gcc-d28b0b0861af105bb15a5ed60488469a0dcbeb67.tar.gz
gcc-d28b0b0861af105bb15a5ed60488469a0dcbeb67.tar.bz2
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. From-SVN: r184941
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 1be02b5..9a3e484 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 d059c49..6a9e62e 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() \