This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/30704] [4.2/4.3 Regression] Incorrect constant generation for long long
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2007 22:25:31 -0000
- Subject: [Bug middle-end/30704] [4.2/4.3 Regression] Incorrect constant generation for long long
- References: <bug-30704-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from pinskia at gcc dot gnu dot org 2007-03-12 22:25 -------
Index: ../../gcc/fold-const.c
===================================================================
--- ../../gcc/fold-const.c (revision 122864)
+++ ../../gcc/fold-const.c (working copy)
@@ -7357,6 +7357,7 @@ native_interpret_real (tree type, unsign
up to 192 bits. */
REAL_VALUE_TYPE r;
long tmp[6];
+ long tmp1[6];
total_bytes = GET_MODE_SIZE (TYPE_MODE (type));
if (total_bytes > len || total_bytes > 24)
@@ -7386,6 +7387,11 @@ native_interpret_real (tree type, unsign
}
real_from_target (&r, tmp, mode);
+ real_to_target (tmp1, &r, mode);
+ /* If the encoded real is going to decode differently, then reject the
constant
+ conversion. */
+ if (memcpy (tmp, tmp1, total_bytes) != 0)
+ return NULL;
return build_real (type, r);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30704