This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/50083] [4.7 regression] All 32-bit fortran tests fail on 32-bit Solaris
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Aug 2011 18:30:54 +0000
- Subject: [Bug middle-end/50083] [4.7 regression] All 32-bit fortran tests fail on 32-bit Solaris
- Auto-submitted: auto-generated
- References: <bug-50083-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50083
--- Comment #8 from Uros Bizjak <ubizjak at gmail dot com> 2011-08-25 18:30:54 UTC ---
Too many trees to see the forest case ;)
We also have to protect conversion of round, rint and nearbyint with
TARGET_C99.
Obvious patch (also includes non-harmful typo in existing code):
--cut here--
Index: convert.c
===================================================================
--- convert.c (revision 178071)
+++ convert.c (working copy)
@@ -469,6 +469,9 @@ convert_to_integer (tree type, tree expr)
break;
CASE_FLT_FN (BUILT_IN_ROUND):
+ /* Only convert in ISO C99 mode. */
+ if (!TARGET_C99_FUNCTIONS)
+ break;
if (outprec < TYPE_PRECISION (integer_type_node)
|| (outprec == TYPE_PRECISION (integer_type_node)
&& !TYPE_UNSIGNED (type)))
@@ -487,11 +490,14 @@ convert_to_integer (tree type, tree expr)
break;
/* ... Fall through ... */
CASE_FLT_FN (BUILT_IN_RINT):
+ /* Only convert in ISO C99 mode. */
+ if (!TARGET_C99_FUNCTIONS)
+ break;
if (outprec < TYPE_PRECISION (integer_type_node)
|| (outprec == TYPE_PRECISION (integer_type_node)
&& !TYPE_UNSIGNED (type)))
fn = mathfn_built_in (s_intype, BUILT_IN_IRINT);
- else if (outprec < TYPE_PRECISION (long_integer_type_node)
+ else if (outprec == TYPE_PRECISION (long_integer_type_node)
&& !TYPE_UNSIGNED (type))
fn = mathfn_built_in (s_intype, BUILT_IN_LRINT);
else if (outprec == TYPE_PRECISION (long_long_integer_type_node)
--cut here--