[llvm-commits] [llvm-gcc-4.2] r61128 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Evan Cheng evan.cheng at apple.com
Mon Dec 22 01:27:49 PST 2008



On Dec 19, 2008, at 5:38 PM, Rafael Espindola <espindola at google.com>  
wrote:

> 2008/12/17 Evan Cheng <evan.cheng at apple.com>:
>> Author: evancheng
>> Date: Wed Dec 17 01:37:53 2008
>> New Revision: 61128
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=61128&view=rev
>> Log:
>> If this input operand is matching an output operand, e.g. '0',  
>> check if this is something that llvm supports. If the operand types  
>> are different, then emit an error if 1) one of the types is not  
>> integer, 2) if size of input type is larger than the output type.  
>> If the size of the integer input size is smaller than the integer  
>> output type, then cast it to the larger type and shift the value if  
>> the target is big endian.
>
>
> This broke FD_SET on linux.  An example of preprocessed code
>
> ----------------------------------------------------------------
> typedef long int __fd_mask;
> typedef struct   {
> __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
> }
> fd_set;
> int xmlNanoFTPCheckResponse(void *ctx) {
> fd_set rfd;
> int __d0, __d1;
> __asm__ __volatile__ ("cld; rep; stosl" : "=c" (__d0), "=D" (__d1) :
> "a" (0), "0" (sizeof (fd_set) / sizeof (__fd_mask)), "1"
> (&(((&rfd))->__fds_bits)[0]) : "memory");
> }
> --- 
> --- 
> --- 
> --- 
> --- 
> --- 
> --- 
> --------------------------------------------------------------------
>
> This is the intended consequence of your patch? Should there be an
> explicit cast to intptr_t in the C code?

How is it failing? An compile time error?

You are probably right that it's missing a cast.

Evan

>
> -- 
> Rafael Avila de Espindola
>
> Google | Gordon House | Barrow Street | Dublin 4 | Ireland
> Registered in Dublin, Ireland | Registration Number: 368047



More information about the llvm-commits mailing list