Compilation error in phase Code_Expansion

I have a program in CUDA. compilation with v2.3 and v3.0 beta both failed, giving the same error msg about phase Code_Expansion. Disabling optimization level to O0 does not work. Compilation w/ device emulation seems to have succeeded. What should I do first? Check correctness w/ emulation mode first? Thanks.