http://llvm.org/bugs/show_bug.cgi?id=8279
Summary: const volatile bug
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Clang miscompiles the program below, it is not OK to optimize away the read
from g_1 in main after inlining func_1().
reg...@john-home:~$ clang -v
clang version 2.9 (trunk 115311)
Target: i386-pc-linux-gnu
Thread model: posix
reg...@john-home:~$ clang -O vol.c -S -o -
.file "vol.c"
.text
.globl main
.align 16, 0x90
.type main,@function
main:
pushl %ebp
movl %esp, %ebp
xorl %eax, %eax
popl %ebp
ret
.Ltmp0:
.size main, .Ltmp0-main
.type g_1,@object
.section .rodata.cst4,"aM",@progbits,4
.globl g_1
.align 4
g_1:
.long 1
.size g_1, 4
.section .note.GNU-stack,"",@progbits
reg...@john-home:~$ cat vol.c
const volatile int g_1 = 1;
static int func_1(void) {
return g_1;
}
int main (void)
{
func_1();
return 0;
}
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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