http://llvm.org/bugs/show_bug.cgi?id=18978

            Bug ID: 18978
           Summary: initialize a large static array = clang oom?
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 12154
  --> http://llvm.org/bugs/attachment.cgi?id=12154&action=edit
code+sh

clang 3.3 is fine (although slow)
clang 3.4 will oom

[2632819.135797] Out of memory: Kill process 11919 (clang) score 848
or sacrifice child
[2632819.136017] Killed process 11919 (clang) total-vm:7024768kB,
anon-rss:6925660kB, file-rss:64kB

it boils down to a single line change:

static cache_entry_t cache[APPLY_CACHE_SIZE] = {{ 0 }};

will cause the oom (in 3.3 it will produce a pretty big object file, like 128M)

static cache_entry_t cache[APPLY_CACHE_SIZE];

will fix the oom,  the end effect is same, since static variables are
initialized to 0 anyway.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to