public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/27616]  New: Internal error with -O3
@ 2006-05-15 15:46 moonz at kaist dot ac dot kr
  2006-05-15 15:51 ` [Bug rtl-optimization/27616] Internal error with -O1 (CSE) pinskia at gcc dot gnu dot org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: moonz at kaist dot ac dot kr @ 2006-05-15 15:46 UTC (permalink / raw)
  To: gcc-bugs

===== gcc41bug.c =====
#include <stddef.h>

typedef struct chunk_s chunk_t;
struct chunk_s {
    unsigned int size;
    int offset_next;
};

#define GET_ADDRESS(baseptr, offset) \
    ((chunk_t *)((char *)(baseptr) + (offset)))

void
gcc_bug_test(chunk_t *first)
{
    chunk_t *cur;

    while (1) {
        cur = GET_ADDRESS(first, first->offset_next);

        if (GET_ADDRESS(first, cur->offset_next) == first)
            first->offset_next = 0;

        if (cur->size == 0)
            break;
    }
}
===== end of gcc41bug.c =====

command line:

$ i686-pc-linux-gnu-gcc-4.1.0 -c -O1 -o gcc41bug.o gcc41bug.c
i686-pc-linux-gnu-gcc-4.1.0: Internal error: Segmentation fault (program cc1)

1. Works fine without -O1.
2. Code might look meaningless, 
   but it's extracted part from a real application code

$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/gcc-4.1.0/work/gcc-4.1.0/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --disable-multilib
--disable-libmudflap --disable-libssp --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.1.0 (Gentoo 4.1.0)


-- 
           Summary: Internal error with -O3
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: moonz at kaist dot ac dot kr
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27616


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2006-09-04 19:38 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-15 15:46 [Bug rtl-optimization/27616] New: Internal error with -O3 moonz at kaist dot ac dot kr
2006-05-15 15:51 ` [Bug rtl-optimization/27616] Internal error with -O1 (CSE) pinskia at gcc dot gnu dot org
2006-05-15 15:53 ` [Bug rtl-optimization/27616] [4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-05-15 15:59 ` pinskia at gcc dot gnu dot org
2006-05-18 21:47 ` kazu at gcc dot gnu dot org
2006-05-19 19:37 ` kazu at gcc dot gnu dot org
2006-05-25  2:42 ` mmitchel at gcc dot gnu dot org
2006-06-04  9:34 ` steven at gcc dot gnu dot org
2006-06-04 19:10 ` mmitchel at gcc dot gnu dot org
2006-06-04 20:46 ` kazu at gcc dot gnu dot org
2006-07-07 13:36 ` pinskia at gcc dot gnu dot org
2006-07-14  0:20 ` janis at gcc dot gnu dot org
2006-07-14 17:02 ` steven at gcc dot gnu dot org
2006-08-06 20:15 ` ebotcazou at gcc dot gnu dot org
2006-08-08 11:12 ` ebotcazou at gcc dot gnu dot org
2006-08-08 18:33 ` pinskia at gcc dot gnu dot org
2006-08-08 18:52 ` ebotcazou at gcc dot gnu dot org
2006-09-04 19:33 ` [Bug rtl-optimization/27616] [4.1/4.2 Regression] Infinite loop at -O1 and above in RTL CSE ebotcazou at gcc dot gnu dot org
2006-09-04 19:35 ` ebotcazou at gcc dot gnu dot org
2006-09-04 19:38 ` ebotcazou at gcc dot gnu dot org

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).