public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/10323: The preprocessor consumes all the memory
@ 2003-04-07  6:16 Neil Booth
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Booth @ 2003-04-07  6:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/10323; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: Zack Weinberg <zack@codesourcery.com>
Cc: lu_zero@gentoo.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/10323: The preprocessor consumes all the memory
Date: Mon, 7 Apr 2003 07:07:23 +0100

 Zack Weinberg wrote:-
 
 > lu_zero@gentoo.org writes:
 > 
 > > Preprocessing altivec code it just consumes all the memory and then
 > > dies reporting:
 > > cpp0: Cannot allocate 262144112 bytes after allocating 7222368 bytes
 > 
 > I can confirm this with mainline, it looks like infinite recursion in
 > the macro expander.  Neil, can you take a look?
 
 I'm pretty certain that the macro expander doesn't recurse or loop.
 
 I've looked at it briefly.  It looks like everything is OK - the expansion
 is just 100s of megabytes or even gigabytes big.
 
 The line that dies is (you can cut the main file down to just this line)
 
     tmp = vec_sub (vec_avg (avg0, avg1),
     		   vec_and (vec_and (ones, vec_or (xor0, xor1)),
 		   			    vec_xor (avg0, avg1)));
 
 Just the 2nd line here by itself expands to almost 6 megs.
 I think it's fair to expect the whole lot to be "very big".
 
 Can you get any other compiler to compile it?  If you can, I'll look at
 it more closely, but I think it's a case of "don't do that, use 
 temporaries instead".
 
 Neil.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/10323: The preprocessor consumes all the memory
@ 2003-04-07  7:15 neil
  0 siblings, 0 replies; 7+ messages in thread
From: neil @ 2003-04-07  7:15 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, lu_zero, nobody

Synopsis: The preprocessor consumes all the memory

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Mon Apr  7 07:15:45 2003
State-Changed-Why:
    Not a bug.  The macro expansion really is that big.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10323


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/10323: The preprocessor consumes all the memory
@ 2003-04-07  6:46 Zack Weinberg
  0 siblings, 0 replies; 7+ messages in thread
From: Zack Weinberg @ 2003-04-07  6:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/10323; it has been noted by GNATS.

From: Zack Weinberg <zack@codesourcery.com>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: lu_zero@gentoo.org,  gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/10323: The preprocessor consumes all the memory
Date: Sun, 06 Apr 2003 23:36:31 -0700

 Neil Booth <neil@daikokuya.co.uk> writes:
 
 > Zack Weinberg wrote:-
 >
 >> lu_zero@gentoo.org writes:
 >> 
 >> > Preprocessing altivec code it just consumes all the memory and then
 >> > dies reporting:
 >> > cpp0: Cannot allocate 262144112 bytes after allocating 7222368 bytes
 >> 
 >> I can confirm this with mainline, it looks like infinite recursion in
 >> the macro expander.  Neil, can you take a look?
 >
 > I'm pretty certain that the macro expander doesn't recurse or loop.
 >
 > I've looked at it briefly.  It looks like everything is OK - the expansion
 > is just 100s of megabytes or even gigabytes big.
 
 Oh, ok, I probably just got sick of waiting and ^C-ed it before it
 finished / ran out of memory.
 
 zw


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/10323: The preprocessor consumes all the memory
@ 2003-04-06 23:06 Zack Weinberg
  0 siblings, 0 replies; 7+ messages in thread
From: Zack Weinberg @ 2003-04-06 23:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/10323; it has been noted by GNATS.

From: Zack Weinberg <zack@codesourcery.com>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: lu_zero@gentoo.org,  gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/10323: The preprocessor consumes all the memory
Date: Sun, 06 Apr 2003 15:59:28 -0700

 Neil Booth <neil@daikokuya.co.uk> writes:
 
 > Can someone give me altivec.h?  I hope it doesn't include anything else.
 
 gcc/config/rs6000/altivec.h
 
 zw


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/10323: The preprocessor consumes all the memory
@ 2003-04-06 22:56 Neil Booth
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Booth @ 2003-04-06 22:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/10323; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: Zack Weinberg <zack@codesourcery.com>
Cc: lu_zero@gentoo.org, gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/10323: The preprocessor consumes all the memory
Date: Sun, 6 Apr 2003 23:55:13 +0100

 Zack Weinberg wrote:-
 
 > lu_zero@gentoo.org writes:
 > 
 > > Preprocessing altivec code it just consumes all the memory and then
 > > dies reporting:
 > > cpp0: Cannot allocate 262144112 bytes after allocating 7222368 bytes
 > 
 > I can confirm this with mainline, it looks like infinite recursion in
 > the macro expander.  Neil, can you take a look?
 
 Can someone give me altivec.h?  I hope it doesn't include anything else.
 
 Neil.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: preprocessor/10323: The preprocessor consumes all the memory
