From: Guillermo J. Rozas Date: Wed, 17 Nov 1993 05:22:39 +0000 (+0000) Subject: Patch BYTE-OFFSET-ADDRESS rules to avoid warnings and errors from an X-Git-Tag: 20090517-FFI~7492 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=bb265b21c00b8a51cb4d50d3c3c9864661c8dad8;p=mit-scheme.git Patch BYTE-OFFSET-ADDRESS rules to avoid warnings and errors from an implicit cast. --- diff --git a/v7/src/compiler/machines/C/rules1.scm b/v7/src/compiler/machines/C/rules1.scm index ed3a28466..9ca4cf5da 100644 --- a/v7/src/compiler/machines/C/rules1.scm +++ b/v7/src/compiler/machines/C/rules1.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: rules1.scm,v 1.5 1993/10/30 12:58:11 gjr Exp $ +$Id: rules1.scm,v 1.6 1993/11/17 05:22:39 gjr Exp $ Copyright (c) 1992-1993 Massachusetts Institute of Technology @@ -150,14 +150,26 @@ MIT in each case. |# (lambda (base index target) (LAP ,target " = &" ,base "[" ,index "];\n\t")))) +;; This rule is not written in the obvious way (commented out) because +;; it is used by the code generator to bump closures. Sometimes the +;; target is the value register (type scheme object) and the obvious +;; code would imply an implicit cast from pointer to integer, which +;; some compilers (e.g. -std1 on alpha) do not like. + (define-rule statement (ASSIGN (REGISTER (? target)) (BYTE-OFFSET-ADDRESS (REGISTER (? source)) (MACHINE-CONSTANT (? offset)))) + #| (standard-unary-conversion source 'CHAR* target 'CHAR* (lambda (source target) - (LAP ,target " = &" ,source "[" ,offset "];\n\t")))) + (LAP ,target " = &" ,source "[" ,offset "];\n\t"))) + |# + (standard-unary-conversion + source 'LONG target 'ULONG + (lambda (source target) + (LAP ,target " = ((unsigned long) (" ,base " + " ,offset "));\n\t")))) (define-rule statement (ASSIGN (REGISTER (? target))