PR optimization/9325, PR java/6391
authorRoger Sayle <roger@eyesopen.com>
Fri, 3 Oct 2003 21:33:57 +0000 (21:33 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Fri, 3 Oct 2003 21:33:57 +0000 (21:33 +0000)
commit875eda9c345e57676c4f21f753274ee51025fa41
tree09c0fbd9595e9411be41c39493368c74ad3a13be
parent4dbe1556cce68a32108fbad54c6e445240f8bb4b
PR optimization/9325, PR java/6391

PR optimization/9325, PR java/6391
* fold-const.c (fold_convert): For floating point to integer
conversions, return the maximum/minimum representable integer
value if the real constant overflows the destination type.
* tree.c (real_value_from_int_cst): Allow the type to be NULL,
meaning don't truncate the result to a floating point mode.
Simplify the logic by calling real_from_integer directly.
* simplify-rtx.c (simplify_unary_operation):  Implement the
same semantics for folding floating point to integer conversions
in RTL.

* gcc.c-torture/execute/20031003-1.c: New test case.

From-SVN: r72079
gcc/ChangeLog
gcc/fold-const.c
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20031003-1.c [new file with mode: 0644]
gcc/tree.c