This is the mail archive of the gcc-prs@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]

middle-end/7245: ICE in find_reloads


>Number:         7245
>Category:       middle-end
>Synopsis:       ICE in find_reloads
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 09 08:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     aj@suse.de
>Release:        GCC 3.1.1 CVS as of 2002-07-01
>Organization:
>Environment:
i686-linux-gnu with glibc 2.2.5
>Description:
typedef struct m {
        int* c;
} m;

int mdph(m* s)
{
        int v,j,r;
        for(;;){
            v = (r>>-8);
            if(v==0) break;
            s->c[j]= v;
        }
}

generates an ICE:
$ /opt/gcc/3.1-devel/bin/gcc  -c h.c -O2 -v
Reading specs from /opt/gcc/3.1-devel/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/specs
Configured with: /cvs/gcc-3_1-branch/configure --prefix=/opt/gcc/3.1-devel --enable-shared --enable-threads=posix --enable-clocale=gnu --disable-nls --enable-languages=c,c++,f77,java,objc,ada --enable-checking=misc,tree,rtl,gc --with-system-zlib
Thread model: posix
gcc version 3.1.1 20020701 (prerelease)
 /opt/gcc/3.1-devel/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=1 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ h.c -quiet -dumpbase h.c -O2 -version -o /tmp/cccOPrt7.s
GNU CPP version 3.1.1 20020701 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C version 3.1.1 20020701 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 3.1.1 20020701 (prerelease).
ignoring nonexistent directory "/opt/gcc/3.1-devel/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /opt/gcc/3.1-devel/include
 /opt/gcc/3.1-devel/lib/gcc-lib/i686-pc-linux-gnu/3.1.1/include
 /usr/include
End of search list.
h.c: In function `mdph':
h.c:9: warning: right shift count is negative
h.c:13: unable to generate reloads for:
(insn:QI 61 60 11 (parallel[ 
            (set (reg:CCZ 17 flags)
                (compare:CCZ (ashiftrt:SI (reg/v:SI 0 eax [62])
                        (const_int -8 [0xfffffff8]))
                    (const_int 0 [0x0])))
            (set (reg/v:SI 1 edx [60])
                (ashiftrt:SI (reg/v:SI 0 eax [62])
                    (const_int -8 [0xfffffff8])))
        ] ) 434 {*ashrsi3_cmp} (nil)
    (expr_list:REG_DEAD (reg/v:SI 0 eax [62])
        (nil)))
h.c:13: Internal compiler error in find_reloads, at reload.c:3576
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

The same error occurs in both GCC 3.1.1 CVS and GCC 3.2 CVS.
This is a regression from GCC 2.95.3.
>How-To-Repeat:
Just compile the example code.

note that according to ISO C (6.5.7 clause #4):
  The result of E1 >>  E2  ...
  If E1 has a  signed  type  and  a
  negative  value,  the  resulting  value  is 
  implementation-defined.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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