Commit d1a7edaf by Paolo Bonzini Committed by Paolo Bonzini

re PR rtl-optimization/15649 (ICE with __builtin_isgreater and -ffast-math)

gcc/ChangeLog:
2004-05-27  Paolo Bonzini  <bonzini@gnu.org>
	    Roger Sayle  <roger@eyesopen.com>

	PR rtl-optimization/15649
	Add LTGT_EXPR and improve pretty-printing of unordered
	comparisons.
	* c-common.c (c_common_truthvalue_conversion):
	Handle LTGT_EXPR.
	* c-typeck.c (build_binary_op): Likewise.
	* dojump.c (do_jump): Likewise.
	* expr.c (expand_expr_real_1, do_store_flag): Likewise.
	* predict.c (tree_predict_by_opcode): Likewise.
	* real.c (real_compare): Likewise.
	* tree-cfg.c (verify_expr): Likewise.
	* tree-inline.c (estimate_num_insns_1): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	Handle ORDERED_EXPR, UNORDERED_EXPR.
	(op_symbol): Print unordered comparisons differently
	than ordered ones.
	* tree.def (LTGT_EXPR): New '<' tree code.
	* doc/c-tree.texi (Expressions): Document floating-point
	comparison nodes.

	Fold comparisons between floating point values.
	* fold-const.c (enum comparison_code): New, from
	#define'd constants.  Define compcodes for unordered
	comparisons and for invalid transformations.
	(invert_tree_comparison): Add "honor_nans" parameter.
	(fold_truthop): Revamp to work on floating-point types too.
	(comparison_to_compcode): Support unordered comparisons.
	Use new enum comparison_code.
	(compcode_to_comparison): Likewise.
	(combine_compcodes): New function.
	(invert_truthvalue): Let invert_tree_comparison decide
	whether it is valid to fold the comparison.  Fold ORDERED
	and UNORDERED even if flag_unsafe_math_optimizations is off,
	and the remaining even if flag_unsafe_math_optimizations
	is off but we are under -fno-trapping-math.
	(fold_relational_const): Integer modes do not honor NaNs.

gcc/testsuite/ChangeLog:
2004-05-27  Paolo Bonzini  <bonzini@gnu.org>

	* gcc.c-torture/compare-fp-1.c, gcc.c-torture/compare-fp-2.c,
	gcc.c-torture/compare-fp-3.c, gcc.c-torture/compare-fp-4.c,
	gcc.c-torture/compare-fp-3.x, gcc.c-torture/compare-fp-4.x,
	gcc.c-torture/pr15649-1.c: New.

Co-Authored-By: Roger Sayle <roger@eyesopen.com>

