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]

bootstrap/10453: Regression on FreeBSD/sparc64


>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 at ork dot gte dot 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 at kanpc dot gte dot 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:


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