public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: anders.blomdell@control.lth.se
To: gcc-gnats@gcc.gnu.org
Subject: optimization/6025: linux m68k-elf-gcc segfault
Date: Thu, 21 Mar 2002 09:26:00 -0000	[thread overview]
Message-ID: <200203211721.g2LHLdg22144@localhost.localdomain> (raw)


>Number:         6025
>Category:       optimization
>Synopsis:       linux m68k-elf-gcc cross compiler segfault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 21 09:25:59 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Anders Blomdell <anders.blomdell@control.lth.se>
>Release:        3.0.4
>Organization:
Department of Automatic Control, LTH
>Environment:
System: Linux aljazari 2.4.13-KURT #2 Thu Nov 8 10:49:33 CET 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: m68k-unknown-elf
configured with: ../../../gcc-3.0.4/configure --prefix=/usr/local/packages/cross/m68k-elf --target=m68k-elf --with-newlib
>Description:
  gcc segfaults when the supplied program is compiled with 

    m68k-elf-gcc -v -save-temps -c -O3 segfault.c 

>How-To-Repeat:

######################## segfault.c #################################
    
static void Copy(int destination, int source)
{
  *(int*)destination = *(int*)source;
}

void SegFaultWhenCompiling(int i)
{
  for (;;) {
    switch (i) {
      case 0:;
        Copy(0x400000, 0x400000);
        break;
      case 1:;
        Copy(0x0, 0x0);
        break;
      case 2:;
        Copy(0x0, 0x0);
        break;
      case 4:;
        Copy(0x0, 0x0);
        break;
      case 3:;
        Copy(0xFFFF0000, 0xFFFF0000);
        break;
      default :
        Copy(0x400000, 0x01);
        break;
    }
  }
}

void f()
{
  SegFaultWhenCompiling(0);
}

######################## segfault.i #################################

# 5 "segfault.c"
static void Copy(int destination, int source)
{
  *(int*)destination = *(int*)source;
}

void SegFaultWhenCompiling(int i)
{
  for (;;) {
    switch (i) {
      case 0:;
        Copy(0x400000, 0x400000);
        break;
      case 1:;
        Copy(0x0, 0x0);
        break;
      case 2:;
        Copy(0x0, 0x0);
        break;
      case 4:;
        Copy(0x0, 0x0);
        break;
      case 3:;
        Copy(0xFFFF0000, 0xFFFF0000);
        break;
      default :
        Copy(0x400000, 0x01);
        break;
    }
  }
}

void f()
{
  SegFaultWhenCompiling(0);
}
# 5 "segfault.c"
static void Copy(int destination, int source)
{
  *(int*)destination = *(int*)source;
}

void SegFaultWhenCompiling(int i)
{
  for (;;) {
    switch (i) {
      case 0:;
        Copy(0x400000, 0x400000);
        break;
      case 1:;
        Copy(0x0, 0x0);
        break;
      case 2:;
        Copy(0x0, 0x0);
        break;
      case 4:;
        Copy(0x0, 0x0);
        break;
      case 3:;
        Copy(0xFFFF0000, 0xFFFF0000);
        break;
      default :
        Copy(0x400000, 0x01);
        break;
    }
  }
}

void f()
{
  SegFaultWhenCompiling(0);
}

######################## segfault.s #################################

        .file   "segfault.i"

######################## console output #################################

> m68k-elf-gcc -save-temps -c -O3 segfault.c  
segfault.c: In function `SegFaultWhenCompiling':
segfault.c:40: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

>Fix:
	Lower -O level, code rearrangement
>Release-Note:
>Audit-Trail:
>Unformatted:


                 reply	other threads:[~2002-03-21 17:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200203211721.g2LHLdg22144@localhost.localdomain \
    --to=anders.blomdell@control.lth.se \
    --cc=gcc-gnats@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).