This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/2407: compile fails in emit_move_insn_1 if optimization is on (-O)
- To: gcc-gnats at gcc dot gnu dot org
- Subject: optimization/2407: compile fails in emit_move_insn_1 if optimization is on (-O)
- From: cmg at 4u dot net
- Date: 28 Mar 2001 01:28:28 -0000
- Reply-To: cmg at 4u dot net
>Number: 2407
>Category: optimization
>Synopsis: compile fails in emit_move_insn_1 if optimization is on (-O)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Mar 27 17:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Charles Gilman
>Release: gcc version 2.96 20000731 (Red Hat Linux 7.0)
>Organization:
>Environment:
Red Hat Linux release 7.0 (Guinness), Kernel 2.2.16-22 on an i686 (P2-MMX with 128mg memory)
>Description:
Output from cc -c -O zx.c:
zx.c: In function `zx_cvtToOpr':
zx.c:143: Internal error: Floating point exception.
Please submit a full bug report.
Note: Only fails with -O flag. Source is from cc -E with many unnecessary lines deleted. Also failed with message in synopsis using "last night's gcc".
>How-To-Repeat:
cc -c -O zx.c
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="zx.c"
Content-Disposition: inline; filename="zx.c"
# 57 "/usr/include/bits/setjmp.h" 1 3
typedef int __jmp_buf[6];
# 31 "/usr/include/setjmp.h" 2 3
# 23 "/usr/include/bits/sigset.h" 1 3
typedef int __sig_atomic_t;
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 32 "/usr/include/setjmp.h" 2 3
typedef struct __jmp_buf_tag
{
__jmp_buf __jmpbuf;
int __mask_was_saved;
__sigset_t __saved_mask;
} jmp_buf[1];
extern int __sigsetjmp (jmp_buf __env, int __savemask);
# 70 "/usr/include/setjmp.h" 3
extern void longjmp (jmp_buf __env, int __val)
__attribute__ ((__noreturn__));
extern void _longjmp (jmp_buf __env, int __val)
__attribute__ ((__noreturn__));
typedef jmp_buf sigjmp_buf;
extern void siglongjmp (sigjmp_buf __env, int __val)
__attribute__ ((__noreturn__));
# 28 "/usr/include/sys/types.h" 1 3
# 30 "/usr/include/bits/types.h" 1 3
# 199 "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h" 1 3
typedef unsigned int size_t;
# 30 "/usr/include/bits/types.h" 2 3
typedef unsigned char __u_char;
typedef unsigned short __u_short;
typedef unsigned int __u_int;
typedef unsigned long __u_long;
__extension__ typedef unsigned long long int __u_quad_t;
__extension__ typedef long long int __quad_t;
# 49 "/usr/include/bits/types.h" 3
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
__extension__ typedef signed long long int __int64_t;
__extension__ typedef unsigned long long int __uint64_t;
typedef __quad_t *__qaddr_t;
typedef __u_quad_t __dev_t;
typedef __u_int __uid_t;
typedef __u_int __gid_t;
typedef __u_long __ino_t;
typedef __u_int __mode_t;
typedef __u_int __nlink_t;
typedef long int __off_t;
typedef __quad_t __loff_t;
typedef int __pid_t;
typedef int __ssize_t;
typedef __u_long __rlim_t;
typedef __u_quad_t __rlim64_t;
typedef __u_int __id_t;
typedef struct
{
int __val[2];
} __fsid_t;
typedef int __daddr_t;
typedef char *__caddr_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef long int __swblk_t;
typedef long int __clock_t;
typedef int __clockid_t;
typedef int __timer_t;
typedef unsigned long int __fd_mask;
# 109 "/usr/include/bits/types.h" 3
typedef struct
{
__fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))];
} __fd_set;
typedef int __key_t;
typedef unsigned short int __ipc_pid_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef __quad_t __blkcnt64_t;
typedef __u_long __fsblkcnt_t;
typedef __u_quad_t __fsblkcnt64_t;
typedef __u_long __fsfilcnt_t;
typedef __u_quad_t __fsfilcnt64_t;
typedef __u_quad_t __ino64_t;
typedef __loff_t __off64_t;
typedef long int __t_scalar_t;
typedef unsigned long int __t_uscalar_t;
typedef int __intptr_t;
typedef unsigned int __socklen_t;
# 24 "/usr/include/bits/pthreadtypes.h" 1 3
# 68 "/usr/include/bits/sched.h" 1 3
struct __sched_param
{
int sched_priority;
};
# 24 "/usr/include/bits/pthreadtypes.h" 2 3
struct _pthread_fastlock
{
long int __status;
int __spinlock;
};
typedef struct _pthread_descr_struct *_pthread_descr;
typedef struct
{
int __detachstate;
int __schedpolicy;
struct __sched_param __schedparam;
int __inheritsched;
int __scope;
size_t __guardsize;
int __stackaddr_set;
void *__stackaddr;
size_t __stacksize;
} pthread_attr_t;
typedef struct
{
struct _pthread_fastlock __c_lock;
_pthread_descr __c_waiting;
} pthread_cond_t;
typedef struct
{
int __dummy;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef struct
{
int __m_reserved;
int __m_count;
_pthread_descr __m_owner;
int __m_kind;
struct _pthread_fastlock __m_lock;
} pthread_mutex_t;
typedef struct
{
int __mutexkind;
} pthread_mutexattr_t;
typedef int pthread_once_t;
# 140 "/usr/include/bits/pthreadtypes.h" 3
typedef unsigned long int pthread_t;
# 166 "/usr/include/bits/types.h" 2 3
# 31 "/usr/include/sys/types.h" 2 3
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
# 58 "/usr/include/sys/types.h" 3
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
typedef __off_t off_t;
# 96 "/usr/include/sys/types.h" 3
typedef __pid_t pid_t;
typedef __id_t id_t;
typedef __ssize_t ssize_t;
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
# 127 "/usr/include/sys/types.h" 3
# 224 "/usr/include/sys/types.h" 3
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
# 256 "/usr/include/sys/types.h" 3
# 2 "zx.c" 1 3
typedef union operand *OPERAND;
extern jmp_buf serrjmp;
struct o_l {
unsigned long l0;
unsigned long l1;
};
struct o_w {
unsigned short w0;
unsigned short w1;
unsigned short w2;
unsigned short w3;
};
struct o_b {
unsigned char b0;
unsigned char b1;
unsigned char b2;
unsigned char b3;
unsigned char b4;
unsigned char b5;
unsigned char b6;
unsigned char b7;
};
union operand {
struct o_l l;
struct o_w w;
struct o_b b;
};
extern OPERAND pwenda; /* operand stack / work limit */
struct dsc_descriptor
{
unsigned short dsc_w_length;
unsigned char dsc_b_dtype;
unsigned char dsc_b_class;
char *dsc_a_pointer;
};
static struct DTYPE {
char *name;
unsigned char code;
unsigned short len;
} zx_dTypes[] = {
{ "Z", 0, sizeof (union operand) },
{ "BU", 2, 1 },
{ "WU", 3, 2 },
{ "LU", 4, 4 },
{ "QU", 5, 8 },
{ "OU", 25, 16 },
{ "B", 6, 1 },
{ "W", 7, 2 },
{ "L", 8, 4 },
{ "Q", 9, 8 },
{ "O", 26, 16 },
{ "F", 10, 4 },
{ "D", 11, 8 },
{ "G", 27, 8 },
{ "H", 28, 16 },
{ "FC", 12, 8 },
{ "DC", 13, 16 },
{ "GC", 29, 16 },
{ "HC", 30, 32 },
{ "CIT",31,12 },
{ "T", 14, 0 },
{ "VT", 37, 0 },
{ "NU", 15, 0 },
{ "NL", 16, 0 },
{ "NLO",17,0 },
{ "NR", 18, 0 },
{ "NRO",19,0 },
{ "NZ", 20, 0 },
{ "P", 21, 0 },
{ "V", 01, 0 },
{ "VU", 34, 0 },
{ "ZI", 22, 0 },
{ "ZEM",23,2 },
{ "DSC",24,8 },
{ "BPV",32,8 },
{ "BLV",33,8 },
{ "ADT",35,8 } };
struct zx_opList {
union operand opr;
unsigned char method;
struct dsc_descriptor desc;
unsigned long value;
};
static OPERAND
zx_cvtToOpr( curOpEntry, curOpr )
struct zx_opList *curOpEntry;
OPERAND curOpr;
{
char *source = curOpEntry->desc.dsc_a_pointer;
int srcLen = (int) curOpEntry->desc.dsc_w_length;
unsigned char type = curOpEntry->desc.dsc_b_dtype;
char buffer[256];
unsigned long status;
char *ptr;
struct dsc_descriptor desc = { (unsigned short)sizeof(buffer),
(unsigned char) 0,
(unsigned char) 0,
(char *)0 };
desc.dsc_a_pointer = (char *) buffer;
switch (type) {
case 10:
case 11:
case 27:
if (type == 10)
desc.dsc_w_length = 14;
else if (type == 11)
desc.dsc_w_length = 21;
else if (type == 27)
desc.dsc_w_length = 22;
else
desc.dsc_w_length = 23;
ZX_ERROR (40, 0);
if (type == 28) {
ptr = desc.dsc_a_pointer +
desc.dsc_w_length - 4;
if (*ptr == (unsigned char)'0')
ZX_ERROR (40, 0);
(void) memmove (ptr, ptr+1, 3);
desc.dsc_w_length--;
}
if (status)
ZX_ERROR (status, 0);
break;
default:
ZX_ERROR (-1, 0);
}
pwenda = curOpr;
return (curOpr);
}