diff options
| author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-15 22:13:21 +0000 |
|---|---|---|
| committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-15 22:13:21 +0000 |
| commit | 315ba3551e1dd06df37e208b053be73d5c4c63dd (patch) | |
| tree | 7edbe1acfb8a5b45701a916a2cd65e6e7107fae2 /gcc/c-typeck.c | |
| parent | 8b54bce65e960d78f0ff1d62af3710798b72ed6f (diff) | |
| download | ppe42-gcc-315ba3551e1dd06df37e208b053be73d5c4c63dd.tar.gz ppe42-gcc-315ba3551e1dd06df37e208b053be73d5c4c63dd.zip | |
* c-common.c (binary_op_error): Don't allow LROTATE_EXPR,
RROTATE_EXPR or unknown code.
* c-typeck.c (build_binary_op): Don't allow RROTATE_EXPR,
LROTATE_EXPR, MAX_EXPR, MIN_EXPR, UNORDERED_EXPR, ORDERED_EXPR,
UNLT_EXPR, UNLE_EXPR, UNGT_EXPR, UNGE_EXPR, UNEQ_EXPR, LTGT_EXPR
or unknown code.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90697 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
| -rw-r--r-- | gcc/c-typeck.c | 64 |
1 files changed, 1 insertions, 63 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 6be4d6b0000..90ca0defce4 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -7281,29 +7281,6 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, } break; - case RROTATE_EXPR: - case LROTATE_EXPR: - if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) - { - if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0) - { - if (tree_int_cst_sgn (op1) < 0) - warning ("shift count is negative"); - else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("shift count >= width of type"); - } - - /* Use the type of the value to be shifted. */ - result_type = type0; - /* Convert the shift-count to an integer, regardless of size - of value being shifted. */ - if (TYPE_MAIN_VARIANT (TREE_TYPE (op1)) != integer_type_node) - op1 = convert (integer_type_node, op1); - /* Avoid converting op1 to result_type later. */ - converted = 1; - } - break; - case EQ_EXPR: case NE_EXPR: if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE)) @@ -7365,28 +7342,6 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, } break; - case MAX_EXPR: - case MIN_EXPR: - if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE) - && (code1 == INTEGER_TYPE || code1 == REAL_TYPE)) - shorten = 1; - else if (code0 == POINTER_TYPE && code1 == POINTER_TYPE) - { - if (comp_target_types (type0, type1, 1)) - { - result_type = common_pointer_type (type0, type1); - if (pedantic - && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) - pedwarn ("ISO C forbids ordered comparisons of pointers to functions"); - } - else - { - result_type = ptr_type_node; - pedwarn ("comparison of distinct pointer types lacks a cast"); - } - } - break; - case LE_EXPR: case GE_EXPR: case LT_EXPR: @@ -7439,25 +7394,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, } break; - case UNORDERED_EXPR: - case ORDERED_EXPR: - case UNLT_EXPR: - case UNLE_EXPR: - case UNGT_EXPR: - case UNGE_EXPR: - case UNEQ_EXPR: - case LTGT_EXPR: - build_type = integer_type_node; - if (code0 != REAL_TYPE || code1 != REAL_TYPE) - { - error ("unordered comparison on non-floating point argument"); - return error_mark_node; - } - common = 1; - break; - default: - break; + gcc_unreachable (); } if (code0 == ERROR_MARK || code1 == ERROR_MARK) |

