[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#241255: gcc-3.3: miscompiles loop with bitfield counter



On Wed, 31 Mar 2004, Oswald Buddenhagen wrote:

> this is new in gcc/g++ 3.3.3-5; it worked in 3.3.3-3 (i think, not
> sure about the -3 part).
>
> the following minimal test program triggers an endless loop (it should
> exit immediately):
>
> --------------------------
> #include <stdio.h>
>
> static struct {
>    int count:4;
> } test;
>
> int main()
> {
>   while (test.count--)
>     puts("the impossible happened");
>
>   return 0;
> }
> --------------------------
>
> if count is no bitfield or if it is an unsigned bitfield, everything
> seems fine.

This is already known as  PR 14755 upstream.

	Falk





Reply to: