public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "moonz at kaist dot ac dot kr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/27616]  New: Internal error with -O3
Date: Mon, 15 May 2006 15:46:00 -0000	[thread overview]
Message-ID: <bug-27616-10599@http.gcc.gnu.org/bugzilla/> (raw)

===== 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


             reply	other threads:[~2006-05-15 15:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-15 15:46 moonz at kaist dot ac dot kr [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27616-10599@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).