LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 4118 - Register allocator not respecting early clobber on inline asm
Summary: Register allocator not respecting early clobber on inline asm
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Evan Cheng
URL:
Keywords:
: 6539 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-01 17:52 PDT by Eli Friedman
Modified: 2010-06-24 19:50 PDT (History)
7 users (show)

See Also:
Fixed By Commit(s):


Attachments
Testcase (bitcode) (60.82 KB, application/octet-stream)
2009-05-01 17:52 PDT, Eli Friedman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Friedman 2009-05-01 17:52:21 PDT
Created attachment 2916 [details]
Testcase (bitcode)

Testcase attached; to reproduce, use the following command, at least on my computer:

llc x2.bc -o - | fgrep "REGSA: %eax %eax"

I'm on Ubuntu Linux on x86-32 using a Core Duo (hopefully, that doesn't make a difference).

The relevant inline asm is as follows:
	%0 = call i32 asm sideeffect "REGSA: $0 $1 $2", "=&{ax},r,r,~{cx},~{bx},~{dx},~{si},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %arrayidx.i.i, %struct.CABACContext* %tmp3.i.i) nounwind		; <i32> [#uses=1]

Unfortunately, it's difficult to simplify a testcase like this; the construct in question isn't generally broken, just not working in this particular case.

Testcase reduced from libavcodec/h264.c in ffmpeg.
Comment 1 Evan Cheng 2009-07-20 16:20:18 PDT
This is totally being ignored by me. :-( Dale, do you have a bit of time to dig into this?
Comment 2 Dale Johannesen 2009-07-20 16:26:35 PDT
Not now, I'm going on vacation as of tomorrow, remember?

Comment 3 Evan Cheng 2009-07-20 17:50:58 PDT
Ok, when you get back then. :-) Thx.
Comment 4 Chris Lattner 2009-09-18 17:07:07 PDT
Dale, any update? This may be related to PR 4964 where two outputs are getting assigned to the same register.
Comment 5 Dale Johannesen 2009-09-18 18:28:48 PDT
No, I've been busy with Apple bugs.  Maybe next week if Evan thinks this is more important than the Apple bugs in my queue.
Comment 6 Dale Johannesen 2009-09-19 19:40:35 PDT
This is not the same as 4964; I fixed that one, which was simpler than this one.
Comment 7 Jakob Stoklund Olesen 2010-06-03 09:01:50 PDT
*** Bug 6539 has been marked as a duplicate of this bug. ***
Comment 8 Eli Friedman 2010-06-13 17:38:28 PDT
Any update?  This has been affecting ffmpeg for ages.
Comment 9 Dale Johannesen 2010-06-24 19:50:38 PDT
106816 should fix this.