This is the mail archive of the gcc@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]

Re: Build on mainline broken


On Sun, 2006-01-22 21:54:47 +0100, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Sun, 2006-01-22 21:49:31 +0100, Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote:
> [...]
> > > This is the SIGN_EXTRACT case of expand_compound_operation(), maybe this does ring a
> > > bell?
> > 
> > no idea; this is either completely unrelated, or we randomly clobber memory somewhere.
> > Could you please provide a preprocessed testcase (preferably reduced
> > one)?
> 
> Thanks for commenting on this. I've just started a build with r110030
> and will try to produce something. Once that is done (it takes some
> time:-)

First of all, this indeed starts with r110030. -O2 is needed, the
problem goes away if no -O is used. While trying to cut it down, I
noticed that the ICE is probably connected to the bitfields. It's 75
lines right now:

----------------------------------------------------------------------
typedef long unsigned int size_t;
extern void abort (void) __attribute__ ((__noreturn__));
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));

struct fde_vector
{
  size_t count;
  const struct dwarf_fde *array[];
};

struct object
{
    struct fde_vector *sort;

    struct {
      unsigned long mixed_encoding : 1;
      unsigned long encoding : 8;
    } b;
  struct object *next;
};

typedef int sword __attribute__ ((mode (SI)));
struct dwarf_cie
{
  sword CIE_id;
} __attribute__ ((packed, aligned (__alignof__ (void *))));

struct dwarf_fde
{
  sword CIE_delta;
} __attribute__ ((packed, aligned (__alignof__ (void *))));

typedef struct dwarf_fde fde;

static struct object *seen_objects;

static _Unwind_Ptr
base_from_object (unsigned char encoding)
{
	if (encoding)
		abort ();
}

static const fde *
search_object (struct object* ob, void *pc)
{
  struct fde_vector *vec = ob->sort;
  int encoding = ob->b.encoding;
  _Unwind_Ptr base = base_from_object (encoding);
  size_t lo, hi;

  for (lo = 0, hi = vec->count; lo < hi; )
    {
      size_t i = (lo + hi) / 2;
      const fde *f = vec->array[i];
      _Unwind_Ptr pc_begin;

      if ((_Unwind_Ptr) pc < pc_begin)
	      return f;
    }
}

const fde *
_Unwind_Find_FDE (void *pc)
{
	struct object *ob;
	const fde *f = ((void *)0);

	for (ob = seen_objects; ob; ob = ob->next)
		f = search_object (ob, pc);

	return f;
}
----------------------------------------------------------------------

To build it:
(This is binutils from CVS)
.../binutils/configure --target=vax-linux-uclibc --disable-nls --prefix=...
make all-binutils
make all-ld
make all-gas
make install-binutils
make install-ld
make install-gas

(GCC)
.../gcc/configure --disable-multilib --with-newlib --disable-nls \
--enable-threads=no --disable-threads --enable-symvers=gnu \
--enable-__cxa_atexit --disable-shared --target=vax-linux-uclibc \
--prefix=... \
--enable-languages=c,c++
make all-gcc

This patch is used for GCC:

diff -Nurp src-gcc-fresh/gcc/config/vax/linux.h src-gcc-hacked/gcc/config/vax/linux.h
--- src-gcc-fresh/gcc/config/vax/linux.h	1970-01-01 01:00:00.000000000 +0100
+++ src-gcc-hacked/gcc/config/vax/linux.h	2005-12-09 21:57:45.000000000 +0100
@@ -0,0 +1,31 @@
+#ifndef _CONFIG_VAX_LINUX_H
+/*
+ * Copyright (C) 2005 Free Software Foundation, Inc.
+ *
+ * This file is part of GCC.
+ *
+ * GCC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GCC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GCC; see the file COPYING.  If not, write to
+ *
+ *	Free Software Foundation
+ *	51 Franklin Street, Fifth Floor
+ *	Boston, MA 02110-1301
+ *	USA
+ */
+
+/*
+ * This file contains definitions specific to Linux using GNU libc and
+ * the ELF binary format.
+ */
+
+#endif /* _CONFIG_VAX_LINUX_H */
diff -Nurp src-gcc-fresh/gcc/config/vax/uclinux.h src-gcc-hacked/gcc/config/vax/uclinux.h
--- src-gcc-fresh/gcc/config/vax/uclinux.h	1970-01-01 01:00:00.000000000 +0100
+++ src-gcc-hacked/gcc/config/vax/uclinux.h	2005-12-09 21:57:45.000000000 +0100
@@ -0,0 +1,31 @@
+#ifndef _CONFIG_VAX_UCLINUX_H
+/*
+ * Copyright (C) 2005 Free Software Foundation, Inc.
+ *
+ * This file is part of GCC.
+ *
+ * GCC is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * GCC is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GCC; see the file COPYING.  If not, write to
+ *
+ *	Free Software Foundation
+ *	51 Franklin Street, Fifth Floor
+ *	Boston, MA 02110-1301
+ *	USA
+ */
+
+/*
+ * This file contains definitions specific to Linux using the small uClibc
+ * and the ELF binary format.
+ */
+
+#endif /* _CONFIG_VAX_UCLINUX_H */
diff -Nurp src-gcc-fresh/gcc/config.gcc src-gcc-hacked/gcc/config.gcc
--- src-gcc-fresh/gcc/config.gcc	2005-11-30 21:09:05.000000000 +0100
+++ src-gcc-hacked/gcc/config.gcc	2005-12-09 21:57:45.000000000 +0100
@@ -2258,6 +2258,12 @@ vax-*-sysv*)			# VAXen running system V
 	tmake_file=vax/t-memfuncs
 	use_fixproto=yes
 	;;
+vax-*-linux-uclibc*)		# VAXen running Linux ELF with uClibc
+	tm_file="${tm_file} elfos.h linux.h vax/elf.h vax/uclinux.h"
+	;;
+vax-*-linux*)			# VAXen running Linux ELF with GNU libc
+	tm_file="${tm_file} elfos.h linux.h vax/elf.h vax/linux.h"
+	;;
 vax-*-netbsdelf*)
 	tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h"
 	;;
diff -Nurp src-gcc-fresh/gcc/config/vax/vax.c src-gcc-hacked/gcc/config/vax/vax.c
--- src-gcc-fresh/gcc/config/vax/vax.c	2005-06-26 15:39:59.000000000 +0200
+++ src-gcc-hacked/gcc/config/vax/vax.c	2005-09-23 01:09:46.000000000 +0200
@@ -98,6 +98,13 @@ override_options (void)
   /* We're VAX floating point, not IEEE floating point.  */
   if (TARGET_G_FLOAT)
     REAL_MODE_FORMAT (DFmode) = &vax_g_format;
+
+  if (write_symbols != NO_DEBUG)
+    {
+      warning (0, "-g is only supported when using GAS on this processor,");
+      warning (0, "-g option disabled");
+      write_symbols = NO_DEBUG;
+    }
 }
 
 /* Generate the assembly code for function entry.  FILE is a stdio
diff -Nurp src-gcc-fresh/gcc/config/vax/lib1funcs.S src-gcc-hacked/gcc/config/vax/lib1funcs.S
--- src-gcc-fresh/gcc/config/vax/lib1funcs.S	1970-01-01 01:00:00.000000000 +0100
+++ src-gcc-hacked/gcc/config/vax/lib1funcs.S	2005-12-09 22:19:00.000000000 +0100
@@ -0,0 +1,86 @@
+/*
+ * Assembly functions for the VAX version of libgcc1.
+ * Copyright (C) 2005 Free Software Foundation, Inc.
+ * Contributed by Jan-Benedict Glaw <jbglaw@lug-owl.de>.
+ *
+ * This file is part of GCC.
+ *
+ * GCC is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2, or (at your option) any later
+ * version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file into combinations with other programs,
+ * and to distribute those combinations without any restriction coming
+ * from the use of this file.  (The General Public License restrictions
+ * do apply in other respects; for example, they cover modification of
+ * the file, and distribution when not linked into a combine
+ * executable.)
+ *
+ * GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GCC; see the file COPYING.  If not, write to the Free
+ * Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifdef L_udivsi3
+#define	DIVISOR		8(%ap)
+#define	DIVIDENT	4(%ap)
+	.align	4
+	.global	__udivsi3
+	.type	__udivsi3, @function
+__udivsi3:
+	.word	0x0004
+	movl	DIVISOR, %r2
+	jlss	JustCompare
+	movl	DIVIDENT, %r0
+	jlss	RealHardDivide
+
+SimpleDivide:
+	divl2	%r2, %r0
+	j	Return
+
+RealHardDivide:
+	clrl	%r1
+	ediv	%r2, %r0, %r0, %r1
+	j	Return
+
+JustCompare:
+	cmpl	DIVIDEND, %r2
+	jgequ	ItIsOne
+
+ItIsntOne:
+	clrl	%r0
+	j	Return
+
+ItIsOne:
+	movl	$1, %r0
+	j	Return
+
+Return:
+	ret
+	.size	__udivsi3, . - __udivsi3
+#undef	DIVISOR
+#undef	DIVIDENT
+#endif /* L_udivsi3 */
+
+
+#ifdef L_umodsi3
+#define	DIVISOR		8(%ap)
+#define	DIVIDENT	4(%ap)
+	.align	4
+	.global	__umodsi3
+	.type	__umodsi3, @function
+__umodsi3:
+	.word	0x0004
+
+	.size	__umodsi3, . - __umodsi3
+#endif /* L_umodsi3 */
+
diff -Nurp src-gcc-fresh/gcc/config/vax/linux.h src-gcc-hacked/gcc/config/vax/linux.h
--- src-gcc-fresh/gcc/config/vax/linux.h	2005-12-09 22:18:14.000000000 +0100
+++ src-gcc-hacked/gcc/config/vax/linux.h	2005-12-09 22:19:00.000000000 +0100
@@ -28,4 +28,8 @@
  * the ELF binary format.
  */
 
+#ifdef HAVE___UDIV___UREM_IN_LIBC
+#undef HAVE___UDIV___UREM_IN_LIBC
+#endif
+
 #endif /* _CONFIG_VAX_LINUX_H */
diff -Nurp src-gcc-fresh/gcc/config/vax/netbsd.h src-gcc-hacked/gcc/config/vax/netbsd.h
--- src-gcc-fresh/gcc/config/vax/netbsd.h	2005-10-28 18:32:14.000000000 +0200
+++ src-gcc-hacked/gcc/config/vax/netbsd.h	2005-12-09 22:19:00.000000000 +0100
@@ -46,3 +46,7 @@ Boston, MA 02110-1301, USA.  */
 /* We use gas, not the UNIX assembler.  */
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT 0
+
+/* BSDs do have __udev and __urem in libc.  */
+#define HAVE___UDIV___UREM_IN_LIBC
+
diff -Nurp src-gcc-fresh/gcc/config/vax/openbsd1.h src-gcc-hacked/gcc/config/vax/openbsd1.h
--- src-gcc-fresh/gcc/config/vax/openbsd1.h	2005-10-28 18:32:14.000000000 +0200
+++ src-gcc-hacked/gcc/config/vax/openbsd1.h	2005-12-09 22:19:00.000000000 +0100
@@ -19,5 +19,9 @@ the Free Software Foundation, 51 Frankli
 Boston, MA 02110-1301, USA.  */
 
 /* Set up definitions before picking up the common openbsd.h file.  */
-#define OBSD_OLD_GAS 
+#define OBSD_OLD_GAS
 #define OBSD_NO_DYNAMIC_LIBRARIES
+
+/* BSDs do have __udiv and __urem in libc.  */
+#define HAVE___UDIV___UREM_IN_LIBC
+
diff -Nurp src-gcc-fresh/gcc/config/vax/openbsd.h src-gcc-hacked/gcc/config/vax/openbsd.h
--- src-gcc-fresh/gcc/config/vax/openbsd.h	2005-10-28 18:32:14.000000000 +0200
+++ src-gcc-hacked/gcc/config/vax/openbsd.h	2005-12-09 22:19:00.000000000 +0100
@@ -44,3 +44,7 @@ Boston, MA 02110-1301, USA.  */
 
 #undef WCHAR_TYPE_SIZE
 #define WCHAR_TYPE_SIZE 32
+
+/* BSDs do have __udiv and __urem in libc.  */
+#define HAVE___UDIV___UREM_IN_LIBC
+
diff -Nurp src-gcc-fresh/gcc/config/vax/t-vax src-gcc-hacked/gcc/config/vax/t-vax
--- src-gcc-fresh/gcc/config/vax/t-vax	1970-01-01 01:00:00.000000000 +0100
+++ src-gcc-hacked/gcc/config/vax/t-vax	2005-12-09 22:19:00.000000000 +0100
@@ -0,0 +1,4 @@
+# LIB1ASMSRC = vax/lib1funcs.S
+# LIB1ASMFUNCS = _udivsi3 _uremsi3
+# LIB1ASMSRC = $(srcdir)/config/udivmod.c $(srcdir)/config/udivmodsi4.c
+LIB2FUNCS_EXTRA = $(srcdir)/config/udivmod.c $(srcdir)/config/udivmodsi4.c
diff -Nurp src-gcc-fresh/gcc/config/vax/vax.c src-gcc-hacked/gcc/config/vax/vax.c
--- src-gcc-fresh/gcc/config/vax/vax.c	2005-10-28 18:32:14.000000000 +0200
+++ src-gcc-hacked/gcc/config/vax/vax.c	2005-12-09 22:19:00.000000000 +0100
@@ -46,13 +46,15 @@ Boston, MA 02110-1301, USA.  */
 
 static void vax_output_function_prologue (FILE *, HOST_WIDE_INT);
 static void vax_file_start (void);
