http://llvm.org/bugs/show_bug.cgi?id=9756

           Summary: X86GenDAGISel.inc has code that depends on char
                    signedness
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


This is a snippet from CheckNodePredicate in X86GenDAGISel.inc:

  case 8: { // Predicate_i16immSExt8
    int64_t Imm = cast<ConstantSDNode>(Node)->getSExtValue();
 return Imm == (char)Imm; 
  }
  case 9: { // Predicate_i32immSExt8
    int64_t Imm = cast<ConstantSDNode>(Node)->getSExtValue();
 return Imm == (char)Imm; 
  }
  case 10: { // Predicate_i64immSExt8
    int64_t Imm = cast<ConstantSDNode>(Node)->getSExtValue();
 return Imm == (char)Imm; 
  }

Depending on whether char is signed or unsigned, a value of -1 in Imm may cause
the function to return true or false. That is, -funsigned-char / -fsigned-char
changes the behaviour of LLVM here.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to