summary refs log tree commit diff
path: root/src/librustc_trans/base.rs
diff options
context:
space:
mode:
authorBrian Anderson <andersrb@gmail.com>2016-10-19 11:22:49 -0700
committerGitHub <noreply@github.com>2016-10-19 11:22:49 -0700
commitd4f39402a0c2c2b94ec0375cd7f7f6d7918113cd (patch)
tree0a3f7ab1668706d533e6692e8ce853c2aec4609a /src/librustc_trans/base.rs
parent3191fbae9da539442351f883bdabcad0d72efcb6 (diff)
parent2d493421cacc42d04e7626259cc08a51ef6c24cb (diff)
downloadrust-1.12.1.tar.gz
rust-1.12.1.zip
Merge pull request #37173 from brson/stable-next 1.12.1
[stable] Backports for 1.12.1
Diffstat (limited to 'src/librustc_trans/base.rs')
-rw-r--r--src/librustc_trans/base.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs
index c78cda75e82..479a6a2cac3 100644
--- a/src/librustc_trans/base.rs
+++ b/src/librustc_trans/base.rs
@@ -320,7 +320,16 @@ pub fn compare_scalar_types<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
                 _ => bug!("compare_scalar_types: must be a comparison operator"),
             }
         }
-        ty::TyFnDef(..) | ty::TyFnPtr(_) | ty::TyBool | ty::TyUint(_) | ty::TyChar => {
+        ty::TyBool => {
+            // FIXME(#36856) -- using `from_immediate` forces these booleans into `i8`,
+            // which works around some LLVM bugs
+            ICmp(bcx,
+                 bin_op_to_icmp_predicate(op, false),
+                 from_immediate(bcx, lhs),
+                 from_immediate(bcx, rhs),
+                 debug_loc)
+        }
+        ty::TyFnDef(..) | ty::TyFnPtr(_) | ty::TyUint(_) | ty::TyChar => {
             ICmp(bcx,
                  bin_op_to_icmp_predicate(op, false),
                  lhs,