Jim & all

The attached patch should now be applied to llvm-gcc because the
corresponding REM patch for LLVM has been applied to CVS.  This should
show up in llvm-gcc subversion repository in the next 24 hours. If you
can't wait that long and you're updating to LLVM CVS Head, apply it to
your working copy of llvm-gcc now.

Thanks,

Reid.
Index: gcc/llvm-convert.cpp
===================================================================
--- gcc/llvm-convert.cpp	(revision 193)
+++ gcc/llvm-convert.cpp	(working copy)
@@ -558,7 +558,12 @@
   case RDIV_EXPR:      
     Result = EmitBinOp(exp, DestLoc, Instruction::FDiv);
     break;
-  case TRUNC_MOD_EXPR: Result = EmitBinOp(exp, DestLoc, Instruction::Rem);break;
+  case TRUNC_MOD_EXPR: 
+    if (TYPE_UNSIGNED(TREE_TYPE(exp)))
+      Result = EmitBinOp(exp, DestLoc, Instruction::URem);
+    else
+      Result = EmitBinOp(exp, DestLoc, Instruction::SRem);
+    break;
   case BIT_AND_EXPR:   Result = EmitBinOp(exp, DestLoc, Instruction::And);break;
   case BIT_IOR_EXPR:   Result = EmitBinOp(exp, DestLoc, Instruction::Or );break;
   case BIT_XOR_EXPR:   Result = EmitBinOp(exp, DestLoc, Instruction::Xor);break;
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to