This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] c++ify sreal
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <pinskia at gmail dot com>, Richard Biener <richard dot guenther at gmail dot com>, Trevor Saunders <tsaunders at mozilla dot com>
- Date: Tue, 11 Nov 2014 09:45:38 +0100
- Subject: Re: [PATCH] c++ify sreal
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4YfYZSNpwXjAD-e5Z+p-yMvO0Msji36X3nWsjdzdwMDkQ at mail dot gmail dot com> <20141111081157 dot GY5026 at tucnak dot redhat dot com>
On Tue, Nov 11, 2014 at 9:11 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>> >>> do $subject, and cleanup for always 64 bit hwi.
>> >>>
>> >>>
>> >>> bootstrapped + regtested x86_64-unknown-linux-gnu, ok?
>> >>
>> >> Ok. Can you please replace remaining HOST_WIDE_INT
>> >> vestiges in there with [u]int64_t please?
>> >
>> >
>> > This patch breaks the build on debian 6.0:
>> >
>> > ../../gcc/sreal.c: In member function Äint64_t sreal::to_int() constÄ:
>> > ../../gcc/sreal.c:159: error: ÄINT64_MAXÄ was not declared in this scope
>>
> Still, I don't believe it will be portable everywhere.
> Can't you use
> INTTYPE_MAXIMUM (int64_t) instead of INT64_MAX? We already use that
> in GCC...
Yes, following patch also bootstraps:
--cut here--
Index: sreal.c
===================================================================
--- sreal.c (revision 217338)
+++ sreal.c (working copy)
@@ -156,7 +156,7 @@ sreal::to_int () const
if (m_exp <= -SREAL_BITS)
return 0;
if (m_exp >= SREAL_PART_BITS)
- return INT64_MAX;
+ return INTTYPE_MAXIMUM (int64_t);
if (m_exp > 0)
return m_sig << m_exp;
if (m_exp < 0)
--cut here--
Uros.