This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] use __SIZEOF_DOUBLE__ in libgcc
On Mon, Oct 11, 2010 at 03:14:19PM +0200, Jakub Jelinek wrote:
> On Sun, Oct 10, 2010 at 08:56:34PM -0400, Nathan Froyd wrote:
> > The patch below removes LIBGCC2_DOUBLE_TYPE_SIZE from libgcc.2h and
> > related files, replacing it instead with __SIZEOF_DOUBLE__ (and
> > adjusting conditionals to account for the bits/bytes mismatch). One
> > less use of target macros in libgcc is a good thing.
>
> Are you sure this (and your previos __SIZEOF_LONG*__ patch) won't break
> __CHAR_BIT__ > 8 targets, because you assume in your calculations
> 8 bit char?
> The old code could be wrong, but if it is not, wouldn't it be better
> to replace those macros with bitsizes with __SIZEOF_*__ * __CHAR_BIT__
> instead of __SIZEOF_*__ alone and dividing expected sizes by 8?
Oof. On the one hand, AFAICS, there are no such targets in the tree,
and the standard response to people asking about ports to such targets
is, "well, theoretically you can do it, but there might be a lot of
fallout." So I'm not particularly inclined to keep things in order for
out-of-tree targets or hypothetical future ports.
OTOH, avoiding obvious breakage is pretty easy. And I need to update
for tm.texi anyway, as Joseph pointed out. I'll submit an updated patch
for this, and a separate patch for the __SIZEOF_LONG__ issue.
-Nathan