public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug translation/58087] New: Huge memory consumption with #pragma GCC optimize, __attribute__ and long output paths
@ 2013-08-05 13:00 manisandro at gmail dot com
  2014-01-18 16:18 ` [Bug middle-end/58087] " manisandro at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: manisandro at gmail dot com @ 2013-08-05 13:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58087

            Bug ID: 58087
           Summary: Huge memory consumption with #pragma GCC optimize,
                    __attribute__ and long output paths
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: translation
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manisandro at gmail dot com

Using gcc version 4.8.1 20130717 (Red Hat 4.8.1-5) (GCC)

Description:
Any code containing #pragma GCC optimize, lots of __attribute__(()) will result
in cc1 taking up huge amounts of memory _depending_ on the length of the output
path.

Test case:
$ for i in $(seq 1 10000); do echo -e "void __attribute__(()) fz$i();" >>
test.h; done

$ cat > test.c <<EOF
#pragma GCC optimize ("-O1")
#include "test.h"
int main(){ return 0; }
EOF

$ wget
https://gist.github.com/netj/526585/raw/9044a9972fd71d215ba034a38174960c1c9079ad/memusg
$ chmod +x memusg

$ mkdir a
$ ./memusg gcc -c -o a/test.o test.c
memusg: peak=485796

$ mkdir aaaaaaaaaaaaaaaaaaaaaaa
$ ./memusg gcc -c -o aaaaaaaaaaaaaaaaaaaaaaa/test.o test.c
memusg: peak=4827100

Observations:
- The "-O1" is not important, passing any other string to #pragma GCC optimize
(regardless of whether it is valid or invalid) will also trigger the issue
- As noted, the memory consumption depends on the length of the output path


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

* [Bug middle-end/58087] Huge memory consumption with #pragma GCC optimize, __attribute__ and long output paths
  2013-08-05 13:00 [Bug translation/58087] New: Huge memory consumption with #pragma GCC optimize, __attribute__ and long output paths manisandro at gmail dot com
@ 2014-01-18 16:18 ` manisandro at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: manisandro at gmail dot com @ 2014-01-18 16:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58087

Sandro Mani <manisandro at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|translation                 |middle-end
            Version|4.8.1                       |4.8.2

--- Comment #1 from Sandro Mani <manisandro at gmail dot com> ---
Still applies to 4.8.2. Changing component to a (hopefully) more relevant one.


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

end of thread, other threads:[~2014-01-18 16:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-05 13:00 [Bug translation/58087] New: Huge memory consumption with #pragma GCC optimize, __attribute__ and long output paths manisandro at gmail dot com
2014-01-18 16:18 ` [Bug middle-end/58087] " manisandro at gmail dot com

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).