From-SVN: r82365
parent 2966b00e
2004-05-28 Paolo Bonzini <bonzini@gnu.org>
Roger Sayle <roger@eyesopen.com>
PR rtl-optimization/15649
Add LTGT_EXPR and improve pretty-printing of unordered
comparisons.
* c-common.c (c_common_truthvalue_conversion):
Handle LTGT_EXPR.
* c-typeck.c (build_binary_op): Likewise.
* dojump.c (do_jump): Likewise.
* expr.c (expand_expr_real_1, do_store_flag): Likewise.
* predict.c (tree_predict_by_opcode): Likewise.
* real.c (real_compare): Likewise.
* tree-cfg.c (verify_expr): Likewise.
* tree-inline.c (estimate_num_insns_1): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
Handle ORDERED_EXPR, UNORDERED_EXPR.
(op_symbol): Print unordered comparisons differently
than ordered ones.
* tree.def (LTGT_EXPR): New '<' tree code.
* doc/c-tree.texi (Expressions): Document floating-point
comparison nodes.
Fold comparisons between floating point values.
* fold-const.c (enum comparison_code): New, from
#define'd constants. Define compcodes for unordered
comparisons and for invalid transformations.
(invert_tree_comparison): Add "honor_nans" parameter.
(fold_truthop): Revamp to work on floating-point types too.
(comparison_to_compcode): Support unordered comparisons.
Use new enum comparison_code.
(compcode_to_comparison): Likewise.
(combine_compcodes): New function.
(invert_truthvalue): Let invert_tree_comparison decide
whether it is valid to fold the comparison. Fold ORDERED
and UNORDERED even if flag_unsafe_math_optimizations is off,
and the remaining even if flag_unsafe_math_optimizations
is off but we are under -fno-trapping-math.
(fold_relational_const): Integer modes do not honor NaNs.
2004-05-28 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_output_epilogue): Remove redundant code.
......
......@@ -2582,7 +2582,7 @@ c_common_truthvalue_conversion (tree expr)
switch (TREE_CODE (expr))
{
case EQ_EXPR: case NE_EXPR: case UNEQ_EXPR:
case EQ_EXPR: case NE_EXPR: case UNEQ_EXPR: case LTGT_EXPR:
case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR:
case UNLE_EXPR: case UNGE_EXPR: case UNLT_EXPR: case UNGT_EXPR:
case ORDERED_EXPR: case UNORDERED_EXPR:
......
......@@ -6798,6 +6798,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case UNGT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
case LTGT_EXPR:
build_type = integer_type_node;
if (code0 != REAL_TYPE || code1 != REAL_TYPE)
{
......
......@@ -1745,6 +1745,12 @@ This macro returns the attributes on the type @var{type}.
@tindex GE_EXPR
@tindex EQ_EXPR
@tindex NE_EXPR
@tindex UNLT_EXPR
@tindex UNLE_EXPR
@tindex UNGT_EXPR
@tindex UNGE_EXPR
@tindex UNEQ_EXPR
@tindex LTGT_EXPR
@tindex INIT_EXPR
@tindex MODIFY_EXPR
@tindex COMPONENT_REF
......@@ -2106,6 +2112,39 @@ operators. The first and second operand with either be both of integral
type or both of floating type. The result type of these expressions
will always be of integral or boolean type.
Floating-point comparison may have a fourth possible outcome for a
comparison, other than less, greater or equal: this is @dfn{unordered},
and two floating-point values are unordered if one of them is
a @dfn{not-a-number} (@dfn{NaN}) value. In this case, all of these
nodes will be false but @code{NE_EXPR}, and the first four of these
nodes will also raise an invalid operation trap.
@item ORDERED_EXPR
@itemx UNORDERED_EXPR
@item UNLT_EXPR
@itemx UNLE_EXPR
@itemx UNGT_EXPR
@itemx UNGE_EXPR
@itemx UNEQ_EXPR
@itemx LTGT_EXPR
These nodes represent other relational operations that are only used
with floating types.
If the outcome of the comparison is unordered, all of these special
comparisons will be true but @code{ORDERED_EXPR} and @code{LTGT_EXPR}.
Only @code{LTGT_EXPR} is expected to generate an invalid floating-point
operation trap when the outcome is unordered.
@code{ORDERED_EXPR} is true if neither of its operands is a NaN,
while its negation @code{UNORDERED_EXPR} is true if at least one of
its operands is a NaN.
For floating operations, inverting one of the standard comparison nodes
will result in one of these nodes, with its name prefixed by
@code{UN}---the only exception is @code{NE_EXPR}, whose negation is
@code{LTGT_EXPR}.
@item MODIFY_EXPR
These nodes represent assignment. The left-hand side is the first
operand; the right-hand side is the second operand. The left-hand side
......
......@@ -525,7 +525,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
{
enum rtx_code rcode1;
enum tree_code tcode2;
enum tree_code tcode1 = UNORDERED_EXPR, tcode2;
case UNLT_EXPR:
rcode1 = UNLT;
......@@ -547,6 +547,13 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
rcode1 = UNEQ;
tcode2 = EQ_EXPR;
goto unordered_bcc;
case LTGT_EXPR:
/* It is ok for LTGT_EXPR to trap when the result is unordered,
so expand to (a < b) || (a > b). */
rcode1 = LTGT;
tcode1 = LT_EXPR;
tcode2 = GT_EXPR;
goto unordered_bcc;
unordered_bcc:
mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
......@@ -560,8 +567,8 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
tree cmp0, cmp1;
/* If the target doesn't support combined unordered
compares, decompose into UNORDERED + comparison. */
cmp0 = fold (build (UNORDERED_EXPR, TREE_TYPE (exp), op0, op1));
compares, decompose into two comparisons. */
cmp0 = fold (build (tcode1, TREE_TYPE (exp), op0, op1));
cmp1 = fold (build (tcode2, TREE_TYPE (exp), op0, op1));
exp = build (TRUTH_ORIF_EXPR, TREE_TYPE (exp), cmp0, cmp1);
do_jump (exp, if_false_label, if_true_label);
......
......@@ -8305,6 +8305,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case UNGT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
case LTGT_EXPR:
temp = do_store_flag (exp,
modifier != EXPAND_STACK_PARM ? target : NULL_RTX,
tmode != VOIDmode ? tmode : mode, 0);
......@@ -9815,6 +9816,9 @@ do_store_flag (tree exp, rtx target, enum machine_mode mode, int only_cheap)
case UNEQ_EXPR:
code = UNEQ;
break;
case LTGT_EXPR:
code = LTGT;
break;
default:
abort ();
......
......@@ -865,6 +865,7 @@ tree_predict_by_opcode (basic_block bb)
break;
case NE_EXPR:
case LTGT_EXPR:
/* Floating point comparisons appears to behave in a very
unpredictable way because of special role of = tests in
FP code. */
......
......@@ -1080,6 +1080,8 @@ real_compare (int icode, const REAL_VALUE_TYPE *op0,
return do_compare (op0, op1, 1) >= 0;
case UNEQ_EXPR:
return do_compare (op0, op1, 0) == 0;
case LTGT_EXPR:
return do_compare (op0, op1, 0) != 0;
default:
abort ();
......
2004-05-28 Paolo Bonzini <bonzini@gnu.org>
* gcc.c-torture/compare-fp-1.c, gcc.c-torture/compare-fp-2.c,
gcc.c-torture/compare-fp-3.c, gcc.c-torture/compare-fp-4.c,
gcc.c-torture/compare-fp-3.x, gcc.c-torture/compare-fp-4.x,
gcc.c-torture/pr15649-1.c: New.
2004-05-27 Adam Nemet <anemet@lnxw.com>
PR c++/12883
......
/* Copyright (C) 2004 Free Software Foundation.
Test for correctness of composite floating-point comparisons.
Written by Paolo Bonzini, 26th May 2004. */
extern void abort (void);
#define TEST(c) if ((c) != ok) abort ();
#define ORD(a, b) (!__builtin_isunordered ((a), (b)))
#define UNORD(a, b) (__builtin_isunordered ((a), (b)))
#define UNEQ(a, b) (__builtin_isunordered ((a), (b)) || ((a) == (b)))
#define UNLT(a, b) (__builtin_isunordered ((a), (b)) || ((a) < (b)))
#define UNLE(a, b) (__builtin_isunordered ((a), (b)) || ((a) <= (b)))
#define UNGT(a, b) (__builtin_isunordered ((a), (b)) || ((a) > (b)))
#define UNGE(a, b) (__builtin_isunordered ((a), (b)) || ((a) >= (b)))
#define LTGT(a, b) (__builtin_islessgreater ((a), (b)))
float pinf;
float ninf;
float NaN;
int iuneq (float x, float y, int ok)
{
TEST (UNEQ (x, y));
TEST (!LTGT (x, y));
TEST (UNLE (x, y) && UNGE (x,y));
}
int ieq (float x, float y, int ok)
{
TEST (ORD (x, y) && UNEQ (x, y));
}
int iltgt (float x, float y, int ok)
{
TEST (!UNEQ (x, y)); /* Not optimizable. */
TEST (LTGT (x, y)); /* Same, __builtin_islessgreater does not trap. */
TEST (ORD (x, y) && (UNLT (x, y) || UNGT (x,y)));
}
int ine (float x, float y, int ok)
{
TEST (UNLT (x, y) || UNGT (x, y));
}
int iunlt (float x, float y, int ok)
{
TEST (UNLT (x, y));
TEST (UNORD (x, y) || (x < y));
}
int ilt (float x, float y, int ok)
{
TEST (ORD (x, y) && UNLT (x, y)); /* Not optimized */
TEST ((x <= y) && (x != y));
TEST ((x <= y) && (y != x));
TEST ((x != y) && (x <= y)); /* Not optimized */
TEST ((y != x) && (x <= y)); /* Not optimized */
}
int iunle (float x, float y, int ok)
{
TEST (UNLE (x, y));
TEST (UNORD (x, y) || (x <= y));
}
int ile (float x, float y, int ok)
{
TEST (ORD (x, y) && UNLE (x, y)); /* Not optimized */
TEST ((x < y) || (x == y));
TEST ((y > x) || (x == y));
TEST ((x == y) || (x < y)); /* Not optimized */
TEST ((y == x) || (x < y)); /* Not optimized */
}
int iungt (float x, float y, int ok)
{
TEST (UNGT (x, y));
TEST (UNORD (x, y) || (x > y));
}
int igt (float x, float y, int ok)
{
TEST (ORD (x, y) && UNGT (x, y)); /* Not optimized */
TEST ((x >= y) && (x != y));
TEST ((x >= y) && (y != x));
TEST ((x != y) && (x >= y)); /* Not optimized */
TEST ((y != x) && (x >= y)); /* Not optimized */
}
int iunge (float x, float y, int ok)
{
TEST (UNGE (x, y));
TEST (UNORD (x, y) || (x >= y));
}
int ige (float x, float y, int ok)
{
TEST (ORD (x, y) && UNGE (x, y)); /* Not optimized */
TEST ((x > y) || (x == y));
TEST ((y < x) || (x == y));
TEST ((x == y) || (x > y)); /* Not optimized */
TEST ((y == x) || (x > y)); /* Not optimized */
}
int
main ()
{
pinf = __builtin_inf ();
ninf = -__builtin_inf ();
NaN = __builtin_nan ("");
iuneq (ninf, pinf, 0);
iuneq (NaN, NaN, 1);
iuneq (pinf, ninf, 0);
iuneq (1, 4, 0);
iuneq (3, 3, 1);
iuneq (5, 2, 0);
ieq (1, 4, 0);
ieq (3, 3, 1);
ieq (5, 2, 0);
iltgt (ninf, pinf, 1);
iltgt (NaN, NaN, 0);
iltgt (pinf, ninf, 1);
iltgt (1, 4, 1);
iltgt (3, 3, 0);
iltgt (5, 2, 1);
ine (1, 4, 1);
ine (3, 3, 0);
ine (5, 2, 1);
iunlt (NaN, ninf, 1);
iunlt (pinf, NaN, 1);
iunlt (pinf, ninf, 0);
iunlt (pinf, pinf, 0);
iunlt (ninf, ninf, 0);
iunlt (1, 4, 1);
iunlt (3, 3, 0);
iunlt (5, 2, 0);
ilt (1, 4, 1);
ilt (3, 3, 0);
ilt (5, 2, 0);
iunle (NaN, ninf, 1);
iunle (pinf, NaN, 1);
iunle (pinf, ninf, 0);
iunle (pinf, pinf, 1);
iunle (ninf, ninf, 1);
iunle (1, 4, 1);
iunle (3, 3, 1);
iunle (5, 2, 0);
ile (1, 4, 1);
ile (3, 3, 1);
ile (5, 2, 0);
iungt (NaN, ninf, 1);
iungt (pinf, NaN, 1);
iungt (pinf, ninf, 1);
iungt (pinf, pinf, 0);
iungt (ninf, ninf, 0);
iungt (1, 4, 0);
iungt (3, 3, 0);
iungt (5, 2, 1);
igt (1, 4, 0);
igt (3, 3, 0);
igt (5, 2, 1);
iunge (NaN, ninf, 1);
iunge (pinf, NaN, 1);
iunge (ninf, pinf, 0);
iunge (pinf, pinf, 1);
iunge (ninf, ninf, 1);
iunge (1, 4, 0);
iunge (3, 3, 1);
iunge (5, 2, 1);
ige (1, 4, 0);
ige (3, 3, 1);
ige (5, 2, 1);
return 0;
}
/* Copyright (C) 2004 Free Software Foundation.
Ensure that the composite comparison optimization doesn't misfire
and attempt to combine an integer comparison with a floating-point one.
Written by Paolo Bonzini, 26th May 2004. */
extern void abort (void);
int
foo (double x, double y)
{
/* If miscompiled the following may become false. */
return (x > y) && ((int)x == (int)y);
}
int
main ()
{
if (! foo (1.3,1.0))
abort ();
return 0;
}
/* Copyright (C) 2004 Free Software Foundation.
Test for composite comparison always true/false optimization.
Written by Paolo Bonzini, 26th May 2004. */
extern void link_error0 ();
extern void link_error1 ();
void
test1 (float x, float y)
{
if ((x==y) && (x!=y))
link_error0();
}
void
test2 (float x, float y)
{
if ((x<y) && (x>y))
link_error0();
}
void
test3 (float x, float y)
{
if ((x<y) && (y<x))
link_error0();
}
void
test4 (float x, float y)
{
if ((x==y) || (x!=y))
{
}
else
link_error1 ();
}
void
test5 (float x, float y)
{
if (__builtin_isunordered (x, y) || (x>=y) || (x<y))
{
}
else
link_error1 ();
}
void
test6 (float x, float y)
{
if (__builtin_isunordered (y, x) || (x<=y) || (y<x))
{
}
else
link_error1 ();
}
void
test7 (float x, float y)
{
if (__builtin_isunordered (x, y) || !__builtin_isunordered (x, y))
{
}
else
link_error1 ();
}
void
all_tests (float x, float y)
{
test1 (x, y);
test2 (x, y);
test3 (x, y);
test4 (x, y);
test5 (x, y);
test6 (x, y);
test7 (x, y);
}
int
main ()
{
all_tests (0, 0);
all_tests (1, 2);
all_tests (4, 3);
return 0;
}
#ifndef __OPTIMIZE__
void link_error0() {}
void link_error1() {}
#endif /* ! __OPTIMIZE__ */
set options "-fno-trapping-math"
return 0
/* Copyright (C) 2004 Free Software Foundation.
Test for correctness of composite floating-point comparisons.
Written by Paolo Bonzini, 26th May 2004. */
extern void abort (void);
#define TEST(c) if ((c) != ok) abort ();
#define ORD(a, b) (((a) < (b)) || (a) >= (b))
#define UNORD(a, b) (!ORD ((a), (b)))
#define UNEQ(a, b) (!LTGT ((a), (b)))
#define UNLT(a, b) (((a) < (b)) || __builtin_isunordered ((a), (b)))
#define UNLE(a, b) (((a) <= (b)) || __builtin_isunordered ((a), (b)))
#define UNGT(a, b) (((a) > (b)) || __builtin_isunordered ((a), (b)))
#define UNGE(a, b) (((a) >= (b)) || __builtin_isunordered ((a), (b)))
#define LTGT(a, b) (((a) < (b)) || (a) > (b))
float pinf;
float ninf;
float NaN;
int iuneq (float x, float y, int ok)
{
TEST (UNEQ (x, y));
TEST (!LTGT (x, y));
TEST (UNLE (x, y) && UNGE (x,y));
}
int ieq (float x, float y, int ok)
{
TEST (ORD (x, y) && UNEQ (x, y));
}
int iltgt (float x, float y, int ok)
{
TEST (!UNEQ (x, y));
TEST (LTGT (x, y));
TEST (ORD (x, y) && (UNLT (x, y) || UNGT (x,y)));
}
int ine (float x, float y, int ok)
{
TEST (UNLT (x, y) || UNGT (x, y));
TEST ((x < y) || (x > y) || UNORD (x, y));
}
int iunlt (float x, float y, int ok)
{
TEST (UNLT (x, y));
TEST (UNORD (x, y) || (x < y));
}
int ilt (float x, float y, int ok)
{
TEST (ORD (x, y) && UNLT (x, y));
TEST ((x <= y) && (x != y));
TEST ((x <= y) && (y != x));
TEST ((x != y) && (x <= y));
TEST ((y != x) && (x <= y));
}
int iunle (float x, float y, int ok)
{
TEST (UNLE (x, y));
TEST (UNORD (x, y) || (x <= y));
}
int ile (float x, float y, int ok)
{
TEST (ORD (x, y) && UNLE (x, y));
TEST ((x < y) || (x == y));
TEST ((y > x) || (x == y));
TEST ((x == y) || (x < y));
TEST ((y == x) || (x < y));
}
int iungt (float x, float y, int ok)
{
TEST (UNGT (x, y));
TEST (UNORD (x, y) || (x > y));
}
int igt (float x, float y, int ok)
{
TEST (ORD (x, y) && UNGT (x, y));
TEST ((x >= y) && (x != y));
TEST ((x >= y) && (y != x));
TEST ((x != y) && (x >= y));
TEST ((y != x) && (x >= y));
}
int iunge (float x, float y, int ok)
{
TEST (UNGE (x, y));
TEST (UNORD (x, y) || (x >= y));
}
int ige (float x, float y, int ok)
{
TEST (ORD (x, y) && UNGE (x, y));
TEST ((x > y) || (x == y));
TEST ((y < x) || (x == y));
TEST ((x == y) || (x > y));
TEST ((y == x) || (x > y));
}
int
main ()
{
pinf = __builtin_inf ();
ninf = -__builtin_inf ();
NaN = __builtin_nan ("");
iuneq (ninf, pinf, 0);
iuneq (NaN, NaN, 1);
iuneq (pinf, ninf, 0);
iuneq (1, 4, 0);
iuneq (3, 3, 1);
iuneq (5, 2, 0);
ieq (1, 4, 0);
ieq (3, 3, 1);
ieq (5, 2, 0);
iltgt (ninf, pinf, 1);
iltgt (NaN, NaN, 0);
iltgt (pinf, ninf, 1);
iltgt (1, 4, 1);
iltgt (3, 3, 0);
iltgt (5, 2, 1);
ine (1, 4, 1);
ine (3, 3, 0);
ine (5, 2, 1);
iunlt (NaN, ninf, 1);
iunlt (pinf, NaN, 1);
iunlt (pinf, ninf, 0);
iunlt (pinf, pinf, 0);
iunlt (ninf, ninf, 0);
iunlt (1, 4, 1);
iunlt (3, 3, 0);
iunlt (5, 2, 0);
ilt (1, 4, 1);
ilt (3, 3, 0);
ilt (5, 2, 0);
iunle (NaN, ninf, 1);
iunle (pinf, NaN, 1);
iunle (pinf, ninf, 0);
iunle (pinf, pinf, 1);
iunle (ninf, ninf, 1);
iunle (1, 4, 1);
iunle (3, 3, 1);
iunle (5, 2, 0);
ile (1, 4, 1);
ile (3, 3, 1);
ile (5, 2, 0);
iungt (NaN, ninf, 1);
iungt (pinf, NaN, 1);
iungt (pinf, ninf, 1);
iungt (pinf, pinf, 0);
iungt (ninf, ninf, 0);
iungt (1, 4, 0);
iungt (3, 3, 0);
iungt (5, 2, 1);
igt (1, 4, 0);
igt (3, 3, 0);
igt (5, 2, 1);
iunge (NaN, ninf, 1);
iunge (pinf, NaN, 1);
iunge (ninf, pinf, 0);
iunge (pinf, pinf, 1);
iunge (ninf, ninf, 1);
iunge (1, 4, 0);
iunge (3, 3, 1);
iunge (5, 2, 1);
ige (1, 4, 0);
ige (3, 3, 1);
ige (5, 2, 1);
return 0;
}
set options "-fno-trapping-math"
return 0
/* { dg-do compile } */
/* { dg-options "-ffast-math -O2" } */
double foo (double x)
{
return __builtin_isgreater (x, 0.0) ? 0.0 : x;
}
......@@ -3194,6 +3194,7 @@ verify_expr (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
case UNGT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
case LTGT_EXPR:
case PLUS_EXPR:
case MINUS_EXPR:
case MULT_EXPR:
......
......@@ -1324,6 +1324,7 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case UNGT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
case LTGT_EXPR:
case CONVERT_EXPR:
......
......@@ -905,6 +905,9 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case UNGT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
case LTGT_EXPR:
case ORDERED_EXPR:
case UNORDERED_EXPR:
{
const char *op = op_symbol (node);
op0 = TREE_OPERAND (node, 0);
......@@ -999,14 +1002,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_character (buffer, '>');
break;
case UNORDERED_EXPR:
NIY;
break;
case ORDERED_EXPR:
NIY;
break;
case IN_EXPR:
NIY;
break;
......@@ -1681,6 +1676,14 @@ op_prio (tree op)
case NE_EXPR:
return 9;
case UNLT_EXPR:
case UNLE_EXPR:
case UNGT_EXPR:
case UNGE_EXPR:
case UNEQ_EXPR:
case LTGT_EXPR:
case ORDERED_EXPR:
case UNORDERED_EXPR:
case LT_EXPR:
case LE_EXPR:
case GT_EXPR:
......@@ -1786,28 +1789,41 @@ op_symbol (tree op)
case BIT_AND_EXPR:
return "&";
case ORDERED_EXPR:
return "ord";
case UNORDERED_EXPR:
return "unord";
case EQ_EXPR:
case UNEQ_EXPR:
return "==";
case UNEQ_EXPR:
return "u==";
case NE_EXPR:
return "!=";
case LT_EXPR:
case UNLT_EXPR:
return "<";
case UNLT_EXPR:
return "u<";
case LE_EXPR:
case UNLE_EXPR:
return "<=";
case UNLE_EXPR:
return "u<=";
case GT_EXPR:
case UNGT_EXPR:
return ">";
case UNGT_EXPR:
return "u>";
case GE_EXPR:
case UNGE_EXPR:
return ">=";
case UNGE_EXPR:
return "u>=";
case LTGT_EXPR:
return "<>";
case LSHIFT_EXPR:
return "<<";
......
......@@ -681,6 +681,9 @@ DEFTREECODE (UNGT_EXPR, "ungt_expr", '<', 2)
DEFTREECODE (UNGE_EXPR, "unge_expr", '<', 2)
DEFTREECODE (UNEQ_EXPR, "uneq_expr", '<', 2)
/* This is the reverse of uneq_expr. */
DEFTREECODE (LTGT_EXPR, "ltgt_expr", '<', 2)
/* Operations for Pascal sets. Not used now. */
DEFTREECODE (IN_EXPR, "in_expr", '2', 2)
DEFTREECODE (SET_LE_EXPR, "set_le_expr", '<', 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment