aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2007-05-15 21:35:28 +0000
committerKeith Seitz <kseitz@gcc.gnu.org>2007-05-15 21:35:28 +0000
commit98265f29a6f460703db6389084716d580605ac2e (patch)
tree2b4b0ed67f5a06ee3b2b114ee04624ecca0df271 /libjava
parent11c004e7f0574bf0997f7fa96f52193a1d9642f0 (diff)
downloadgcc-98265f29a6f460703db6389084716d580605ac2e.zip
gcc-98265f29a6f460703db6389084716d580605ac2e.tar.gz
gcc-98265f29a6f460703db6389084716d580605ac2e.tar.bz2
interpret.cc (STOREA): Rewrite using temporary variable to avoid double-macro expansion side-effects.
* interpret.cc (STOREA): Rewrite using temporary variable to avoid double-macro expansion side-effects. (STOREI): Likewise. (STOREF): Likewise. (STOREL)[SIZEOF_VOID_P == 8]: Likewise. (STORED)[SIZEOF_VOID_P == 8]: Likewise. (STOREL)[SIZEOF_VOID_P != 8]: Likewise. (STORED)[SIZEOF_VOID_P != 8]: Likewise. (POKEI): Likewise. From-SVN: r124746
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog12
-rw-r--r--libjava/interpret.cc109
2 files changed, 77 insertions, 44 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index dce1558..577ccc0e 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,15 @@
+2007-05-15 Keith Seitz <keiths@redhat.com>
+
+ * interpret.cc (STOREA): Rewrite using temporary variable to
+ avoid double-macro expansion side-effects.
+ (STOREI): Likewise.
+ (STOREF): Likewise.
+ (STOREL)[SIZEOF_VOID_P == 8]: Likewise.
+ (STORED)[SIZEOF_VOID_P == 8]: Likewise.
+ (STOREL)[SIZEOF_VOID_P != 8]: Likewise.
+ (STORED)[SIZEOF_VOID_P != 8]: Likewise.
+ (POKEI): Likewise.
+
2007-05-12 David Daney <ddaney@avtrex.com>
PR libgcj/29324
diff --git a/libjava/interpret.cc b/libjava/interpret.cc
index edb3066..b078676 100644
--- a/libjava/interpret.cc
+++ b/libjava/interpret.cc
@@ -180,60 +180,81 @@ convert (FROM val, TO min, TO max)
# define LOADD(I) LOADL(I)
#endif
-#define STOREA(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'o'); \
- locals[I].o = (--sp)->o; \
- } while (0)
-#define STOREI(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'i'); \
- locals[I].i = (--sp)->i; \
- } while (0)
-#define STOREF(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'f'); \
- locals[I].f = (--sp)->f; \
+#define STOREA(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'o'); \
+ locals[__idx].o = (--sp)->o; \
+ } \
+ while (0)
+#define STOREI(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'i'); \
+ locals[__idx].i = (--sp)->i; \
} while (0)
+#define STOREF(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'f'); \
+ locals[__idx].f = (--sp)->f; \
+ } \
+ while (0)
#if SIZEOF_VOID_P == 8
-# define STOREL(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'l'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- (sp -= 2, locals[I].l = sp->l); \
- } while (0)
-# define STORED(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'd'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- (sp -= 2, locals[I].d = sp->d); \
- } while (0)
+# define STOREL(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'l'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ (sp -= 2, locals[__idx].l = sp->l); \
+ } \
+ while (0)
+# define STORED(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'd'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ (sp -= 2, locals[__idx].d = sp->d); \
+ } \
+ while (0)
#else
-# define STOREL(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'l'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- jint __idx = (I); \
- locals[__idx+1].ia[0] = (--sp)->ia[0]; \
- locals[__idx].ia[0] = (--sp)->ia[0]; \
- } while (0)
-# define STORED(I) \
- do { \
- DEBUG_LOCALS_INSN (I, 'd'); \
- DEBUG_LOCALS_INSN (I + 1, 'x'); \
- jint __idx = (I); \
- locals[__idx+1].ia[0] = (--sp)->ia[0]; \
- locals[__idx].ia[0] = (--sp)->ia[0]; \
+# define STOREL(I) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'l'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ locals[__idx + 1].ia[0] = (--sp)->ia[0]; \
+ locals[__idx].ia[0] = (--sp)->ia[0]; \
+ } \
+ while (0)
+# define STORED(I) \
+ do { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'd'); \
+ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
+ locals[__idx + 1].ia[0] = (--sp)->ia[0]; \
+ locals[__idx].ia[0] = (--sp)->ia[0]; \
} while (0)
#endif
#define PEEKI(I) (locals+(I))->i
#define PEEKA(I) (locals+(I))->o
-#define POKEI(I,V) \
- DEBUG_LOCALS_INSN(I,'i'); \
- ((locals+(I))->i = (V))
+#define POKEI(I,V) \
+ do \
+ { \
+ jint __idx = (I); \
+ DEBUG_LOCALS_INSN (__idx, 'i'); \
+ ((locals + __idx)->i = (V)); \
+ } \
+ while (0)
#define BINOPI(OP) { \