Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvm-upgrade cannot distinguish between int tmp & uint tmp etc. #1628

Closed
npatil2 opened this issue Mar 14, 2007 · 1 comment
Closed

llvm-upgrade cannot distinguish between int tmp & uint tmp etc. #1628

npatil2 opened this issue Mar 14, 2007 · 1 comment
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag miscompilation

Comments

@npatil2
Copy link

npatil2 commented Mar 14, 2007

Bugzilla Link 1256
Resolution FIXED
Resolved on Mar 06, 2010 13:59
Version trunk
OS All

Extended Description

(Mis-upgradation. No warning issued.)

The following testcase should be self-explanatory... llvm-upgrade can't pick
the correct %tmp when both int %tmp and uint %tmp are defined. Similar problem
occurs with sbyte and ubyte.

Testcase: zxc.ll:
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
target triple = "i686-pc-linux-gnu"

implementation ; Functions:

void %_Z4func() {
entry:
%tmp = add int 0, 0
%tmp = add uint 1, 1
%tmp = add ubyte 1, 2
%tmp = add sbyte 2, 3
call void %f (int %tmp)
call void %g (ubyte %tmp)
ret void
}

declare void %f(int)
declare void %g(ubyte)

Output of $llvm-upgrade zxc.ll
; ModuleID = 'zxc.ll'
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"

implementation ; Functions:

define void @​_Z4func() {
entry:
%tmp = add i32 0, 0 ; [#uses=0]
%tmp.upgrd.1 = add i32 1, 1 ; [#uses=1]
%tmp.upgrd.2 = add i8 1, 2 ; [#uses=0]
%tmp.upgrd.3 = add i8 2, 3 ; [#uses=1]
call void @​f( i32 %tmp.upgrd.1 )
call void @​g( i8 %tmp.upgrd.3 )
ret void
}

declare void @​f(i32)

declare void @​g(i8)

Expected output:

; ModuleID = 'zxc.ll'
target datalayout = "e-p:32:32"
target triple = "i686-pc-linux-gnu"

implementation ; Functions:

define void @​_Z4func() {
entry:
%tmp = add i32 0, 0 ; [#uses=0]
%tmp.upgrd.1 = add i32 1, 1 ; [#uses=1]
%tmp.upgrd.2 = add i8 1, 2 ; [#uses=0]
%tmp.upgrd.3 = add i8 2, 3 ; [#uses=1]
call void @​f( i32 %tmp ) ; XXX
call void @​g( i8 %tmp.upgrd.2 ) ; XXX
ret void
}

declare void @​f(i32)

declare void @​g(i8)

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla llvm-tools All llvm tools that do not have corresponding tag miscompilation
Projects
None yet
Development

No branches or pull requests

2 participants