Re: ARC port (1/5): configuration file patches

2012-10-24 Thread Joseph S. Myers
On Tue, 23 Oct 2012, Joern Rennecke wrote:

 + tm_file=dbxelf.h elfos.h linux.h  ${tm_file}

Should be using gnu-user.h linux.h glibc-stdint.h, not linux.h on its own.

-- 
Joseph S. Myers
jos...@codesourcery.com


ARC port (1/5): configuration file patches

2012-10-23 Thread Joern Rennecke

Prerequisites to allow the port to build properly: the lock_length attribute:

http://gcc.gnu.org/ml/gcc-patches/2012-10/msg01890.html
http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02120.html

And from Easwaran Raman  era...@google.com:
PR middle-end/54957
* optabs.c (emit_cmp_and_jump_insn_1): Remove bogus assert.
* stmt.c (get_outgoing_edge_probs): Check default_edge / stmt_bb
for NULL before dereferencing.
(emit_case_dispatch_table): Check default_edge for NULL before
dereferencing.
Provide sane basic block parameter to emit_case_dispatch_table.

http://gcc.gnu.org/bugzilla/attachment.cgi?id=28466

For testing the ARC port, most recently I have been using revision
192641 as a GCC baseline.

The other pieces of the toolchain can be found at:
https://github.com/foss-for-synopsys-dwc-arc-processors
There is also a gcc port there, but it's an older one, based on GCC 4.4 .
The intention is to eventually contribute all parts of the GNU toolchain
to the FSF, but some pieces need redesigning first, e.g. variable size
fragment handling (or the current lack thereof) in the gas port.

I hope I can polish up the port a bit more before the 4.8 code feature
freeze, but right now the priority is get the required infrastructure for
branch shortening hashed out.  And for this, it is useful for everyone
to be able to look at the ARC port - so here it is.
libgcc:

2012-10-09  Joern Rennecke  joern.renne...@embecosm.com

* config.host (arc-*-elf*, arc*-*-linux-uclibc*): New configurations.
gcc:

2012-10-09  Joern Rennecke  joern.renne...@embecosm.com
Brendan Kehoe  bren...@zen.org

* config.gcc (arc-*-elf*, arc*-*-linux-uclibc*): New configurations.

gcc/testsuite:

2012-08-17  Joern Rennecke  joern.renne...@embecosm.com

* gcc.c-torture/execute/20101011-1.c [__arc__] (DO_TEST): Define as 0.

libstdc++-v3:

2012-08-16  Joern Rennecke  joern.renne...@embecosm.com
* acinclude.m4 (GLIBCXX_ENABLE_SJLJ_EXCEPTIONS): Also check for
_Unwind_SjLj_Register when deciding if to set enable_sjlj_exceptions.
* configure: Regenerate.

Index: libgcc/config.host
===
--- libgcc/config.host  (revision 2572)
+++ libgcc/config.host  (working copy)
@@ -303,6 +303,14 @@
extra_parts=$extra_parts vms-dwarf2.o vms-dwarf2eh.o
md_unwind_header=alpha/vms-unwind.h
;;
+arc-*-elf*)
+   tmake_file=arc/t-arc-newlib arc/t-arc
+   extra_parts=crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o 
libgmon.a crtg.o crtgend.o
+   ;;
+arc*-*-linux-uclibc*)
+   tmake_file=${tmake_file} t-slibgcc-libgcc t-slibgcc-nolc-override 
arc/t-arc700-uClibc arc/t-arc
+   extra_parts=crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o 
libgmon.a crtg.o crtgend.o
+   ;;
 arm-wrs-vxworks)
tmake_file=$tmake_file arm/t-arm arm/t-vxworks t-fdpbit
extra_parts=$extra_parts crti.o crtn.o
Index: gcc/testsuite/gcc.c-torture/execute/20101011-1.c
===
--- gcc/testsuite/gcc.c-torture/execute/20101011-1.c(revision 2572)
+++ gcc/testsuite/gcc.c-torture/execute/20101011-1.c(working copy)
@@ -36,6 +36,9 @@
 #elif defined (__CRIS__)
   /* No SIGFPE for CRIS integer division.  */
 # define DO_TEST 0
+#elif defined (__arc__)
+  /* No SIGFPE for ARC integer division.  */
+# define DO_TEST 0
 #elif defined (__arm__)  defined (__ARM_EABI__)
 # ifdef __ARM_ARCH_EXT_IDIV__
   /* Hardware division instructions may not trap, and handle trapping
Index: gcc/config.gcc
===
--- gcc/config.gcc  (revision 2572)
+++ gcc/config.gcc  (working copy)
@@ -813,6 +813,39 @@
tm_file=${tm_file} vms/vms.h alpha/vms.h
tmake_file=${tmake_file} alpha/t-vms
;;
+arc-*-elf*)
+   extra_headers=arc-simd.h
+   tm_file=dbxelf.h elfos.h newlib-stdint.h ${tm_file}
+   tmake_file=arc/t-arc-newlib arc/t-arc
+   case x${with_cpu} in
+ xarc600|xarc601|xarc700)
+   target_cpu_default=TARGET_CPU_$with_cpu
+   ;;
+   esac
+   ;;
+arc*-*-linux-uclibc*)
+   extra_headers=arc-simd.h
+   tm_file=dbxelf.h elfos.h linux.h  ${tm_file}
+   tmake_file=arc/t-arc-uClibc arc/t-arc
+   case x${with_cpu} in
+ xarc600|xarc601|xarc700)
+   target_cpu_default=TARGET_CPU_$with_cpu
+   ;;
+   esac
+   if test x${with_endian} = x; then
+   case ${target} in
+   arc*be-*-* | arc*eb-*-*)with_endian=big ;;
+   *)  with_endian=little ;;
+   esac
+   fi
+   case ${with_endian} in
+   big|little) ;;
+   *)  echo with_endian=${with_endian} not supported.; exit 1 ;;
+   esac
+   case ${with_endian} in
+   big*)