summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/rtl.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/rtl.h')
-rw-r--r--contrib/gcc/rtl.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/contrib/gcc/rtl.h b/contrib/gcc/rtl.h
index 6c76f9d..d4af682 100644
--- a/contrib/gcc/rtl.h
+++ b/contrib/gcc/rtl.h
@@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_RTL_H
#define GCC_RTL_H
+#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
+
#include "statistics.h"
#include "machmode.h"
#include "input.h"
@@ -565,12 +570,12 @@ extern void rtvec_check_failed_bounds (rtvec, int, const char *, int,
#define RTL_CHECK1(RTX, N, C1) ((RTX)->u.fld[N])
#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->u.fld[N])
-#define RTL_CHECKC1(RTX, N, C) ((RTX)->u.fld[N])
+#define RTL_CHECKC1(RTX, N, C) __PAST_END((RTX)->u.fld, N)
#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->u.fld[N])
-#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
+#define RTVEC_ELT(RTVEC, I) __PAST_END((RTVEC)->elem, I)
#define XWINT(RTX, N) ((RTX)->u.hwint[N])
#define XCWINT(RTX, N, C) ((RTX)->u.hwint[N])
-#define XCMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
+#define XCMWINT(RTX, N, C, M) __PAST_END((RTX)->u.hwint, N)
#define XCNMWINT(RTX, N, C, M) ((RTX)->u.hwint[N])
#define XCNMPRV(RTX, C, M) (&(RTX)->u.rv)
#define BLOCK_SYMBOL_CHECK(RTX) (&(RTX)->u.block_sym)
OpenPOWER on IntegriCloud