-static void vax_init_libfuncs (void);
 static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
 				 HOST_WIDE_INT, tree);
 static int vax_address_cost_1 (rtx);
 static int vax_address_cost (rtx);
 static bool vax_rtx_costs (rtx, int, int, int *);
 static rtx vax_struct_value_rtx (tree, int);
+#ifdef HAVE___UDIV___UREM_IN_LIBC
+static void vax_init_libfuncs (void);
+#endif
 
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
@@ -66,8 +68,10 @@ static rtx vax_struct_value_rtx (tree, i
 #undef TARGET_ASM_FILE_START_APP_OFF
 #define TARGET_ASM_FILE_START_APP_OFF true
 
+#ifdef HAVE___UDIV___UREM_IN_LIBC
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS vax_init_libfuncs
+#endif
 
 #undef TARGET_ASM_OUTPUT_MI_THUNK
 #define TARGET_ASM_OUTPUT_MI_THUNK vax_output_mi_thunk
@@ -155,6 +166,7 @@ vax_file_start (void)
     fprintf (asm_out_file, "___vax_%c_doubles:\n", ASM_DOUBLE_CHAR);
 }
 
+#ifdef HAVE___UDIV___UREM_IN_LIBC
 /* We can use the BSD C library routines for the libgcc calls that are
    still generated, since that's what they boil down to anyways.  When
    ELF, avoid the user's namespace.  */
@@ -165,6 +177,7 @@ vax_init_libfuncs (void)
   set_optab_libfunc (udiv_optab, SImode, TARGET_ELF ? "*__udiv" : "*udiv");
   set_optab_libfunc (umod_optab, SImode, TARGET_ELF ? "*__urem" : "*urem");
 }
+#endif /* HAVE___UDIV___UREM_IN_LIBC */
 
 /* This is like nonimmediate_operand with a restriction on the type of MEM.  */
 
diff -Nurp src-gcc-fresh/gcc/config.gcc src-gcc-hacked/gcc/config.gcc
--- src-gcc-fresh/gcc/config.gcc	2005-12-09 22:18:14.000000000 +0100
+++ src-gcc-hacked/gcc/config.gcc	2005-12-09 22:19:00.000000000 +0100
@@ -2260,9 +2260,11 @@ vax-*-sysv*)			# VAXen running system V
 	;;
 vax-*-linux-uclibc*)		# VAXen running Linux ELF with uClibc
 	tm_file="${tm_file} elfos.h linux.h vax/elf.h vax/uclinux.h"
+	tmake_file="vax/t-vax"
 	;;
 vax-*-linux*)			# VAXen running Linux ELF with GNU libc
 	tm_file="${tm_file} elfos.h linux.h vax/elf.h vax/linux.h"
+	tmake_file="vax/t-vax"
 	;;
 vax-*-netbsdelf*)
 	tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h"
diff -Nurp src-gcc-fresh/gcc/config/host-linux.c src-gcc-hacked/gcc/config/host-linux.c
--- src-gcc-fresh/gcc/config/host-linux.c	2005-10-28 18:32:26.000000000 +0200
+++ src-gcc-hacked/gcc/config/host-linux.c	2005-11-01 10:36:34.000000000 +0100
@@ -89,8 +89,12 @@
 # define TRY_EMPTY_VM_SPACE	0
 #endif
 
+#ifndef SSIZE_MAX
+# define SSIZE_MAX 4096
+#endif
+
 /* Determine a location where we might be able to reliably allocate SIZE
-   bytes.  FD is the PCH file, though we should return with the file 
+   bytes.  FD is the PCH file, though we should return with the file
    unmapped.  */
 
 static void *


Thanks, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fÃr einen Freien Staat voll Freier BÃrger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

Attachment: signature.asc
Description: Digital signature


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