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

Dimitry Andric <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |INVALID

--- Comment #1 from Dimitry Andric <[email protected]> ---
I do not think this is a problem in clang: the error happens for me with gcc
4.2 (in the FreeBSD base system) and the gcc 4.7 and gcc 4.8 ports too.

The problem is that you are creating three arrays of 100 million doubles, which
together take up 2.4 billion bytes in the text segment.  This is too large for
the medium memory model, which only supports up to 2GiB in the text segment.

The reason the error disappears if you use -O1 or higher, is that clang
optimizes away two of the arrays.  At -O0, the assembly has:

        .type   a,@object               # @a
        .local  a
        .comm   a,800000000,16
        .type   b,@object               # @b
        .local  b
        .comm   b,800000000,16
        .type   c,@object               # @c
        .local  c
        .comm   c,800000000,16

At -O1, this becomes just:

        .type   a,@object               # @a
        .local  a
        .comm   a,800000000,16

and then the text segment does not become too big.  I tried gcc 4.2, 4.7 and
4.8 with -O1 through -O3, but no combination seems to be able to optimize away
the b and c arrays, and none of the resulting object files could be linked into
an executable.

If you cannot get the original program to link using -mcmodel=large, please
re-open this bug.  Otherwise, file a FreeBSD PR against the benchmarks/stream
port.

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