Skip to content

-O1 compilation uses all memory and fails on 32- and 64-bit Ubuntu 10.10 installs #9051

@llvmbot

Description

@llvmbot
Bugzilla Link 8679
Resolution FIXED
Resolved on Nov 30, 2010 14:23
Version 2.8
OS Linux
Attachments GPLed C99 code after clang -E, fails with -O1, Shortened C89 code, fails with -O1, Further shortened C89 code, fails with -O1
Reporter LLVM Bugzilla Contributor
CC @lattner

Extended Description

clang -c -o /dev/null naco_img_jitter_cpp.c

succeeds in about 0.3s. However,

clang -c -o /dev/null naco_img_jitter_cpp.c -O1

will run and allocate memory via brk() and later also mmap()
until mmap() returns ENOMEM and the compilation fails.

The problem also occurs with -O2.

The system runs 64-bit Ubuntu 10.10 with

$ clang --version
clang version 2.8 (branches/release_28)
Target: x86_64-pc-linux-gnu
Thread model: posix

The problem is also present on a 32-bit Ubuntu 10.10 with

$ clang --version
clang version 2.8 (branches/release_28)
Target: i386-pc-linux-gnu
Thread model: posix

The attached source code example has been generated with clang -E from GPL C99 source code that compiles and runs as expected with various versions of gcc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions