Skip to content

ICE: Global initializer should be constant! #2013

@isanbard

Description

@isanbard
Bugzilla Link 1641
Resolution FIXED
Resolved on Mar 06, 2010 14:07
Version trunk
OS All
CC @asl

Extended Description

This program:

struct A {
unsigned long l;
};

static void bork() {
const unsigned long vcgt = 'vcgt';
struct A a = { vcgt };
}
void foo() {
bork();
}

Compiles under GCC but gives this error for LLVM-GCC:

$ llvm-gcc -arch ppc -Os -c testcase.i
Assertion failed: ((TREE_CONSTANT(DECL_INITIAL(decl)) || TREE_CODE(DECL_INITIAL(decl)) == STRING_CST) && "Global initializer should be constant!"), function emit_global_to_llvm, file ../../llvm-gcc-4.0.src/gcc/llvm-backend.cpp, line 777.
testcase.i: In function 'foo':
testcase.i:9: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://llvm.org/bugs for instructions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillallvm-toolsAll llvm tools that do not have corresponding tag

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions