From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21068 invoked by alias); 12 Nov 2002 20:36:03 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21033 invoked by uid 71); 12 Nov 2002 20:36:03 -0000 Resent-Date: 12 Nov 2002 20:36:03 -0000 Resent-Message-ID: <20021112203603.21032.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, pbarada@mail.wm.sps.mot.com Received: (qmail 20995 invoked from network); 12 Nov 2002 20:35:47 -0000 Received: from unknown (HELO ftpbox.mot.com) (129.188.136.101) by sources.redhat.com with SMTP; 12 Nov 2002 20:35:47 -0000 Received: from pobox3.mot.com (pobox3.mot.com [10.64.251.242]) by ftpbox.mot.com (Motorola/Ftpbox) with ESMTP id gACKZk0j003510 for ; Tue, 12 Nov 2002 13:35:46 -0700 (MST) Received: [from mail.wm.sps.mot.com ([199.10.246.2]) by pobox3.mot.com (MOT-pobox3 2.0) with ESMTP id NAA23654 for ; Tue, 12 Nov 2002 13:31:44 -0700 (MST)] Received: from hyper.wm.sps.mot.com (hyper.wm.sps.mot.com [199.10.246.43]) by mail.wm.sps.mot.com (8.9.3/8.9.3) with ESMTP id PAA14861 for ; Tue, 12 Nov 2002 15:35:26 -0500 Received: by hyper.wm.sps.mot.com (8.11.2) id gACKZTP06075; Tue, 12 Nov 2002 15:35:29 -0500 Message-Id: <200211122035.gACKZTP06075@hyper.wm.sps.mot.com> Date: Tue, 19 Nov 2002 18:12:00 -0000 From: pbarada@mail.wm.sps.mot.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: target/8554: gcc-3.2 m68k-elf gets ICE X-SW-Source: 2002-11/txt/msg00603.txt.bz2 List-Id: >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: