This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/79487] Invalid _Decimal32 comparison on s390x
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Feb 2017 17:07:37 +0000
- Subject: [Bug target/79487] Invalid _Decimal32 comparison on s390x
- Auto-submitted: auto-generated
- References: <bug-79487-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79487
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I see this is done in:
#0 decimal_from_integer (r=0x7fffffffd1a0) at ../../gcc/real.c:2328
#1 0x0000000000d9b341 in real_from_integer (r=0x7fffffffd1a0, fmt=...,
val_in=..., sgn=SIGNED) at ../../gcc/real.c:2268
#2 0x00000000011d8671 in real_value_from_int_cst (type=0x7ffff00769d8,
i=0x7ffff005ec48) at ../../gcc/tree.c:1967
#3 0x00000000011d86d5 in build_real_from_int_cst (type=<real_type
0x7ffff00769d8 _Decimal32>, i=0x7ffff005ec48) at ../../gcc/tree.c:1980
#4 0x0000000000a766cd in fold_convert_const (code=FLOAT_EXPR, type=<real_type
0x7ffff00769d8 _Decimal32>, arg1=<integer_cst 0x7ffff005ec48>)
at ../../gcc/fold-const.c:2110
#5 0x0000000000a731d6 in const_unop (code=FLOAT_EXPR, type=<real_type
0x7ffff00769d8 _Decimal32>, arg0=<integer_cst 0x7ffff005ec48>)
at ../../gcc/fold-const.c:1566
...
or so. Would be useful to check something similar with non-decimal floats,
whether already real_value_from_int_cst or build_real_from_int_cst or whatever
these call perform the rounding etc. (say when it is -0x7fffffffffffffffL
and it is cast to float where it isn't representable).