public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63444] New: Compilation consumes 2.5G memory
@ 2014-10-02 18:07 bobby.prani at gmail dot com
  2015-03-29 12:30 ` [Bug c++/63444] cc1plus consumes 4G memory with -O0 manu at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: bobby.prani at gmail dot com @ 2014-10-02 18:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63444

            Bug ID: 63444
           Summary: Compilation consumes 2.5G memory
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bobby.prani at gmail dot com

Created attachment 33641
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33641&action=edit
pre-processed file

The compilation of the attached pre-processed file takes 2.5G memory. Not
exactly a regression since both 4.8 and 4.9 do the same. But may be an
interesting test case for optimizations.

$ g++ -std=c++11 -c  -fPIC -DNDEBUG -O3 -fno-strict-aliasing      -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64 test.i -o test.o


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

* [Bug c++/63444] cc1plus consumes 4G memory with -O0
  2014-10-02 18:07 [Bug c++/63444] New: Compilation consumes 2.5G memory bobby.prani at gmail dot com
@ 2015-03-29 12:30 ` manu at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: manu at gcc dot gnu.org @ 2015-03-29 12:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63444

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2014-10-05 00:00:00         |2015-3-29
            Summary|Compilation consumes 2.5G   |cc1plus consumes 4G memory
                   |memory                      |with -O0

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
With -O0 still 4GB

 phase lang. deferred    :  41.13 (30%) usr   2.03 (21%) sys  49.47 (29%) wall
1585647 kB (40%) ggc
 phase opt and generate  :  88.63 (65%) usr   6.52 (69%) sys 108.59 (65%) wall
2145756 kB (54%) ggc
 |overload resolution    :  13.91 (10%) usr   0.83 ( 9%) sys  16.31 (10%) wall 
710980 kB (18%) ggc
 garbage collection      :  28.49 (21%) usr   0.11 ( 1%) sys  32.96 (20%) wall 
     0 kB ( 0%) ggc
 template instantiation  :  26.31 (19%) usr   2.04 (22%) sys  32.37 (19%) wall
1620755 kB (40%) ggc
 expand                  :   2.97 ( 2%) usr   0.18 ( 2%) sys   3.65 ( 2%) wall 
247887 kB ( 6%) ggc
 integrated RA           :  10.56 ( 8%) usr   0.11 ( 1%) sys  12.25 ( 7%) wall 
956399 kB (24%) ggc
 TOTAL                 : 137.38             9.48           167.94           
4008619 kB
>From gcc-bugs-return-482161-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Mar 29 07:17:05 2015
Return-Path: <gcc-bugs-return-482161-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2173 invoked by alias); 29 Mar 2015 07:17:04 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 2103 invoked by uid 48); 29 Mar 2015 07:16:59 -0000
From: "nyh at math dot technion.ac.il" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/65616] New: libgobegin.a not compiled with -fPIC
Date: Sun, 29 Mar 2015 13:41:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: go
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: nyh at math dot technion.ac.il
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ian at airs dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc
Message-ID: <bug-65616-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg03305.txt.bz2
Content-length: 1498

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide616

            Bug ID: 65616
           Summary: libgobegin.a not compiled with -fPIC
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: nyh at math dot technion.ac.il
                CC: cmang at google dot com

When one tries to build a position-independent executable (PIE or shared
object) with gccgo, the final linking stage fails. For example:

$ gccgo -pie -fpie hello.go
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.9.2/libgobegin.a(go-main.o):
relocation R_X86_64_32 against `runtime_main' can not be used when making a
shared object; recompile with -fPIC

The problem is that libgobegin.a was not compiled with -fPIC, so the main() it
contains is not usable to produce a shared object or PIE. That could easily be
rectified - go-main.c should be compiled with -fPIC. The main() function is
obviously not performance sensitive, so there is no downside in compiling it
with -fPIC.

When I compile go-main.o myself with -fPIC, and do "gccgo -pie -fpic hello.go
go-main.o", things work correctly.

There are many reasons why someone might want to produce a PIE or shared
object. My personal interest is for the OSv operating system (http://osv.io),
which can run Linux executables, but only position-independent ones (because
OSv is a single-address-space operating system).


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

end of thread, other threads:[~2015-03-29  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-02 18:07 [Bug c++/63444] New: Compilation consumes 2.5G memory bobby.prani at gmail dot com
2015-03-29 12:30 ` [Bug c++/63444] cc1plus consumes 4G memory with -O0 manu at gcc dot gnu.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).