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

runtime error: reference binding to null pointer of type 'const struct FloatType' #980

Closed
regehr opened this issue Nov 28, 2023 · 0 comments

Comments

@regehr
Copy link
Contributor

regehr commented Nov 28, 2023

regehr@john-home:~/tmp$ cat src.ll
source_filename = "M2"
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-linux-gnu"

define double @f(i64 %0) {
  %2 = icmp eq i64 %0, 0
  %3 = uitofp i1 %2 to double
  ret double %3
}
regehr@john-home:~/tmp$ cat tgt.ll
source_filename = "M2"
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-linux-gnu"

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
define double @f(i64 %0) local_unnamed_addr #0 {
arm_tv_entry:
  %a4_5 = icmp eq i64 %0, 0
  %a5_8 = select i1 %a4_5, i64 4607182418800017408, i64 0
  %a6_2 = bitcast i64 %a5_8 to double
  ret double %a6_2
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
regehr@john-home:~/tmp$ ~/alive2-regehr/build/alive-tv src.ll tgt.ll

----------------------------------------
define double @f(i64 %#0) {
#1:
  %#2 = icmp eq i64 %#0, 0
  %#3 = uitofp i1 %#2 to double
  ret double %#3
}
=>
define double @f(i64 %#0) nofree willreturn memory(none) {
arm_tv_entry:
  %a4_5 = icmp eq i64 %#0, 0
  %a5_8 = select i1 %a4_5, i64 4607182418800017408, i64 0
  %a6_2 = bitcast i64 %a5_8 to double
  ret double %a6_2
}
/home/regehr/alive2-regehr/ir/type.cpp:449:58: runtime error: reference binding to null pointer of type 'const struct FloatType'
regehr@john-home:~/tmp$ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant