[LLVMbugs] [Bug 9756] New: X86GenDAGISel.inc has code that depends on char signedness

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 19 18:36:59 PDT 2011


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: unassignedbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu


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.



More information about the llvm-bugs mailing list