Subject: toolchain/24417: gcc/f771 build failure in current
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <chuck_tuffli@agilent.com>
List: netbsd-bugs
Date: 02/13/2004 19:31:02
>Number:         24417
>Category:       toolchain
>Synopsis:       gcc/f771 build failure in current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 13 19:32:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Chuck Tuffli
>Release:        -current
>Organization:
Agilent Technologies
>Environment:
FreeBSD cre85086tuf.rose.agilent.com 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Wed Nov 13 09:48:07 PST 2002     root@cre85086tuf.rose.agilent.com:/usr/src/sys/compile/SND  i386

>Description:
building tools from -current fails because of undefined reference to integer_nonzerop in gnu/dist/gcc/gcc/f/com.c
>How-To-Repeat:
cvs co -dP gnu
./build.sh -D /opt/netbsd -m i386 -V MKCATPAGES=no -V MKDOC=no -V MKINFO=no -V MKMAN=no tools kernel=GENERIC
>Fix:
Index: gnu/dist/gcc/gcc/tree.c
===================================================================
RCS file: /cvsroot/src/gnu/dist/gcc/gcc/tree.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tree.c
--- gnu/dist/gcc/gcc/tree.c	2003/10/18 11:06:13	1.1.1.2
+++ gnu/dist/gcc/gcc/tree.c	2004/02/13 19:19:54
@@ -723,6 +723,23 @@
 	  || (low == 0 && (high & (high - 1)) == 0));
 }
 
+/* Return 1 if EXPR is an integer constant other than zero or a
+   complex constant other than zero.  */
+
+int
+integer_nonzerop (tree expr)
+{
+  STRIP_NOPS (expr);
+
+  return ((TREE_CODE (expr) == INTEGER_CST
+	   && ! TREE_CONSTANT_OVERFLOW (expr)
+	   && (TREE_INT_CST_LOW (expr) != 0
+	       || TREE_INT_CST_HIGH (expr) != 0))
+	  || (TREE_CODE (expr) == COMPLEX_CST
+	      && (integer_nonzerop (TREE_REALPART (expr))
+		  || integer_nonzerop (TREE_IMAGPART (expr)))));
+}
+
 /* Return the power of two represented by a tree node known to be a
    power of two.  */
 
Index: gnu/dist/gcc/gcc/tree.h
===================================================================
RCS file: /cvsroot/src/gnu/dist/gcc/gcc/tree.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 tree.h
--- gnu/dist/gcc/gcc/tree.h	2003/10/18 11:06:15	1.1.1.2
+++ gnu/dist/gcc/gcc/tree.h	2004/02/13 19:19:55
@@ -2637,6 +2637,11 @@
 
 extern int integer_pow2p		PARAMS ((tree));
 
+/* integer_nonzerop (tree x) is nonzero if X is an integer constant
+   with a nonzero value.  */
+
+extern int integer_nonzerop (tree);
+
 /* staticp (tree x) is nonzero if X is a reference to data allocated
    at a fixed address in memory.  */
 

>Release-Note:
>Audit-Trail:
>Unformatted: