[Ecls-list] generation of invalid C code (type cast)

Pascal J. Bourguignon pjb at informatimago.com
Thu Jun 3 00:50:56 UTC 2010


When compiling raiden-decipher (from
http://git.informatimago.com/viewgit/?a=viewblob&p=public/lisp&h=728fe900a2cbf2a6dab2f7bbfcca92a6f36645a4&hb=5b22e7eab73f004ef00d478a119d5f4582174018&f=common-lisp/raiden.lisp
), ecl-10.4.2 (obtained from git yesterday) fails with:

;;; Emitting code for AUTO-TEST.
;;; Note:
;;;   Invoking external command:
;;;   gcc "-I/home/pjb/opt-planner-ecl/include/"  -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC  -D_THREAD_SAFE -Dlinux -O -w -c "/home/pjb/.fasls/ecl-10.4.2-linux-unknown/data/lisp/packages/com/informatimago/common-lisp/OBJ-ECL-1042-X86_64/raiden.c" -o "/home/pjb/.fasls/ecl-10.4.2-linux-unknown/data/lisp/packages/com/informatimago/common-lisp/OBJ-ECL-1042-X86_64/raiden.o"
;;; /home/pjb/.fasls/ecl-10.4.2-linux-unknown/data/lisp/packages/com/informatimago/common-lisp/OBJ-ECL-1042-X86_64/raiden.c: In function ‘L4raiden_decipher’:
/home/pjb/.fasls/ecl-10.4.2-linux-unknown/data/lisp/packages/com/informatimago/common-lisp/OBJ-ECL-1042-X86_64/raiden.c:235: error: lvalue required as left operand of assignment
[pjb at kuiper :0.0 lisp]$ 

The line 235 is:

	V10= ((cl_fixnum)(V6)->vector.self.b32[V11]= V12);}}

and the problem is that a typecast is not a lvalue.

The source expression is:

           (setf (aref sks i)
                 (setf (aref k (mod i 4))
                       (32bit (+ (aref k 0) (aref k 1)
                                 (logxor (+ (aref k 2) (aref k 3))
                                         (32bit (ash (aref k 0)
                                                     (mod (aref k 2) 32))))))))

The vectors are declared to contain (unsigned-bit 32) elements, and 
the host is a 64-bit linux:
Linux kuiper 2.6.32-xen-r1-nfs #6 SMP Tue May 18 23:25:57 CEST 2010 x86_64 Intel(R) Core(TM) i7 CPU 950 @ 3.07GHz GenuineIntel GNU/Linux

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/





More information about the ecl-devel mailing list