[PATCH] Avoid creating useless BIT_FIELD_REFs (PR middle-end/19858)

Roger Sayle roger@eyesopen.com
Fri Feb 11 15:03:00 GMT 2005


On Thu, 10 Feb 2005, Jakub Jelinek wrote:
> 2005-02-10  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR middle-end/19858
> 	* fold-const.c (make_bit_field_ref): If bitpos == 0 and bitsize
> 	is number of inner's bits, avoid creating a BIT_FIELD_REF.
>
> 	* gcc.c-torture/compile/20050210-1.c: New test.

This is OK for mainline.  We should probably also add this optimization
to fold (which doesn't currently do anything for BIT_FIELD_REF) and
document BIT_FIELD_REF in c-tree.texi.  However, neither of these need
hold up a 4.0 regression fix.

Thanks,

Roger
--



More information about the Gcc-patches mailing list