Make unsafe vector float optimizations dependent on -ffast-math.
authorJames E Wilson <wilson@specifixinc.com>
Tue, 17 Aug 2004 00:00:50 +0000 (00:00 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 17 Aug 2004 00:00:50 +0000 (17:00 -0700)
* tree.h (VECTOR_FLOAT_TYPE_P): New.
(FLOAT_TYPE_P): Use it.
* c-typeck.c (build_binary_op): After convert calls, check for
check for ERROR_MARK operands.

From-SVN: r86088

gcc/ChangeLog
gcc/c-typeck.c
gcc/tree.h

index 49d413af3407cc3655c10f4f71270e663ea3236a..e7e7961811b9a3f30302a4e4d79f74083ecbbb02 100644 (file)
@@ -1,3 +1,10 @@
+2004-08-16  James E Wilson  <wilson@specifixinc.com>
+
+       * tree.h (VECTOR_FLOAT_TYPE_P): New.
+       (FLOAT_TYPE_P): Use it.
+       * c-typeck.c (build_binary_op): After convert calls, check for
+       check for ERROR_MARK operands.
+
 2004-08-16  Zack Weinberg  <zack@codesourcery.com>
 
        * Makefile.in (BUILD_PREFIX, BUILD_PREFIX_1): Delete.
index 5fca42def6e404c1956c55888a3cf14e1296200d..168883421f47b1ec57d5d7adc2926c51818c58e8 100644 (file)
@@ -7551,6 +7551,11 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
        op0 = convert (result_type, op0);
       if (TREE_TYPE (op1) != result_type)
        op1 = convert (result_type, op1);
+
+      /* This can happen if one operand has a vector type, and the other
+        has a different type.  */
+      if (TREE_CODE (op0) == ERROR_MARK || TREE_CODE (op1) == ERROR_MARK)
+       return error_mark_node;
     }
 
   if (build_type == NULL_TREE)
index ff03d9c7aa63812488d78c9a4ec630c30ffb4385..4feabefb2c44f5c727adda7d86e0bf93039cfde6 100644 (file)
@@ -668,11 +668,18 @@ extern void tree_operand_check_failed (int, enum tree_code,
   (TREE_CODE (TYPE) == COMPLEX_TYPE    \
    && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
 
+/* Nonzero if TYPE represents a vector floating-point type.  */
+
+#define VECTOR_FLOAT_TYPE_P(TYPE)      \
+  (TREE_CODE (TYPE) == VECTOR_TYPE     \
+   && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
+
 /* Nonzero if TYPE represents a floating-point type, including complex
-   floating-point types.  */
+   and vector floating-point types.  */
 
 #define FLOAT_TYPE_P(TYPE)             \
-  (SCALAR_FLOAT_TYPE_P (TYPE) || COMPLEX_FLOAT_TYPE_P (TYPE))
+  (SCALAR_FLOAT_TYPE_P (TYPE) || COMPLEX_FLOAT_TYPE_P (TYPE)   \
+   || VECTOR_FLOAT_TYPE_P (TYPE))
 
 /* Nonzero if TYPE represents an aggregate (multi-component) type.  */