@ 2003-04-06 22:46 Zack Weinberg
  0 siblings, 0 replies; 7+ messages in thread
From: Zack Weinberg @ 2003-04-06 22:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR preprocessor/10323; it has been noted by GNATS.

From: Zack Weinberg <zack@codesourcery.com>
To: lu_zero@gentoo.org, Neil Booth <neil@daikokuya.co.uk>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: preprocessor/10323: The preprocessor consumes all the memory
Date: Sun, 06 Apr 2003 15:36:11 -0700

 lu_zero@gentoo.org writes:
 
 > Preprocessing altivec code it just consumes all the memory and then
 > dies reporting:
 > cpp0: Cannot allocate 262144112 bytes after allocating 7222368 bytes
 
 I can confirm this with mainline, it looks like infinite recursion in
 the macro expander.  Neil, can you take a look?
 
 zw


^ permalink raw reply	[flat|nested] 7+ messages in thread

* preprocessor/10323: The preprocessor consumes all the memory
@ 2003-04-06 21:26 lu_zero
  0 siblings, 0 replies; 7+ messages in thread
From: lu_zero @ 2003-04-06 21:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10323
>Category:       preprocessor
>Synopsis:       The preprocessor consumes all the memory
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 06 21:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     lu_zero@gentoo.org
>Release:        gcc 3.2.2
>Organization:
>Environment:
powerpc-unknown-linux-gnu 
PowerPC 7455
512mb ram
linux-2.4.20-benh9
glibc-2.3.2
>Description:
Preprocessing altivec code it just consumes all the memory and then dies reporting:                                                                                
cpp0: Cannot allocate 262144112 bytes after allocating 7222368 bytes
the system has 512mb ram and 800mb swap
The file is a cut down motion_comp_altivec.c from libmpeg2, that I just used to restrict the faulting part (the rest is compiling ok)
>How-To-Repeat:
that is enough
gcc -c -Os -maltivec -mabi=altivec -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I. -I../libvo -I..   -DMPG12PLAY -o motion_comp_altivec.2.o motion_comp_altivec.2.c -E
                                                                                
that is the result
cpp0: Cannot allocate 262144112 bytes after allocating 7222368 bytes
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-csrc; name="motion_comp_altivec.2.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="motion_comp_altivec.2.c"

I2luY2x1ZGUgPGFsdGl2ZWMuaD4KI2RlZmluZSB2ZWN0b3JfczE2X3QgdmVjdG9yIHNpZ25lZCBz
aG9ydAojZGVmaW5lIHZlY3Rvcl91MTZfdCB2ZWN0b3Igd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WNfYXZnIChBLCBCKTsKCXhvcjEgPSB2ZWNfeG9y
IChBLCBCKTsKCXRtcCA9IHZlY19zdWIgKHZlY19hdmcgKGF2ZzAsIGF2ZzEpLAoJCSAgICAgICB2
ZWNfYW5kICh2ZWNfYW5kIChvbmVzLCB2ZWNfb3IgKHhvcjAsIHhvcjEpKSwKCQkJCXZlY194b3Ig
KGF2ZzAsIGF2ZzEpKSk7CiAgICB9IHdoaWxlICgtLWhlaWdodCk7CgogICAgcmVmMCA9IHZlY19s
ZCAoMCwgcmVmKTsKICAgIHJlZjEgPSB2ZWNfbGQgKDE2LCByZWYpOwogICAgdmVjX3N0ICh0bXAs
IDAsIGRlc3QpOwogICAgQSA9IHZlY19wZXJtIChyZWYwLCByZWYxLCBwZXJtQSk7CiAgICBCID0g
dmVjX3Blcm0gKHJlZjAsIHJlZjEsIHBlcm1CKTsKICAgIGF2ZzAgPSB2ZWNfYXZnIChBLCBCKTsK
ICAgIHhvcjAgPSB2ZWNfeG9yIChBLCBCKTsKICAgIHRtcCA9IHZlY19zdWIgKHZlY19hdmcgKGF2
ZzAsIGF2ZzEpLAoJCSAgIHZlY19hbmQgKHZlY19hbmQgKG9uZXMsIHZlY19vciAoeG9yMCwgeG9y
MSkpLAoJCQkgICAgdmVjX3hvciAoYXZnMCwgYXZnMSkpKTsKICAgIHZlY19zdCAodG1wLCBzdHJp
ZGUsIGRlc3QpOwp9CgoK


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-04-07  7:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-07  6:16 preprocessor/10323: The preprocessor consumes all the memory Neil Booth
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07  7:15 neil
2003-04-07  6:46 Zack Weinberg
2003-04-06 23:06 Zack Weinberg
2003-04-06 22:56 Neil Booth
2003-04-06 22:46 Zack Weinberg
2003-04-06 21:26 lu_zero

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).