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 1082 - llvm-upgrade can fail on names with unspecified or defaulted type
Summary: llvm-upgrade can fail on names with unspecified or defaulted type
Status: RESOLVED FIXED
Alias: None
Product: tools
Classification: Unclassified
Component: llvm-upgrade (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Reid Spencer
URL:
Keywords: compile-fail
Depends on:
Blocks:
 
Reported: 2007-01-05 23:14 PST by Reid Spencer
Modified: 2010-02-22 12:55 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reid Spencer 2007-01-05 23:14:52 PST
Unfortunately, the current algorithm in llvm-upgrade depends on each value being
preceded by its type. However, with signedness elimination, the following is
quite possible:

    %tmp7360 = bitcast ubyte %tmp7354 to sbyte
    %tmp7361 = sub ubyte 0, %tmp7360

llvm-upgrade current translates this to:

    %tmp7360.s = bitcast i8 %x.u to i8
    %tmp7361.u = sub i8 0, %tmp7360.u

%tmp7360.u in the sub instruction should be %tmp7360.s, the intended value.
However, since the first argument to sub is ubyte, it gets the .u suffix.

llvm-as rightly declares that %tmp7360.u is undefined in the i8 type plane.
Comment 1 Reid Spencer 2007-01-05 23:17:39 PST
Test case for this and related things:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070101/042122.html
Comment 2 Reid Spencer 2007-01-05 23:17:49 PST
Mine
Comment 3 Reid Spencer 2007-01-12 18:27:24 PST
This is related to bug 645. They both require that llvm-upgrade get smarter
about what its parsing, possibly deferring output until everything is resolved.
Comment 4 Reid Spencer 2007-01-26 02:35:48 PST
With the llvm-upgrade, this is now fixed.

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070122/043254.html

The XFAIL from the test case has been removed and it passes.