summaryrefslogtreecommitdiffstats
path: root/contrib/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc')
-rw-r--r--contrib/gcc/c-decl.c2
-rw-r--r--contrib/gcc/c.opt4
-rw-r--r--contrib/gcc/cfg.c2
-rw-r--r--contrib/gcc/common.opt4
-rw-r--r--contrib/gcc/output.h3
-rw-r--r--contrib/gcc/rtl.h11
-rw-r--r--contrib/gcc/tree-nested.c6
-rw-r--r--contrib/gcc/tree.h13
8 files changed, 35 insertions, 10 deletions
diff --git a/contrib/gcc/c-decl.c b/contrib/gcc/c-decl.c
index 64a6fa8..fbafc0d 100644
--- a/contrib/gcc/c-decl.c
+++ b/contrib/gcc/c-decl.c
@@ -4340,6 +4340,8 @@ grokdeclarator (const struct c_declarator *declarator,
pedwarn ("ISO C90 forbids variable-size array %qs",
name);
}
+ if (warn_variable_decl)
+ warning (0, "variable-sized array %qs", name);
}
if (integer_zerop (size))
diff --git a/contrib/gcc/c.opt b/contrib/gcc/c.opt
index 8769657..038fc51 100644
--- a/contrib/gcc/c.opt
+++ b/contrib/gcc/c.opt
@@ -404,6 +404,10 @@ Wtraditional
C ObjC Var(warn_traditional)
Warn about features not present in traditional C
+Wtrampolines
+Common Var(warn_trampolines)
+Warn when trampolines are emitted
+
Wtrigraphs
C ObjC C++ ObjC++
Warn if trigraphs are encountered that might affect the meaning of the program
diff --git a/contrib/gcc/cfg.c b/contrib/gcc/cfg.c
index aa8eaca..ec11f43 100644
--- a/contrib/gcc/cfg.c
+++ b/contrib/gcc/cfg.c
@@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_block bb)
else
fprintf (file, ", ");
first = false;
- fprintf (file, bb_bitnames[i]);
+ fputs (bb_bitnames[i], file);
}
if (!first)
fprintf (file, ")");
diff --git a/contrib/gcc/common.opt b/contrib/gcc/common.opt
index 367e540..2270d0d 100644
--- a/contrib/gcc/common.opt
+++ b/contrib/gcc/common.opt
@@ -189,6 +189,10 @@ Wunused-variable
Common Var(warn_unused_variable)
Warn when a variable is unused
+Wvariable-decl
+Common Var(warn_variable_decl)
+Warn about variable-sized declarations.
+
Wvolatile-register-var
Common Var(warn_register_var)
Warn when a register variable is declared volatile
diff --git a/contrib/gcc/output.h b/contrib/gcc/output.h
index 1d9b837..9b29059 100644
--- a/contrib/gcc/output.h
+++ b/contrib/gcc/output.h
@@ -109,13 +109,14 @@ extern void output_addr_const (FILE *, rtx);
/* Output a string of assembler code, substituting numbers, strings
and fixed syntactic prefixes. */
-#if GCC_VERSION >= 3004
+#if GCC_VERSION >= 3004 && !defined(__clang__)
#define ATTRIBUTE_ASM_FPRINTF(m, n) __attribute__ ((__format__ (__asm_fprintf__, m, n))) ATTRIBUTE_NONNULL(m)
/* This is a magic identifier which allows GCC to figure out the type
of HOST_WIDE_INT for %wd specifier checks. You must issue this
typedef before using the __asm_fprintf__ format attribute. */
typedef HOST_WIDE_INT __gcc_host_wide_int__;
#else
+/* FIXME(benl): what about %wd? */
#define ATTRIBUTE_ASM_FPRINTF(m, n) ATTRIBUTE_NONNULL(m)
#endif
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)
diff --git a/contrib/gcc/tree-nested.c b/contrib/gcc/tree-nested.c
index 06fbbc9..9efcd98 100644
--- a/contrib/gcc/tree-nested.c
+++ b/contrib/gcc/tree-nested.c
@@ -750,7 +750,7 @@ check_for_nested_with_variably_modified (tree fndecl, tree orig_fndecl)
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
{
for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg))
- if (variably_modified_type_p (TREE_TYPE (arg), 0), orig_fndecl)
+ if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl))
return true;
if (check_for_nested_with_variably_modified (cgn->decl, orig_fndecl))
@@ -1621,6 +1621,10 @@ convert_tramp_reference (tree *tp, int *walk_subtrees, void *data)
it doesn't need a trampoline. */
if (DECL_NO_STATIC_CHAIN (decl))
break;
+ if (warn_trampolines)
+ {
+ warning(0, "local function address taken needing trampoline generation");
+ }
/* Lookup the immediate parent of the callee, as that's where
we need to insert the trampoline. */
diff --git a/contrib/gcc/tree.h b/contrib/gcc/tree.h
index 7861514..97090be 100644
--- a/contrib/gcc/tree.h
+++ b/contrib/gcc/tree.h
@@ -22,6 +22,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#ifndef GCC_TREE_H
#define GCC_TREE_H
+#include <sys/param.h>
+#ifndef __PAST_END
+# define __PAST_END(array, offset) (((typeof(*(array)) *)(array))[offset])
+#endif
+
#include "hashtab.h"
#include "machmode.h"
#include "input.h"
@@ -830,12 +835,12 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
#define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define EXPR_CHECK(T) (T)
#define NON_TYPE_CHECK(T) (T)
-#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
-#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
-#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
+#define TREE_VEC_ELT_CHECK(T, I) __PAST_END((T)->vec.a, I)
+#define TREE_OPERAND_CHECK(T, I) __PAST_END((T)->exp.operands, I)
+#define TREE_OPERAND_CHECK_CODE(T, CODE, I) __PAST_END((T)->exp.operands, I)
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
-#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
+#define OMP_CLAUSE_ELT_CHECK(T, i) __PAST_END((T)->omp_clause.ops, i)
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
OpenPOWER on IntegriCloud