[LLVMbugs] [Bug 10858] New: Optimizer removes call to relevant function
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Sep 4 11:47:19 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10858
Summary: Optimizer removes call to relevant function
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: dwelch at dwelch.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=7219)
--> (http://llvm.org/bugs/attachment.cgi?id=7219)
simple source files needed to reproduce this problem
See attached.
show.c has a function get_onechar that calls uart_getc(). uart_getc() for
debugging includes an infinite loop. the call to uart_getc() appears to be
optimized completely out and the code continues as if it had never happened.
00000000 <get_onechar>:
0: b510 push {r4, lr}
2: 4604 mov r4, r0
4: 20ff movs r0, #255 ; 0xff
6: 4020 ands r0, r4
8: 280a cmp r0, #10
Interestingly I added a function called fun() which also calls uart_getc() and
this one appears to have been implemented with a call to uart_putc()
00000022 <fun>:
22: b500 push {lr}
24: 4601 mov r1, r0
26: 2007 movs r0, #7
28: 0740 lsls r0, r0, #29
2a: f7ff fffe bl 0 <PUT32>
2e: bd00 pop {pc}
Without optimization everything looks fine.
Tried with both a near trunk (will svn up and try again today) as well as
release 2.9
Dont actually need to assemble and disassemble with binutils as the Makefile
does, the problem can be seen in the .s file.
running ubuntu 10.4LTS 64 bit
Linux dwelch-desktop 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29 21:07:13 UTC
2011 x86_64 GNU/Linux
Low Level Virtual Machine (http://llvm.org/):
llvm version 3.0svn
Optimized build with assertions.
Built Aug 31 2011 (22:39:17).
Host: x86_64-unknown-linux-gnu
Host CPU: amdfam10
llvm# svn info
Path: .
URL: http://llvm.org/svn/llvm-project/llvm/trunk
Repository Root: http://llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 138935
Node Kind: directory
Schedule: normal
Last Changed Author: evancheng
Last Changed Rev: 138934
Last Changed Date: 2011-08-31 21:45:00 -0400 (Wed, 31 Aug 2011)
llvm/tools/clang# svn info
Path: .
URL: http://llvm.org/svn/llvm-project/cfe/trunk
Repository Root: http://llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 138935
Node Kind: directory
Schedule: normal
Last Changed Author: dgregor
Last Changed Rev: 138935
Last Changed Date: 2011-08-31 22:09:07 -0400 (Wed, 31 Aug 2011)
--
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.
More information about the llvm-bugs
mailing list