How does nvcc deal with constants?

const int a = 10;
if(a == 10) {
//Do X
} else {
//Do Y
}

I would have thought that in this case, the code would be rewritten to:
const int a = 10;
//Do X

Because we know at compile-time which if branch will execute, every time.
However, this is not the case during debugging. Is this not at all as trivial as I thought for the compiler? Or does it actually happen, but not when debugging information is written?

Can I somehow move this to Cuda Programming? Because it doesn’t belong in “Cuda Linux”. Can delete the thread and re-post it?

I reposted here: [url=“http://forums.nvidia.com/index.php?showtopic=99348”]http://forums.nvidia.com/index.php?showtopic=99348[/url] in the correct forum instead.