URL
https://opencores.org/ocsvn/zipcpu/zipcpu/trunk
Subversion Repositories zipcpu
[/] [zipcpu/] [trunk/] [sw/] [gcc-zippatch.patch] - Rev 209
Compare with Previous | Blame | View Log
diff -Naur '--exclude=*.swp' gcc-6.2.0/config.sub gcc-6.2.0-zip/config.sub
--- gcc-6.2.0/config.sub 2015-12-31 16:13:28.000000000 -0500
+++ gcc-6.2.0-zip/config.sub 2017-01-11 11:07:21.116065311 -0500
@@ -355,6 +355,14 @@
xscaleel)
basic_machine=armel-unknown
;;
+ zip-*-linux*)
+ basic_machine=zip
+ os=-linux
+ ;;
+ zip*)
+ basic_machine=zip-unknown
+ os=-none
+ ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
diff -Naur '--exclude=*.swp' gcc-6.2.0/configure gcc-6.2.0-zip/configure
--- gcc-6.2.0/configure 2016-03-17 18:54:19.000000000 -0400
+++ gcc-6.2.0-zip/configure 2017-02-06 21:54:22.244807700 -0500
@@ -3548,6 +3548,44 @@
ft32-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ noconfigdirs="$noconfigdirs target-boehm-gc"
+ noconfigdirs="$noconfigdirs target-libgfortran"
+ # noconfigdirs="$noconfigdirs target-libsanitizer"
+ # noconfigdirs="$noconfigdirs target-libada"
+ # noconfigdirs="$noconfigdirs target-libatomic"
+ # noconfigdirs="$noconfigdirs target-libcilkrts"
+ # noconfigdirs="$noconfigdirs target-libitm"
+ # noconfigdirs="$noconfigdirs target-libquadmath"
+ # noconfigdirs="$noconfigdirs target-libstdc++-v3"
+ # noconfigdirs="$noconfigdirs target-libssp"
+ # noconfigdirs="$noconfigdirs target-libgo"
+ # noconfigdirs="$noconfigdirs target-libgomp"
+ # noconfigdirs="$noconfigdirs target-libvtv"
+ # noconfigdirs="$noconfigdirs target-libobjc"
+ # target-libgcc
+ # target-liboffloadmic
+ # target-libmpx # Only gets enabled by request
+ # target-libbacktrace
+ # ${libgcj}
+ # target-boehm-gc
+ # target-libada
+ # target-libatomic
+ # target-libcilkrts
+ # target-libgfortran
+ # target-libgo
+ # target-libgomp
+ # target-libitm
+ # target-libobjc
+ # target-libquadmath
+ # target-libsanitizer
+ # target-libstdc++-v3
+ # target-libssp
+ # target-libvtv
+ # target-libgloss
+ # target-newlib
+ ;;
*-*-lynxos*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@@ -3575,6 +3613,9 @@
*-*-aix*)
noconfigdirs="$noconfigdirs target-libgo"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs target-libgo"
+ ;;
esac
fi
@@ -3971,6 +4012,9 @@
vax-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb gprof"
+ ;;
esac
# If we aren't building newlib, then don't build libgloss, since libgloss
@@ -6785,16 +6829,16 @@
# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
if test "x$CFLAGS_FOR_TARGET" = x; then
if test "x${is_cross_compiler}" = xyes; then
- CFLAGS_FOR_TARGET="-g -O2"
+ CFLAGS_FOR_TARGET="-O3"
else
CFLAGS_FOR_TARGET=$CFLAGS
case " $CFLAGS " in
- *" -O2 "*) ;;
- *) CFLAGS_FOR_TARGET="-O2 $CFLAGS_FOR_TARGET" ;;
+ *" -O3 "*) ;;
+ *) CFLAGS_FOR_TARGET="-O3 $CFLAGS_FOR_TARGET" ;;
esac
case " $CFLAGS " in
*" -g "* | *" -g3 "*) ;;
- *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
+ *) CFLAGS_FOR_TARGET="$CFLAGS_FOR_TARGET" ;;
esac
fi
fi
@@ -6802,16 +6846,16 @@
if test "x$CXXFLAGS_FOR_TARGET" = x; then
if test "x${is_cross_compiler}" = xyes; then
- CXXFLAGS_FOR_TARGET="-g -O2"
+ CXXFLAGS_FOR_TARGET="-O3"
else
CXXFLAGS_FOR_TARGET=$CXXFLAGS
case " $CXXFLAGS " in
- *" -O2 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS_FOR_TARGET" ;;
+ *" -O3 "*) ;;
+ *) CXXFLAGS_FOR_TARGET="-O3 $CXXFLAGS_FOR_TARGET" ;;
esac
case " $CXXFLAGS " in
*" -g "* | *" -g3 "*) ;;
- *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
+ *) CXXFLAGS_FOR_TARGET="$CXXFLAGS_FOR_TARGET" ;;
esac
fi
fi
diff -Naur '--exclude=*.swp' gcc-6.2.0/configure.ac gcc-6.2.0-zip/configure.ac
--- gcc-6.2.0/configure.ac 2016-03-17 18:54:19.000000000 -0400
+++ gcc-6.2.0-zip/configure.ac 2017-01-10 12:43:23.819301273 -0500
@@ -884,6 +884,9 @@
ft32-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs ${libgcj}"
+ ;;
*-*-lynxos*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@@ -911,6 +914,9 @@
*-*-aix*)
noconfigdirs="$noconfigdirs target-libgo"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs target-libgo"
+ ;;
esac
fi
@@ -1307,6 +1313,10 @@
vax-*-*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;
+ zip*)
+ noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb gprof ${libgcj}"
+ unsupported_languages="$unsupported_languages fortran"
+ ;;
esac
# If we aren't building newlib, then don't build libgloss, since libgloss
diff -Naur '--exclude=*.swp' gcc-6.2.0/gcc/cfgexpand.c gcc-6.2.0-zip/gcc/cfgexpand.c
--- gcc-6.2.0/gcc/cfgexpand.c 2016-04-27 08:23:50.000000000 -0400
+++ gcc-6.2.0-zip/gcc/cfgexpand.c 2018-06-05 21:18:19.438798488 -0400
@@ -74,6 +74,16 @@
#include "tree-chkp.h"
#include "rtl-chkp.h"
+
+// #define DO_ZIP_DEBUGS
+#ifdef DO_ZIP_DEBUGS
+#include <stdio.h>
+#define ZIP_DEBUG_LINE(STR,RTX) do{fprintf(stderr,"%s;%d/%s\n",__FILE__,__LINE__,STR); zip_debug_rtx(RTX);} while(0)
+extern void zip_debug_rtx(const_rtx);
+#else
+#define ZIP_DEBUG_LINE(STR,RTX)
+#endif
+
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
give the same symbol without quotes for an alternative entry point. You
@@ -1172,7 +1182,7 @@
base_align = crtl->max_used_stack_slot_alignment;
else
base_align = MAX (crtl->max_used_stack_slot_alignment,
- GET_MODE_ALIGNMENT (SImode)
+ GET_MODE_ALIGNMENT (word_mode)
<< ASAN_SHADOW_SHIFT);
}
else
@@ -2225,7 +2235,7 @@
data.asan_vec.safe_push (offset);
/* Leave space for alignment if STRICT_ALIGNMENT. */
if (STRICT_ALIGNMENT)
- alloc_stack_frame_space ((GET_MODE_ALIGNMENT (SImode)
+ alloc_stack_frame_space ((GET_MODE_ALIGNMENT (word_mode)
<< ASAN_SHADOW_SHIFT)
/ BITS_PER_UNIT, 1);
@@ -5745,7 +5755,7 @@
&& (last = get_last_insn ())
&& JUMP_P (last))
{
- rtx dummy = gen_reg_rtx (SImode);
+ rtx dummy = gen_reg_rtx (word_mode);
emit_insn_after_noloc (gen_move_insn (dummy, dummy), last, NULL);
}
diff -Naur '--exclude=*.swp' gcc-6.2.0/gcc/cgraphbuild.c gcc-6.2.0-zip/gcc/cgraphbuild.c
--- gcc-6.2.0/gcc/cgraphbuild.c 2016-01-04 09:30:50.000000000 -0500
+++ gcc-6.2.0-zip/gcc/cgraphbuild.c 2016-12-31 16:39:44.963107994 -0500
@@ -32,6 +32,15 @@
#include "ipa-utils.h"
#include "except.h"
+
+#ifdef DO_ZIP_DEBUGS
+#include <stdio.h>
+#define ZIP_DEBUG_LINE(STR,RTX) do{fprintf(stderr,"%s;%d/%s\n",__FILE__,__LINE__,STR); zip_debug_rtx(RTX);} while(0)
+extern void zip_debug_rtx(const_rtx);
+#else
+#define ZIP_DEBUG_LINE(STR,RTX)
+#endif
+
/* Context of record_reference. */
struct record_reference_ctx
{
diff -Naur '--exclude=*.swp' gcc-6.2.0/gcc/combine.c gcc-6.2.0-zip/gcc/combine.c
--- gcc-6.2.0/gcc/combine.c 2016-08-08 06:06:15.000000000 -0400
+++ gcc-6.2.0-zip/gcc/combine.c 2017-02-03 09:25:19.676720321 -0500
@@ -103,6 +103,15 @@
#include "rtl-iter.h"
#include "print-rtl.h"
+#define DO_ZIP_DEBUGS
+#ifdef DO_ZIP_DEBUGS
+#include <stdio.h>
+#define ZIP_DEBUG_LINE(STR,RTX) do{fprintf(stderr,"%s:%d/%s\n",__FILE__,__LINE__,STR); zip_debug_rtx(RTX);} while(0)
+extern void zip_debug_rtx(const_rtx);
+#else
+#define ZIP_DEBUG_LINE(STR,RTX)
+#endif
+
#ifndef LOAD_EXTEND_OP
#define LOAD_EXTEND_OP(M) UNKNOWN
#endif
diff -Naur '--exclude=*.swp' gcc-6.2.0/gcc/common/config/zip/zip-common.c gcc-6.2.0-zip/gcc/common/config/zip/zip-common.c
--- gcc-6.2.0/gcc/common/config/zip/zip-common.c 1969-12-31 19:00:00.000000000 -0500
+++ gcc-6.2.0-zip/gcc/common/config/zip/zip-common.c 2017-01-11 09:41:34.483106099 -0500
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: common/config/zip/zip-common.c
+//
+// Project: Zip CPU backend for the GNU Compiler Collection
+//
+// Purpose: To eliminate the frame register automatically.
+//
+// Creator: Dan Gisselquist, Ph.D.
+// Gisselquist Technology, LLC
+//
+////////////////////////////////////////////////////////////////////////////////
+//
+// Copyright (C) 2016-2017, Gisselquist Technology, LLC
+//
+// This program is free software (firmware): 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 3 of the License, or (at
+// your option) any later version.
+//
+// This program is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY 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 this program. (It's in the $(ROOT)/doc directory, run make with no
+// target there if the PDF file isn't present.) If not, see
+// <http://www.gnu.org/licenses/> for a copy.
+//
+// License: GPL, v3, as defined and found on www.gnu.org,
+// http://www.gnu.org/licenses/gpl.html
+//
+//
+////////////////////////////////////////////////////////////////////////////////
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "common/common-target.h"
+#include "common/common-target-def.h"
+
+static const struct default_options zip_option_optimization_table[] =
+ {
+ { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
+ { OPT_LEVELS_NONE, 0, NULL, 0 }
+ };
+
+#undef TARGET_OPTION_OPTIMIZATION_TABLE
+#define TARGET_OPTION_OPTIMIZATION_TABLE zip_option_optimization_table
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff -Naur '--exclude=*.swp' gcc-6.2.0/gcc/config/zip/genzipops gcc-6.2.0-zip/gcc/config/zip/genzipops
--- gcc-6.2.0/gcc/config/zip/genzipops 1969-12-31 19:00:00.000000000 -0500
+++ gcc-6.2.0-zip/gcc/config/zip/genzipops 2018-03-22 18:33:09.823726748 -0400
@@ -0,0 +1,201 @@
+ELF >