This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: byte_from_pos & CEIL_DIV_EXPR
- To: geoffk at cygnus dot com
- Subject: Re: byte_from_pos & CEIL_DIV_EXPR
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- Date: Fri, 7 Apr 00 22:45:09 EDT
- Cc: gcc at gcc dot gnu dot org
Is there some reason why byte_from_pos uses CEIL_DIV_EXPR rather than,
say, TRUNC_DIV_EXPR? I would expect that TRUNC_DIV_EXPR or
FLOOR_DIV_EXPR would be more correct, since if something starts at a
bitwise offset of 11, then it starts at a byte offset of 1, not 2.
Sorry, I was away for a week.
There is indeed a problem here, but it's more subtle. The problem is that
byte_from_pos can be used in both contexts: where you want the byte
containing the value and where you want to use it as a length.
My feeling is that we should use it for the former purpose only and thus
TRUNC_DIV is correct.
But I need to look at this more. Sometime over the weekend.