public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: ak03@gte.com
To: gcc-gnats@gcc.gnu.org
Cc: pfeifer@dbai.tuwien.ac.at, rittle@latour.rsch.comm.mot.com,
	obrien@FreeBSD.ORG
Subject: bootstrap/10453: Regression on FreeBSD/sparc64
Date: Tue, 22 Apr 2003 14:46:00 -0000	[thread overview]
Message-ID: <200304221439.h3MEd2la055958@ork.gte.com> (raw)


>Number:         10453
>Category:       bootstrap
>Synopsis:       Critical regression on FreeBSD/sparc64, compiler not usable
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 22 14:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alexander N. Kabaev
>Release:        3.3 20030421 (prerelease)
>Organization:
FreeBSD Project
>Environment:
System: FreeBSD ork.gte.com 4.8-RC FreeBSD 4.8-RC #2: Mon Mar 24 11:00:40 EST 2003 ak03@ork.gte.com:/usr/src/sys/compile/KAN i386

FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #4: Wed Apr 16 18:23:28 EDT 2003     ak03@kanpc.gte.com:/usr/src/sys/i386/compile/KANPC  i386

	
host: i386-portbld-freebsd4.8
build: i386-portbld-freebsd4.8
target: i386-portbld-freebsd4.8
configured with: ./..//gcc-20030421/configure --disable-nls --with-gnu-as --with-gnu-ld --with-gxx-include-dir=/usr/local/lib/gcc-lib/i386-portbld-freebsd4.8/3.3/include/g++-v3 --with-system-zlib --disable-shared --prefix=/usr/local i386-portbld-freebsd4.8
>Description:
	GCC 3.3 fails to bootstrap on FreeBSD and dies with ICE in expr.c:9408.
	The reason for failure is quite convoluted:

	1) sparc.md file defines mulsidi3 insn expansion which unconditionally
	   calls gen_const_mulsidi3_sp32 insn on non-V8PLUS targets.
	2) const_mulsidi3_sp32 INSN has a TARGET_HARD_MUL32 condition.
	3) TARGET_HARD_MUL32 condition is a compile time constant on FreeBSD:

#define TARGET_HARD_MUL32                               \
  ((TARGET_V8 || TARGET_SPARCLITE                       \
    || TARGET_SPARCLET || TARGET_DEPRECATED_V8_INSNS)   \
   && ! TARGET_V8PLUS && TARGET_ARCH32)

	FreeBSD supports only 64-bit targets, so TARGET_ARCH32 is a compile
	time constant 0 and '&&'  makes the value of the TARGET_HARD_MUL32
	constant known at compile time too.

	4) Since the value for TARGET_HARD_MUL32 is known at compile time and
	is 0, the newly added insn-conditions.c file will mark it as not-needed
	and it will be raplaced with a stub, returning NULL.

	5) Unconditional invocation in 1) will return NULL and GCC will die ICE.

>How-To-Repeat:
	Bootstrap the compiler on FreeBSD/sparc64.
>Fix:
	Only call gen_const_mulsidi3_sp32 if TARGET_ARCH32 is true. For
	64-bit targets, call gen_const_mulsidi3_sp64 instead.

Index: sparc.md
===================================================================
RCS file: /usr/ncvs2/src/contrib/gcc/config/sparc/sparc.md,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 sparc.md
--- sparc.md	3 Apr 2003 01:53:52 -0000	1.1.1.9
+++ sparc.md	22 Apr 2003 14:20:09 -0000
@@ -5289,9 +5289,12 @@
       if (TARGET_V8PLUS)
 	emit_insn (gen_const_mulsidi3_v8plus (operands[0], operands[1],
 					      operands[2]));
-      else
+      else if (TARGET_ARCH32)
 	emit_insn (gen_const_mulsidi3_sp32 (operands[0], operands[1],
 					    operands[2]));
+      else 
+	emit_insn (gen_const_mulsidi3_sp64 (operands[0], operands[1],
+					    operands[2]));
       DONE;
     }
   if (TARGET_V8PLUS)
@@ -5495,8 +5498,11 @@
       if (TARGET_V8PLUS)
 	emit_insn (gen_const_umulsidi3_v8plus (operands[0], operands[1],
 					       operands[2]));
-      else
+      else if (TARGET_ARCH32)
 	emit_insn (gen_const_umulsidi3_sp32 (operands[0], operands[1],
+					     operands[2]));
+      else 
+	emit_insn (gen_const_umulsidi3_sp64 (operands[0], operands[1],
 					     operands[2]));
       DONE;
     }
>Release-Note:
>Audit-Trail:
>Unformatted:


                 reply	other threads:[~2003-04-22 14:46 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=200304221439.h3MEd2la055958@ork.gte.com \
    --to=ak03@gte.com \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=obrien@FreeBSD.ORG \
    --cc=pfeifer@dbai.tuwien.ac.at \
    --cc=rittle@latour.rsch.comm.mot.com \
    /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).