* fold-const.c (operand_equal_p): Require equal sign also for
FIX_{CEIL,TRUNC,FLOOR,ROUND}_EXPR.
* gcc.c-torture/execute/
20040831-1.c: New test.
From-SVN: r86906
+2004-09-01 Jakub Jelinek <jakub@redhat.com>
+
+ * fold-const.c (operand_equal_p): Require equal sign also for
+ FIX_{CEIL,TRUNC,FLOOR,ROUND}_EXPR.
+
2004-09-01 Richard Earnshaw <rearnsha@arm.com>
* config.gcc (--with-cpu on ARM): Preserve the canonical cpu name
{
case '1':
/* Two conversions are equal only if signedness and modes match. */
- if ((TREE_CODE (arg0) == NOP_EXPR || TREE_CODE (arg0) == CONVERT_EXPR)
- && (TYPE_UNSIGNED (TREE_TYPE (arg0))
- != TYPE_UNSIGNED (TREE_TYPE (arg1))))
- return 0;
+ switch (TREE_CODE (arg0))
+ {
+ case NOP_EXPR:
+ case CONVERT_EXPR:
+ case FIX_CEIL_EXPR:
+ case FIX_TRUNC_EXPR:
+ case FIX_FLOOR_EXPR:
+ case FIX_ROUND_EXPR:
+ if (TYPE_UNSIGNED (TREE_TYPE (arg0))
+ != TYPE_UNSIGNED (TREE_TYPE (arg1)))
+ return 0;
+ break;
+ default:
+ break;
+ }
return operand_equal_p (TREE_OPERAND (arg0, 0),
TREE_OPERAND (arg1, 0), flags);
+2004-09-01 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/execute/20040831-1.c: New test.
+
2004-09-01 David Billinghurst <David.Billinghurst@riotinto.com>
PR fortran/16579
--- /dev/null
+/* This testcase was being miscompiled, because operand_equal_p
+ returned that (unsigned long) d and (long) d are equal. */
+extern void abort (void);
+extern void exit (int);
+
+int
+main (void)
+{
+ double d = -12.0;
+ long l = (d > 10000) ? (unsigned long) d : (long) d;
+ if (l != -12)
+ abort ();
+ exit (0);
+}