public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/8554: gcc-3.2 m68k-elf gets ICE
@ 2002-11-19 18:12 pbarada
0 siblings, 0 replies; only message in thread
From: pbarada @ 2002-11-19 18:12 UTC (permalink / raw)
To: gcc-gnats
>Number: 8554
>Category: target
>Synopsis: gcc-3.2 m68k-elf gets ICE
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Tue Nov 12 12:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Peter Barada
>Release: 3.2.1 20021111 (prerelease)
>Organization:
>Environment:
System: Linux hyper.wm.sps.mot.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: m68k-unknown-elf
configured with: /home/pbarada/work/cvs-gnu/gcc-3.2-now/gcc/configure --target=m68k-elf --prefix=/tmp/junk-3.2 --enable-languages=c,c++ --with-local-prefix=/tmp/junk-3.2/m68k-elf --with-newlib
>Description:
gcc-3.2.1 20021111 --taret=m68k-elf generates an ICE while
trying to reload the following instruction:
(insn 23 21 24 (set (reg/v/f:SI 38)
(mem/f:SI (plus:SI (reg/f:SI 14 %a6)
(const_int 12 [0xc])) [3 S4 A8])) 30 {movsi_cfv4} (nil)
(nil))
In this case, SI 38 becomes a stack slot(since errno_save has
to be saved across the call to fwrite), so the insn is rewritten as:
(insn 23 21 24 (set (mem:SI (plus:SI (reg/f:SI 14 %a6)
(const_int -32780 [0xffff7ff4])) [15 start S4 A8])
(mem/f:SI (plus:SI (reg/f:SI 14 %a6)
(const_int 12 [0xc])) [3 S4 A8])) 30 {movsi_cfv4} (nil)
(nil))
But the offset to -32780 is too far for 68k mode 5 addressing,
so reload pushes the 32780 into %d0(via isn 591), and rewrites
the insn as:
(insn 591 21 23 (set (reg:SI 0 %d0)
(const_int -32780 [0xffff7ff4])) 30 {movsi_cfv4} (nil)
(nil))
(insn 23 591 24 (set (mem:SI (plus:SI (reg/f:SI 14 %a6)
(reg:SI 0 %d0)) [60 start S4 A8])
(mem/f:SI (plus:SI (reg/f:SI 14 %a6)
(const_int 12 [0xc])) [5 S4 A8])) 30 {movsi_cfv4} (nil)
(nil))
Which is now illegal for the 68k architecturesince the
destination operand can not be mode 6 addressing if the source
operand is mode 5, so an ICE is generated since this insn is
not recognizable.
>How-To-Repeat:
m68k-elf-gcc -O2 -S the following sourcefile:
typedef unsigned int size_t;
typedef struct _IO_FILE FILE;
extern size_t fwrite (__const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s) ;
extern int ferror (FILE *__stream) ;
extern int *__errno_location (void) __attribute__ ((__const__));
extern void error (int status, int errnum, const char *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
enum { __LC_MESSAGES = 5, };
extern char *__dcgettext (const char *__domainname,
const char *__msgid, int __category)
__attribute__ ((__format_arg__ (2)));
extern char *__dcgettext (const char *__domainname,
const char *__msgid, int __category);
extern const char _libc_intl_domainname[];
typedef void *iconv_t;
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
size_t *__restrict __inbytesleft,
char **__restrict __outbuf,
size_t *__restrict __outbytesleft);
int process_block (iconv_t cd, char *addr, size_t len, FILE *output);
int
process_block (iconv_t cd, char *addr, size_t len, FILE *output)
{
const char *start = addr;
char outbuf[32768];
char *outptr;
size_t outlen;
size_t n;
while (len > 0)
{
outptr = outbuf;
outlen = 32768;
n = iconv (cd, &addr, &len, &outptr, &outlen);
if (outptr != outbuf)
{
int errno_save = (*__errno_location ());
if (fwrite (outbuf, 1, outptr - outbuf, output) < outptr - outbuf
|| ferror (output))
{
error (0, 0, __dcgettext (_libc_intl_domainname, ("conversion stopped due to problem in writing the output"), __LC_MESSAGES));
return -1;
}
(*__errno_location ()) = errno_save;
}
if (n != (size_t) -1)
{
outptr = outbuf;
outlen = 32768;
(void) iconv (cd, ((void *)0), ((void *)0), &outptr, &outlen);
if (outptr != outbuf)
{
int errno_save = (*__errno_location ());
if (fwrite (outbuf, 1, outptr - outbuf, output) < outptr - outbuf
|| ferror (output))
{
error (0, 0, __dcgettext (_libc_intl_domainname, ("conversion stopped due to problem in writing the output"), __LC_MESSAGES));
return -1;
}
(*__errno_location ()) = errno_save;
}
break;
}
if ((*__errno_location ()) != 7)
{
switch ((*__errno_location ()))
{
case 84:
error (0, 0, __dcgettext (_libc_intl_domainname, ("illegal input sequence at position %ld"), __LC_MESSAGES),
(long) (addr - start));
break;
case 22:
error (0, 0, __dcgettext (_libc_intl_domainname, ("incomplete character or shift sequence at end of buffer"), __LC_MESSAGES));
break;
case 9:
error (0, 0, __dcgettext (_libc_intl_domainname, ("internal error (illegal descriptor)"), __LC_MESSAGES));
break;
default:
error (0, 0, __dcgettext (_libc_intl_domainname, ("unknown iconv() error %d"), __LC_MESSAGES), (*__errno_location ()));
break;
}
return -1;
}
}
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-11-12 20:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-19 18:12 target/8554: gcc-3.2 m68k-elf gets ICE pbarada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).