[llvm-commits] CVS: gcc-3.4/gcc/llvm-expand.c

John Criswell criswell at cs.uiuc.edu
Tue Mar 2 14:20:02 PST 2004


Changes in directory gcc-3.4/gcc:

llvm-expand.c updated: 1.16 -> 1.17

---
Log message:

For array references, try to cast the integer reference into the proper
signed integer type that matches the machines pointer size.  This ensures
proper sign extension when the references are converted to LLVM longs
(i.e. 64 bits).

This is a fix for PR#268.

Regretably, this still doesn't fix the Homebrew Decompiler (hbd).
:(



---
Diffs of the changes:  (+4 -0)

Index: gcc-3.4/gcc/llvm-expand.c
diff -u gcc-3.4/gcc/llvm-expand.c:1.16 gcc-3.4/gcc/llvm-expand.c:1.17
--- gcc-3.4/gcc/llvm-expand.c:1.16	Fri Feb 27 23:06:31 2004
+++ gcc-3.4/gcc/llvm-expand.c	Tue Mar  2 14:19:36 2004
@@ -5085,6 +5085,10 @@
        */
       llvm_value *Op0 = llvm_expand_expr(Fn, TREE_OPERAND(exp, 0), 0);
       llvm_value *Op1 = llvm_expand_expr(Fn, TREE_OPERAND(exp, 1), 0);
+      if (Pmode == SImode)
+      {
+        Op1 = cast_if_type_not_equal(Fn, Op1, IntTy);
+      }
       Op1 = cast_if_type_not_equal(Fn, Op1, LongTy);
       /* FIXME: What do we do about bitfields here??? */
       





More information about the llvm-commits mailing list