public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/19411] New: Simple program causes gcc to run out of memory
@ 2005-01-12 22:55 gcc-bugzilla at gcc dot gnu dot org
2005-01-12 23:07 ` [Bug preprocessor/19411] " pinskia at gcc dot gnu dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2005-01-12 22:55 UTC (permalink / raw)
To: gcc-bugs
A simple program causes gcc to use inordinate amounts of memory
and finally crash.
Environment:
System: Linux glauke 2.6.8-powerpc #1 Sun Oct 3 13:22:21 CEST 2004 ppc GNU/Linux
Architecture: ppc
host: powerpc-unknown-linux-gnu
build: powerpc-unknown-linux-gnu
target: powerpc-unknown-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr --libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --program-suffix=-3.4 --enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk --disable-multilib --disable-softfloat powerpc-linux
How-To-Repeat:
Compile this program as follows:
gcc-3.4 -maltivec prog.c
prog.c follows:
#include <altivec.h>
vector float foo(vector float a)
{
return vec_add(a,
vec_add(a,
vec_add(a,
vec_add(a, a))));
}
------- Additional Comments From athena at fftw dot org 2005-01-12 22:55 -------
Fix:
Declare explicit temporary variables for the intermediate results.
--
Summary: Simple program causes gcc to run out of memory
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: athena at fftw dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: powerpc-unknown-linux-gnu
GCC host triplet: powerpc-unknown-linux-gnu
GCC target triplet: powerpc-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug preprocessor/19411] Simple program causes gcc to run out of memory
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
@ 2005-01-12 23:07 ` pinskia at gcc dot gnu dot org
2005-02-07 20:15 ` amodra at bigpond dot net dot au
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-12 23:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-12 23:07 -------
This is the preprocessor f'ing up. The macros are complex which cause the problem, I might be able
get a self contained example later on.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|c |preprocessor
Keywords| |memory-hog
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug preprocessor/19411] Simple program causes gcc to run out of memory
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
2005-01-12 23:07 ` [Bug preprocessor/19411] " pinskia at gcc dot gnu dot org
@ 2005-02-07 20:15 ` amodra at bigpond dot net dot au
2005-02-08 18:53 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-02-07 20:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From amodra at bigpond dot net dot au 2005-02-07 06:58 -------
I wouldn't blame the preprocessor. The macros in altivec.h for C support have
multiple occurences of their arguments. __builtin_choose_expr only evaluates
one occurence, but that doesn't stop the preprocessor *substituting* the macro
args multiple times.
vec_add (a, a) expands to 8006 chars,
vec_add (a, vec_add (a, a)) expands to 321430
vec_add (1, vec_add (a, vec_add (a, a))) expands to 12231542
and I didn't even try four levels.
Perhaps this comment in altivec.h explains it..
/* "... and so I think no man in a century will suffer as greatly as
you will." */
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |aldyh at redhat dot com
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-02-07 06:58:47
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug preprocessor/19411] Simple program causes gcc to run out of memory
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
2005-01-12 23:07 ` [Bug preprocessor/19411] " pinskia at gcc dot gnu dot org
2005-02-07 20:15 ` amodra at bigpond dot net dot au
@ 2005-02-08 18:53 ` pinskia at gcc dot gnu dot org
2005-02-16 6:42 ` [Bug target/19411] " amodra at bigpond dot net dot au
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-02-08 18:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-02-08 13:27 -------
*** Bug 19821 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pochini at shiny dot it
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/19411] Simple program causes gcc to run out of memory
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-02-08 18:53 ` pinskia at gcc dot gnu dot org
@ 2005-02-16 6:42 ` amodra at bigpond dot net dot au
2005-05-06 6:22 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: amodra at bigpond dot net dot au @ 2005-02-16 6:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From amodra at bigpond dot net dot au 2005-02-16 01:03 -------
Changing to target since this is due to Aldy's altivec.h implementation.
--
What |Removed |Added
----------------------------------------------------------------------------
Component|preprocessor |target
Known to fail| |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/19411] Simple program causes gcc to run out of memory
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-02-16 6:42 ` [Bug target/19411] " amodra at bigpond dot net dot au
@ 2005-05-06 6:22 ` pinskia at gcc dot gnu dot org
2005-05-25 22:21 ` pinskia at gcc dot gnu dot org
2005-09-07 0:25 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-06 6:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-06 06:22 -------
Fixed in 4.1.0 and above by:
2005-05-02 Paolo Bonzini <bonzini@gnu.org>
* c-common.c (resolve_overloaded_builtin): Forward to target
hook for BUILT_IN_MD built-ins.
....
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/19411] Simple program causes gcc to run out of memory
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-05-06 6:22 ` pinskia at gcc dot gnu dot org
@ 2005-05-25 22:21 ` pinskia at gcc dot gnu dot org
2005-09-07 0:25 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-25 22:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-25 22:14 -------
*** Bug 21758 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pluto at agmk dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/19411] Simple program causes gcc to run out of memory
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-05-25 22:21 ` pinskia at gcc dot gnu dot org
@ 2005-09-07 0:25 ` pinskia at gcc dot gnu dot org
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-07 0:25 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-07 00:25 -------
*** Bug 23759 has been marked as a duplicate of this bug. ***
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |Daniel dot Davies at xerox
| |dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19411
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-09-07 0:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12 22:55 [Bug c/19411] New: Simple program causes gcc to run out of memory gcc-bugzilla at gcc dot gnu dot org
2005-01-12 23:07 ` [Bug preprocessor/19411] " pinskia at gcc dot gnu dot org
2005-02-07 20:15 ` amodra at bigpond dot net dot au
2005-02-08 18:53 ` pinskia at gcc dot gnu dot org
2005-02-16 6:42 ` [Bug target/19411] " amodra at bigpond dot net dot au
2005-05-06 6:22 ` pinskia at gcc dot gnu dot org
2005-05-25 22:21 ` pinskia at gcc dot gnu dot org
2005-09-07 0:25 ` pinskia at gcc dot gnu dot org
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).