This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/21410] Infinite memory usage in preprocessor
- From: "belyshev at depni dot sinp dot msu dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2005 04:39:40 -0000
- Subject: [Bug preprocessor/21410] Infinite memory usage in preprocessor
- References: <20050506020514.21410.lucier@math.purdue.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From belyshev at depni dot sinp dot msu dot ru 2005-05-06 04:39 -------
gamdit.h:2426:
#define
___FIXADDP(x,y)((((x)^(y))&___FIX(___MIN_FIX))<=(((y)^((x)+(y)))&___FIX(___MIN_FIX))?___FIXADD(x,y):___FAL)
test2.c:3500:
___SET_R2(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(
___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(
___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___FIXADDP(___STK(-25),___STK(-24)),
___STK(-23)),___STK(-22)),___STK(-21)),___STK(-20)),___STK(-19)),___STK(-18)
...
These cute macros are trying to expand into a 3^35 == 5E16 nodes, so no wonder
that gcc is out of memory. Here is small testcase demonstrating same "problem":
#define A(x) x;x;x;x;
A(A(A(A(A(A(A(A(A(A(A(A(A(A(A(A(0))))))))))))))))
--
What |Removed |Added
----------------------------------------------------------------------------
GCC build triplet|x86_64-unknown-linux-gnu |
GCC host triplet|x86_64-unknown-linux-gnu |
GCC target triplet|x86_64-unknown-linux-gnu |
Keywords| |memory-hog
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21410