c/718: -Wall evokes apparent cc1 infloop (w/cvs as of 2000-10-31.03h12UTC)

Bernd Schmidt bernds@redhat.co.uk
Wed Nov 1 08:36:00 GMT 2000


On Tue, 31 Oct 2000, Jim Meyering wrote:

> 
> This problem seems to have been checked in to the repository
> between these dates:
> 
>   2000-10-12.08h50 UTC  (this doesn't infloop)
>   2000-10-20.01h30 UTC  (this does)
> 
> The symptom is that compiling a simple program consumes over 60MB
> of memory and appears to make cc1 infloop.
> 
> >How-To-Repeat:
> 
> Here's the code (derived from GNU tar-1.13.18's src/create.c
> ftp://alpha.gnu.org/gnu/tar/tar-1.13.18.tar.gz ):
> 
> $ cat create.c
> void
> mode_to_chars (unsigned int v)
> {
>   unsigned long int u;
>   u = ((v & 1 ? 21 : 0)
>        | (v & 2 ? 22 : 0)
>        | (v & 3 ? 23 : 0)
>        | (v & 4 ? 24 : 0)
>        | (v & 5 ? 25 : 0)
>        | (v & 6 ? 26 : 0)
>        | (v & 7 ? 27 : 0)
>        | (v & 8 ? 28 : 0)
>        | (v & 9 ? 29 : 0)
>        | (v & 10 ? 30 : 0)
>        | (v & 11 ? 31 : 0)
>        | (v & 12 ? 32 : 0));
> }

FYI, this is a problem with my new code for the sequence point warnings.
It's not actually an infinite loop, it just takes a really long time.
The problem is that during constant folding, a tree gets produced that
has an immense amount of duplication through shared nodes (all of them
SAVE_EXPRs), and the sequence point warning code falls flat on its face
for such a tree because it doesn't notice the shared nodes; all it sees
is one giant tree.  I have no fix yet, but I'm working on it.


Bernd



More information about the Gcc-bugs mailing list