Bug 55176 - [4.8 Regression] Out of memory during Chromium build
Summary: [4.8 Regression] Out of memory during Chromium build
Status: RESOLVED DUPLICATE of bug 55191
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-02 05:37 UTC by Markus Trippelsdorf
Modified: 2012-11-05 21:05 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
testcase (88.10 KB, application/octet-stream)
2012-11-02 05:37 UTC, Markus Trippelsdorf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2012-11-02 05:37:51 UTC
Created attachment 28595 [details]
testcase

If one compiles the attached testcase with "-02" or higher,
cc1plus will quickly run out of memory and eventually be killed
by the OOM killer.

 % g++ -O2 -c exit.ii
g++: internal compiler error: Killed (program cc1plus)
Comment 1 Markus Trippelsdorf 2012-11-02 07:18:00 UTC
Reduced:

class Sandbox
{
    void sandbox_exit ();
    struct A
    {
        int write ();
    };
    void die ();
};
int a;
void
Sandbox::sandbox_exit ()
{
    A b;
    while (b.write () && 1)
        if (a)
            die ();
    for (;;);
}
Comment 2 Markus Trippelsdorf 2012-11-02 08:09:51 UTC
This only happens when gcc was lto/profiledbootstraped.
Looks like it gets miscompiled in this case.
Comment 3 Markus Trippelsdorf 2012-11-02 08:37:08 UTC
(In reply to comment #2)
> This only happens when gcc was lto/profiledbootstraped.
> Looks like it gets miscompiled in this case.

Turned out that "--enable-checking=release" is enough to trigger this bug.

 % ~/gcc/configure --disable-bootstrap --disable-werror --disable-multilib --enable-languages=c,c++ --enable-checking=release
 % make
Comment 4 Markus Trippelsdorf 2012-11-02 08:52:39 UTC
Started with r193047:

commit 9ccd9ece034984af0e6a775fdfb51b98a7029a84
Author: steven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Oct 31 21:37:10 2012 +0000

    gcc/
        PR tree-optimization/55018
Comment 5 Markus Trippelsdorf 2012-11-02 15:13:48 UTC
Gcc is spinning in compute_antic (tree-ssa-pre.c:2507) calling
bitmap_set_new() until OOM:

#0  _int_malloc (av=0x7ffff794d600 <main_arena>, bytes=2408) at malloc.c:3694
#1  0x00007ffff7661700 in __GI___libc_malloc (bytes=2408) at malloc.c:2859
#2  0x0000000000cbc938 in xmalloc (size=<optimized out>) at /home/markus/gcc/libiberty/xmalloc.c:147
#3  0x000000000060b561 in pool_alloc (pool=0x11a51e0) at /home/markus/gcc/gcc/alloc-pool.c:282
#4  0x0000000000936c00 in bitmap_set_new () at /home/markus/gcc/gcc/tree-ssa-pre.c:606
#5  0x000000000094065c in compute_antic_aux (block_has_abnormal_pred_edge=<optimized out>, block=0x7ffff73d4d00) at /home/markus/gcc/gcc/tree-ssa-pre.c:2161
#6  compute_antic () at /home/markus/gcc/gcc/tree-ssa-pre.c:2507
#7  do_pre () at /home/markus/gcc/gcc/tree-ssa-pre.c:4709
Comment 6 Markus Trippelsdorf 2012-11-05 21:05:07 UTC
dup

*** This bug has been marked as a duplicate of bug 55191 ***