[Bug c/57915] New: ICE in set_address_disp, at rtlanal.c:5537
etienne_lorrain at yahoo dot fr
gcc-bugzilla@gcc.gnu.org
Tue Jul 16 22:27:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57915
Bug ID: 57915
Summary: ICE in set_address_disp, at rtlanal.c:5537
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: etienne_lorrain at yahoo dot fr
On latest Fedora, with: gcc version 4.8.1 20130603 (Red Hat 4.8.1-1) (GCC)
I get:
$ /usr/bin/gcc -m32 -Os bug.c
bug.c: In function ‘menu’:
bug.c:59:1: internal compiler error: in set_address_disp, at rtlanal.c:5537
}
^
Please submit a full bug report,
possibly related to asm(... "X" (*str)) , I use "X" mostly because I had
problems using "m" when the pointer points to local variable on the stack.
The problem do not exists with previous compiler versions, not a new code.
The simplified source code I finished to get after few hours is:
$ cat bug.c
extern inline const char *
_strnchr (const char *str, char c, unsigned size)
{
asm ("cld ; repne scasb %%es:(%%edi),%%al"
: "+c" (size), "+D" (str): "a" (c), "X" (*str):"cc");
return str - 1;
}
extern inline unsigned
strlen (const char *str)
{
return _strnchr (str, '\0', (~0)) - str;
}
extern inline void
_strncpy (char *dst, const char *src, unsigned nb)
{
unsigned len = strlen (src);
if (len > nb)
len = nb;
__builtin_memcpy (dst, src, len);
dst[len] = '\0';
}
extern inline char *
strcpy (char *dst, const char *src)
{
_strncpy (dst, src, (~0));
return dst;
}
typedef struct
{
char go_msg[8];
char scanpath[16];
} gujin_param_t;
extern gujin_param_t copy_gujin_param;
enum { kernel_bottom_menu, setup_bottom_menu } type;
unsigned short getkey(void);
unsigned timeout;
unsigned menu (void)
{
char local_scanpath[sizeof (copy_gujin_param.scanpath)];
strcpy (local_scanpath, copy_gujin_param.scanpath);
for (;;)
{
unsigned short key = getkey();
if ((type == kernel_bottom_menu) ? (key == (0x1312)) : key == (0x3900 | '
'))
{
strcpy (local_scanpath, copy_gujin_param.scanpath);
}
}
}
Regards, Etienne.
More information about the Gcc-bugs
mailing list