summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-06-13 16:32:25 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-06-13 16:32:25 (GMT)
commitcf83fb06120a4a90963fe0c9e2037af03965c5fc (patch)
treec3c5eb1d56c6070a06582e4cb74438a8be8a225f
parent3fb71cf59b08b770c4fc3d6a23b4eeeddf90b0c0 (diff)
downloadhdf5-cf83fb06120a4a90963fe0c9e2037af03965c5fc.zip
hdf5-cf83fb06120a4a90963fe0c9e2037af03965c5fc.tar.gz
hdf5-cf83fb06120a4a90963fe0c9e2037af03965c5fc.tar.bz2
[svn-r10913] Purpose: Work Around A Compiler Bug
Description: PGCC compiler on mir(AMD Opeteron) has a bug for optimization, causing the multi driver test to fail. The compiler handles a macro in this file incorrectly. Solution: Slightly change the definition of this macro to avoid the problem temporarily. Platforms tested: h5committest, optimization and debug on mir.
-rw-r--r--src/H5FDmulti.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index eae6488..9ab752b 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -54,6 +54,10 @@
#endif
/* Loop through all mapped files */
+#ifdef TMP
+/*The -O2 optimization of the PGCC in mir has a bug for this macro. A workaround
+ *is provided here to avoid the problem temporarily until the compiler bug is fixed.
+ *SLU - 2005/6/13 */
#define UNIQUE_MEMBERS(MAP,LOOPVAR) { \
H5FD_mem_t _unmapped, LOOPVAR; \
hbool_t _seen[H5FD_MEM_NTYPES]; \
@@ -64,6 +68,23 @@
if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=_unmapped; \
assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES); \
if (_seen[LOOPVAR]++) continue;
+#else /*TMP*/
+#define UNIQUE_MEMBERS(MAP,LOOPVAR) { \
+ H5FD_mem_t _unmapped, LOOPVAR; \
+ hbool_t _seen[H5FD_MEM_NTYPES]; \
+ \
+ memset(_seen, 0, sizeof _seen); \
+ for (_unmapped=H5FD_MEM_SUPER; _unmapped<H5FD_MEM_NTYPES; _unmapped=(H5FD_mem_t)(_unmapped+1)) { \
+ LOOPVAR = MAP[_unmapped]; \
+ if (H5FD_MEM_DEFAULT==LOOPVAR) LOOPVAR=_unmapped; \
+ assert(LOOPVAR>0 && LOOPVAR<H5FD_MEM_NTYPES); \
+ \
+ if(_seen[LOOPVAR]) { \
+ _seen[LOOPVAR]++; \
+ continue; \
+ } \
+ _seen[LOOPVAR]++;
+#endif /*TMP*/
#ifdef LATER
#define MAPPED_MEMBERS(MAP,LOOPVAR) { \
@@ -718,7 +739,7 @@ H5FD_multi_sb_size(H5FD_t *_file)
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
nseen++;
} END_MEMBERS;
-
+
/* Addresses and EOA markers */
nbytes += nseen * 2 * 8;
@@ -1503,6 +1524,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa)
/* Save new eoa for return later */
file->eoa = eoa;
+
return 0;
}