This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC 3.1 crashes under bitshift operations


Okay, I managed to produce the .i files, and here is
fresh test code with it.  Hope it gets fixed.  I know
that I have done something weird in this code, but it
is still a bug:

Script started on Mon Jan  6 02:54:38 2003

jackass:~/tmp%> gcc --save-temps anotherbug.c
anotherbug.c: In function `main':
anotherbug.c:6: warning: left shift count >= width of type
anotherbug.c:8: unrecognizable insn:
(insn 20 18 22 (set (reg:QI 62)
        (const_int 128 [0x80])) -1 (nil)
    (nil))
anotherbug.c:8: Internal compiler error in extract_insn, at recog.c:2150
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

jackass:~/tmp%> gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.2.1 [FreeBSD] 20021009 (prerelease)

jackass:~/tmp%> cat anotherbug.c
#include <sys/types.h>

int main()
{
	long long tlc;
	tlc = tlc << 0x80;
	return 0;
}
jackass:~/tmp%> exit

FreeBSD specific info:
5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sat Dec 21 19:24:35 GMT 2002 

Script done on Mon Jan  6 02:54:59 2003

-save-temps generated .i file:

# 1 "anotherbug.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "anotherbug.c"
# 1 "/usr/include/sys/types.h" 1 3
# 45 "/usr/include/sys/types.h" 3
# 1 "/usr/include/sys/cdefs.h" 1 3
# 46 "/usr/include/sys/types.h" 2 3


# 1 "/usr/include/machine/endian.h" 1 3
# 41 "/usr/include/machine/endian.h" 3
# 1 "/usr/include/sys/_types.h" 1 3
# 33 "/usr/include/sys/_types.h" 3
# 1 "/usr/include/machine/_types.h" 1 3
# 45 "/usr/include/machine/_types.h" 3
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;







typedef int __attribute__((__mode__(__DI__))) __int64_t;
typedef unsigned int __attribute__((__mode__(__DI__))) __uint64_t;
# 70 "/usr/include/machine/_types.h" 3
typedef unsigned long __clock_t;
typedef __int32_t __critical_t;
typedef __int32_t __intfptr_t;
typedef __int64_t __intmax_t;
typedef __int32_t __intptr_t;
typedef __int32_t __int_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __int64_t __int_fast64_t;
typedef __int8_t __int_least8_t;
typedef __int16_t __int_least16_t;
typedef __int32_t __int_least32_t;
typedef __int64_t __int_least64_t;
typedef __int32_t __ptrdiff_t;
typedef __int32_t __register_t;
typedef __int32_t __segsz_t;
typedef __uint32_t __size_t;
typedef __int32_t __ssize_t;
typedef __int32_t __time_t;
typedef __uint32_t __uintfptr_t;
typedef __uint64_t __uintmax_t;
typedef __uint32_t __uintptr_t;
typedef __uint32_t __uint_fast8_t;
typedef __uint32_t __uint_fast16_t;
typedef __uint32_t __uint_fast32_t;
typedef __uint64_t __uint_fast64_t;
typedef __uint8_t __uint_least8_t;
typedef __uint16_t __uint_least16_t;
typedef __uint32_t __uint_least32_t;
typedef __uint64_t __uint_least64_t;
typedef __uint32_t __u_register_t;
typedef __uint32_t __vm_offset_t;
typedef __int64_t __vm_ooffset_t;
typedef __uint64_t __vm_pindex_t;
typedef __uint32_t __vm_size_t;





typedef __builtin_va_list __va_list;





typedef __va_list __gnuc_va_list;
# 34 "/usr/include/sys/_types.h" 2 3




typedef __int32_t __clockid_t;
typedef __uint32_t __fflags_t;
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsfilcnt_t;
typedef __uint32_t __gid_t;
typedef __int64_t __id_t;
typedef long __key_t;
typedef __uint16_t __mode_t;
typedef int __nl_item;
typedef __int64_t __off_t;
typedef __int32_t __pid_t;
typedef __int64_t __rlim_t;
typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef __int32_t __timer_t;
typedef __uint32_t __uid_t;
# 73 "/usr/include/sys/_types.h" 3
typedef int __ct_rune_t;
typedef __ct_rune_t __rune_t;
typedef __ct_rune_t __wchar_t;
typedef __ct_rune_t __wint_t;





typedef union {
        char __mbstate8[128];
        __int64_t _mbstateL;
} __mbstate_t;
# 42 "/usr/include/machine/endian.h" 2 3
# 97 "/usr/include/machine/endian.h" 3
static __inline __uint64_t
__bswap64(__uint64_t _x)
{
        return ((_x >> 56) | ((_x >> 40) & 0xff00) | ((_x >> 24) & 0xff0000) |
            ((_x >> 8) & 0xff000000) | ((_x << 8) & ((__uint64_t)0xff << 32)) |
            ((_x << 24) & ((__uint64_t)0xff << 40)) |
            ((_x << 40) & ((__uint64_t)0xff << 48)) | ((_x << 56)));
}

static __inline __uint32_t
__bswap32(__uint32_t _x)
{

        return (__extension__ ({ register __uint32_t __X = (_x); __asm ("xchgb %h0, %b0\n\trorl $16, %0\n\txchgb %h0, %b0" : "+q" (__X)); __X; }));
}

static __inline __uint16_t
__bswap16(__uint16_t _x)
{

        return (__extension__ ({ register __uint16_t __X = (_x); __asm ("xchgb %h0, %b0" : "+q" (__X)); __X; }));
}
# 49 "/usr/include/sys/types.h" 2 3



typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef unsigned short ushort;
typedef unsigned int uint;






typedef __int8_t int8_t;




typedef __int16_t int16_t;




typedef __int32_t int32_t;




typedef __int64_t int64_t;




typedef __uint8_t uint8_t;




typedef __uint16_t uint16_t;




typedef __uint32_t uint32_t;




typedef __uint64_t uint64_t;




typedef __intptr_t intptr_t;
typedef __uintptr_t uintptr_t;



typedef __uint8_t u_int8_t;
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;

typedef __uint64_t u_quad_t;
typedef __int64_t quad_t;
typedef quad_t * qaddr_t;

typedef char * caddr_t;
typedef const char * c_caddr_t;
typedef volatile char *v_caddr_t;
typedef __critical_t critical_t;
typedef __int64_t daddr_t;
typedef __uint32_t fixpt_t;


typedef __gid_t gid_t;




typedef __uint32_t in_addr_t;




typedef __uint16_t in_port_t;




typedef __id_t id_t;



typedef __uint32_t ino_t;


typedef __key_t key_t;




typedef __mode_t mode_t;



typedef __uint16_t nlink_t;


typedef __off_t off_t;




typedef __pid_t pid_t;



typedef __register_t register_t;


typedef __rlim_t rlim_t;



typedef __segsz_t segsz_t;
typedef __u_register_t u_register_t;


typedef __uid_t uid_t;



typedef __vm_offset_t vm_offset_t;
typedef __vm_ooffset_t vm_ooffset_t;
typedef __vm_pindex_t vm_pindex_t;
typedef __vm_size_t vm_size_t;
# 216 "/usr/include/sys/types.h" 3
typedef __uint32_t dev_t;





typedef __clock_t clock_t;




typedef __clockid_t clockid_t;




typedef __fflags_t fflags_t;




typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;




typedef __size_t size_t;




typedef __ssize_t ssize_t;




typedef __time_t time_t;




typedef __timer_t timer_t;
# 268 "/usr/include/sys/types.h" 3
# 1 "/usr/include/sys/select.h" 1 3
# 42 "/usr/include/sys/select.h" 3
# 1 "/usr/include/sys/_sigset.h" 1 3
# 55 "/usr/include/sys/_sigset.h" 3
typedef struct __sigset {
        __uint32_t __bits[4];
} __sigset_t;
# 43 "/usr/include/sys/select.h" 2 3
# 1 "/usr/include/sys/timespec.h" 1 3
# 50 "/usr/include/sys/timespec.h" 3
struct timespec {
        time_t tv_sec;
        long tv_nsec;
};
# 44 "/usr/include/sys/select.h" 2 3
# 52 "/usr/include/sys/select.h" 3
typedef unsigned long __fd_mask;

typedef __fd_mask fd_mask;




typedef __sigset_t sigset_t;
# 81 "/usr/include/sys/select.h" 3
typedef struct fd_set {
        __fd_mask fds_bits[(((1024U) + (((sizeof(__fd_mask) * 8)) - 1)) / ((sizeof(__fd_mask) * 8)))];
} fd_set;
# 96 "/usr/include/sys/select.h" 3
struct timeval;


int pselect(int, fd_set *, fd_set *, fd_set *,
        const struct timespec *, const sigset_t *);



int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);


# 269 "/usr/include/sys/types.h" 2 3
# 287 "/usr/include/sys/types.h" 3



int ftruncate(int, off_t);



off_t lseek(int, off_t, int);



void * mmap(void *, size_t, int, int, int, off_t);



int truncate(const char *, off_t);


# 2 "anotherbug.c" 2

int main()
{
        long long tlc;
        tlc = tlc << 0x80;
        return 0;
}

Hope that helps.
Cheers.

-- 
Hiten Pandya (hiten@unixdaemons.com, hiten@uk.FreeBSD.org)
http://www.unixdaemons.com/~hiten/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]