This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Unreviewed gcov patch
- From: Paul Schlie <schlie at comcast dot net>
- To: Dale Johannesen <dalej at apple dot com>,Richard Sandiford <rsandifo at redhat dot com>,<gcc-patches at gcc dot gnu dot org>,Dale Johannesen <dalej at apple dot com>,Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 07 Apr 2005 09:17:42 -0400
- Subject: Re: Unreviewed gcov patch
> On Apr 6, 2005, at 3:59 PM, Richard Sandiford wrote:
>
> [ Dale: I notice that your recent value-prof.c patch uses 0xffffffffull
> in a call to build_int_cst_wide. I guess that needs to be changed
> to be compatible with C90. ]
>
> - tree_val = build_int_cst_wide (GCOV_TYPE_NODE, val & 0xffffffffull,
> val >> > 32);
> + tree_val = build_int_cst_wide (get_gcov_type (),
> + val & 0xffffffffull, val >> 32);
>
> As well as breaking when sizeof(gcov_type) != 64.
> Memory is stirring; I never liked this bit, and it's one reason I never
> tried to put this in mainline myself. However I don't know how to do this
> in conformant fashion.
>
> If some host didn't accept 0xffffffffull, I would expect that to show up as
> a build time compiler error. Nobody's reported such an error. Perhaps it is
> actually safe at this point
- it can't be safe, as >> 32 for a 32-bit value is also meaningless; so
could seem that the expression should be corrected to be based on the
sizeof( gcov_type ), (as nor should it be presumed that long-long >= 64).