aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2010-07-03 21:17:46 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2010-07-03 21:17:46 +0000
commit4d451982e36b1f5a7a8412d9fb36924699aeb223 (patch)
treed86d7f443aa6e8ad1a79e3d696dfd64d64f302db /gcc
parent3a0c7e3af1954b05fa1c12ea5818d4d6d62ffea5 (diff)
downloadgcc-4d451982e36b1f5a7a8412d9fb36924699aeb223.zip
gcc-4d451982e36b1f5a7a8412d9fb36924699aeb223.tar.gz
gcc-4d451982e36b1f5a7a8412d9fb36924699aeb223.tar.bz2
c-common.c (IN_GCC_FRONTEND): Do not undef.
2010-07-03 Manuel López-Ibáñez <manu@gcc.gnu.org> * c-family/c-common.c (IN_GCC_FRONTEND): Do not undef. Do not include expr.h (vector_mode_valid_p): Move here. * expr.c (vector_mode_valid_p): Move to c-common.c. * expr.h (vector_mode_valid_p): Do not declare here. * system.h: Poison GCC_EXPR_H in front-ends. * Makefile.in: Update dependencies. From-SVN: r161785
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/Makefile.in4
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-common.c40
-rw-r--r--gcc/expr.c33
-rw-r--r--gcc/expr.h2
-rw-r--r--gcc/system.h2
7 files changed, 50 insertions, 44 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 55ae14b..3ef84a6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * expr.c (vector_mode_valid_p): Move to c-common.c.
+ * expr.h (vector_mode_valid_p): Do not declare here.
+ * system.h: Poison GCC_EXPR_H in front-ends.
+ * Makefile.in: Update dependencies.
+
2010-07-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/44705
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index ed53a79..f57cd71 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2072,8 +2072,8 @@ lto-wrapper.o: lto-wrapper.c $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h \
c-family/c-common.o : c-family/c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) \
$(OBSTACK_H) $(C_COMMON_H) $(FLAGS_H) $(TOPLEV_H) output.h $(C_PRAGMA_H) \
- $(GGC_H) $(EXPR_H) builtin-types.def builtin-attrs.def \
- $(DIAGNOSTIC_H) langhooks.h $(RTL_H) \
+ $(GGC_H) builtin-types.def builtin-attrs.def \
+ $(DIAGNOSTIC_H) langhooks.h \
$(TARGET_H) tree-iterator.h langhooks.h tree-mudflap.h \
intl.h opts.h $(CPPLIB_H) $(TREE_INLINE_H) $(HASHTAB_H) \
$(BUILTINS_DEF) $(CGRAPH_H) $(BASIC_BLOCK_H) $(TARGET_DEF_H) \
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index eee707e..8af57ab 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-03 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ * c-family/c-common.c (IN_GCC_FRONTEND): Do not undef.
+ Do not include expr.h
+ (vector_mode_valid_p): Move here.
+
2010-06-21 DJ Delorie <dj@redhat.com>
* c-pragma.c (handle_pragma_diagnostic): Add push/pop,
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 324c28a..491dd9e 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* FIXME: Still need to include rtl.h here (via expr.h) in a front-end file.
- Pretend this is a back-end file. */
-#undef IN_GCC_FRONTEND
-
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -50,8 +46,6 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "libfuncs.h"
-#include "expr.h" /* For vector_mode_valid_p */
-
cpp_reader *parse_in; /* Declared in c-pragma.h. */
/* The following symbols are subsumed in the c_global_trees array, and
@@ -6249,6 +6243,40 @@ handle_destructor_attribute (tree *node, tree name, tree args,
return NULL_TREE;
}
+/* Nonzero if the mode is a valid vector mode for this architecture.
+ This returns nonzero even if there is no hardware support for the
+ vector mode, but we can emulate with narrower modes. */
+
+static int
+vector_mode_valid_p (enum machine_mode mode)
+{
+ enum mode_class mclass = GET_MODE_CLASS (mode);
+ enum machine_mode innermode;
+
+ /* Doh! What's going on? */
+ if (mclass != MODE_VECTOR_INT
+ && mclass != MODE_VECTOR_FLOAT
+ && mclass != MODE_VECTOR_FRACT
+ && mclass != MODE_VECTOR_UFRACT
+ && mclass != MODE_VECTOR_ACCUM
+ && mclass != MODE_VECTOR_UACCUM)
+ return 0;
+
+ /* Hardware support. Woo hoo! */
+ if (targetm.vector_mode_supported_p (mode))
+ return 1;
+
+ innermode = GET_MODE_INNER (mode);
+
+ /* We should probably return 1 if requesting V4DI and we have no DI,
+ but we have V2DI, but this is probably very unlikely. */
+
+ /* If we have support for the inner mode, we can safely emulate it.
+ We may not have V2DI, but me can emulate with a pair of DIs. */
+ return targetm.scalar_mode_supported_p (innermode);
+}
+
+
/* Handle a "mode" attribute; arguments as in
struct attribute_spec.handler. */
diff --git a/gcc/expr.c b/gcc/expr.c
index a2a8054..d3ef6be 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -10295,39 +10295,6 @@ try_tablejump (tree index_type, tree index_expr, tree minval, tree range,
return 1;
}
-/* Nonzero if the mode is a valid vector mode for this architecture.
- This returns nonzero even if there is no hardware support for the
- vector mode, but we can emulate with narrower modes. */
-
-int
-vector_mode_valid_p (enum machine_mode mode)
-{
- enum mode_class mclass = GET_MODE_CLASS (mode);
- enum machine_mode innermode;
-
- /* Doh! What's going on? */
- if (mclass != MODE_VECTOR_INT
- && mclass != MODE_VECTOR_FLOAT
- && mclass != MODE_VECTOR_FRACT
- && mclass != MODE_VECTOR_UFRACT
- && mclass != MODE_VECTOR_ACCUM
- && mclass != MODE_VECTOR_UACCUM)
- return 0;
-
- /* Hardware support. Woo hoo! */
- if (targetm.vector_mode_supported_p (mode))
- return 1;
-
- innermode = GET_MODE_INNER (mode);
-
- /* We should probably return 1 if requesting V4DI and we have no DI,
- but we have V2DI, but this is probably very unlikely. */
-
- /* If we have support for the inner mode, we can safely emulate it.
- We may not have V2DI, but me can emulate with a pair of DIs. */
- return targetm.scalar_mode_supported_p (innermode);
-}
-
/* Return a CONST_VECTOR rtx for a VECTOR_CST tree. */
static rtx
const_vector_from_tree (tree exp)
diff --git a/gcc/expr.h b/gcc/expr.h
index c71b8ed..0146343 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -695,6 +695,4 @@ extern tree build_libfunc_function (const char *);
/* Get the personality libfunc for a function decl. */
rtx get_personality_function (tree);
-extern int vector_mode_valid_p (enum machine_mode);
-
#endif /* GCC_EXPR_H */
diff --git a/gcc/system.h b/gcc/system.h
index dd72d07..a8b4fa9 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -800,7 +800,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
/* Front ends should never have to include middle-end headers. Enforce
this by poisoning the header double-include protection defines. */
#ifdef IN_GCC_FRONTEND
-#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H
+#pragma GCC poison GCC_RTL_H GCC_EXCEPT_H GCC_EXPR_H
#endif
/* Note: not all uses of the `index' token (e.g. variable names and