Before I file a bug, I thought I'd check to make sure something hasn't
changed. Stacker used to work in 1.2, now it fails on six tests. All six
tests pertain to use of the SetLT, SetGT, SetLE, and SetGE SetCondInst.
In my test programs they all fail, regardless of the values.
The *only* thing I've done to Stacker is to change the base type
involved in the comparison from int to long. Is there something
"different" about the comparison of longs?
The code generated by Stacker Compiler is like:
setle long %11, %16 ; <bool>:0 [#uses=1]
cast bool %0 to long ; <long>:24 [#uses=1]
store long %24, long* %4
The value stored into %4 is later retrieved and compared against zero.
That test always fails if setle, setge, setlt, or setgt is used.
However, it works correctly for seteq, and setne!
Perhaps the cast from bool to long doesn't work the same as for bool
to int? Should it?
I've attached the full test program in case you want to investigate.
I'm going to try and reduce the test case because I suspect something
is broken in LLVM that only shows up in Stacker's usage. I'll let you
know what I find. Please let me know if the above sounds like a known
problem or usage issue.
Thanks,
Reid.
-------------- next part --------------
%_stack_ = linkonce global [1024 x long] zeroinitializer ; <[1024 x
long]*> [#uses=12]
%_index_ = linkonce global long 0 ; <long*> [#uses=36]
%_str_format_ = linkonce constant [3 x sbyte] c"%s\00" ; <[3 x
sbyte]*> [#uses=0]
%_in_str_format_ = linkonce constant [5 x sbyte] c" %as\00" ; <[5
x sbyte]*> [#uses=0]
%_num_format_ = linkonce constant [3 x sbyte] c"%d\00" ; <[3 x
sbyte]*> [#uses=0]
%_in_num_format_ = linkonce constant [4 x sbyte] c" %d\00" ; <[4 x
sbyte]*> [#uses=0]
%_chr_format_ = linkonce constant [3 x sbyte] c"%c\00" ; <[3 x
sbyte]*> [#uses=0]
%_in_chr_format_ = linkonce constant [4 x sbyte] c" %c\00" ; <[4 x
sbyte]*> [#uses=0]
implementation ; Functions:
declare int %printf(sbyte*, ...)
declare int %scanf(sbyte*, ...)
declare void %exit(int)
declare void %success()
declare void %failure()
void %phase2() {
int:
load long* %_index_ ; <long>:0 [#uses=1]
cast long 1 to long ; <long>:1 [#uses=1]
add long %0, %1 ; <long>:2 [#uses=1]
store long %2, long* %_index_
load long* %_index_ ; <long>:3 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %3 ; <long*>:0
[#uses=1]
cast long 49 to long ; <long>:4 [#uses=1]
store long %4, long* %0
br label %int1
int1: ; preds = %int
load long* %_index_ ; <long>:5 [#uses=1]
cast long 1 to long ; <long>:6 [#uses=1]
add long %5, %6 ; <long>:7 [#uses=1]
store long %7, long* %_index_
load long* %_index_ ; <long>:8 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %8 ; <long*>:1
[#uses=1]
cast long 49 to long ; <long>:9 [#uses=1]
store long %9, long* %1
br label %LE
LE: ; preds = %int1
load long* %_index_ ; <long>:10 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %10 ; <long*>:2
[#uses=1]
load long* %2 ; <long>:11 [#uses=1]
load long* %_index_ ; <long>:12 [#uses=1]
cast long 1 to long ; <long>:13 [#uses=1]
sub long %12, %13 ; <long>:14 [#uses=1]
store long %14, long* %_index_
load long* %_index_ ; <long>:15 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %15 ; <long*>:3
[#uses=1]
load long* %3 ; <long>:16 [#uses=1]
load long* %_index_ ; <long>:17 [#uses=1]
cast long 1 to long ; <long>:18 [#uses=1]
sub long %17, %18 ; <long>:19 [#uses=1]
store long %19, long* %_index_
setle long %11, %16 ; <bool>:0 [#uses=1]
load long* %_index_ ; <long>:20 [#uses=1]
cast long 1 to long ; <long>:21 [#uses=1]
add long %20, %21 ; <long>:22 [#uses=1]
store long %22, long* %_index_
load long* %_index_ ; <long>:23 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %23 ; <long*>:4
[#uses=1]
cast bool %0 to long ; <long>:24 [#uses=1]
store long %24, long* %4
br label %if
if: ; preds = %LE
load long* %_index_ ; <long>:25 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %25 ; <long*>:5
[#uses=1]
load long* %5 ; <long>:26 [#uses=1]
load long* %_index_ ; <long>:27 [#uses=1]
cast long 1 to long ; <long>:28 [#uses=1]
sub long %27, %28 ; <long>:29 [#uses=1]
store long %29, long* %_index_
setne long %26, 0 ; <bool>:1 [#uses=1]
br bool %1, label %then, label %else
then: ; preds = %if
call void %success( )
br label %endif
else: ; preds = %if
call void %failure( )
br label %endif
endif: ; preds = %then, %else
ret void
}
void %_MAIN_() {
int:
load long* %_index_ ; <long>:0 [#uses=1]
cast long 1 to long ; <long>:1 [#uses=1]
add long %0, %1 ; <long>:2 [#uses=1]
store long %2, long* %_index_
load long* %_index_ ; <long>:3 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %3 ; <long*>:0
[#uses=1]
cast long 49 to long ; <long>:4 [#uses=1]
store long %4, long* %0
br label %int1
int1: ; preds = %int
load long* %_index_ ; <long>:5 [#uses=1]
cast long 1 to long ; <long>:6 [#uses=1]
add long %5, %6 ; <long>:7 [#uses=1]
store long %7, long* %_index_
load long* %_index_ ; <long>:8 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %8 ; <long*>:1
[#uses=1]
cast long 7 to long ; <long>:9 [#uses=1]
store long %9, long* %1
br label %LE
LE: ; preds = %int1
load long* %_index_ ; <long>:10 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %10 ; <long*>:2
[#uses=1]
load long* %2 ; <long>:11 [#uses=1]
load long* %_index_ ; <long>:12 [#uses=1]
cast long 1 to long ; <long>:13 [#uses=1]
sub long %12, %13 ; <long>:14 [#uses=1]
store long %14, long* %_index_
load long* %_index_ ; <long>:15 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %15 ; <long*>:3
[#uses=1]
load long* %3 ; <long>:16 [#uses=1]
load long* %_index_ ; <long>:17 [#uses=1]
cast long 1 to long ; <long>:18 [#uses=1]
sub long %17, %18 ; <long>:19 [#uses=1]
store long %19, long* %_index_
setle long %11, %16 ; <bool>:0 [#uses=1]
load long* %_index_ ; <long>:20 [#uses=1]
cast long 1 to long ; <long>:21 [#uses=1]
add long %20, %21 ; <long>:22 [#uses=1]
store long %22, long* %_index_
load long* %_index_ ; <long>:23 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %23 ; <long*>:4
[#uses=1]
cast bool %0 to long ; <long>:24 [#uses=1]
store long %24, long* %4
br label %if
if: ; preds = %LE
load long* %_index_ ; <long>:25 [#uses=1]
getelementptr [1024 x long]* %_stack_, long 0, long %25 ; <long*>:5
[#uses=1]
load long* %5 ; <long>:26 [#uses=1]
load long* %_index_ ; <long>:27 [#uses=1]
cast long 1 to long ; <long>:28 [#uses=1]
sub long %27, %28 ; <long>:29 [#uses=1]
store long %29, long* %_index_
setne long %26, 0 ; <bool>:1 [#uses=1]
br bool %1, label %then, label %else
then: ; preds = %if
call void %phase2( )
br label %endif
else: ; preds = %if
call void %failure( )
br label %endif
endif: ; preds = %then, %else
ret void
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testing.bc
Type: application/octet-stream
Size: 832 bytes
Desc: not available
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20040509/d0855957/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20040509/d0855957/attachment.sig>