diff options
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | 0001-Use-GET_MODE_BITSIZE-when-setting-TYPE_SIZE.patch | 124 | ||||
-rw-r--r-- | PKGBUILD | 34 | ||||
-rw-r--r-- | revert-pr71289.patch | 20 |
4 files changed, 171 insertions, 25 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Mon Mar 6 19:13:19 UTC 2017 +# Wed Jul 26 19:38:52 UTC 2017 pkgbase = msp430-elf-gcc pkgdesc = The GNU Compiler Collection for the msp430-elf target. - pkgver = 6.3.0 - pkgrel = 2 + pkgver = 7.1.0 + pkgrel = 1 url = http://gcc.gnu.org arch = i686 arch = x86_64 @@ -23,14 +23,14 @@ pkgbase = msp430-elf-gcc options = zipman options = docs options = !strip - source = ftp://gcc.gnu.org/pub/gcc/releases/gcc-6.3.0/gcc-6.3.0.tar.bz2 source = http://isl.gforge.inria.fr/isl-0.18.tar.bz2 - source = fix-insn-delay_cycles_32x.patch - source = sync-devicelist.patch - sha256sums = f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f + source = ftp://gcc.gnu.org/pub/gcc/releases/gcc-7.1.0/gcc-7.1.0.tar.bz2 + source = revert-pr71289.patch + source = 0001-Use-GET_MODE_BITSIZE-when-setting-TYPE_SIZE.patch sha256sums = 6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b - sha256sums = 0cd87771d1fd8ec5d0c413ae8c18b9b2599f2c66a0fa8b5fd4aa2f01ac1b5f86 - sha256sums = c9fdb1ac5f86dcbde673c0aed448a5e61d706fc4cbfa417f91be95e292cb5c26 + sha256sums = 8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17 + sha256sums = 836ecb799c88b1c4db7e6ef2df72437a8fe162d1a2d3fb395198fba702f7d9d6 + sha256sums = 28f39dd3ef931d87de1eccf7700406c5b76fa7a6ecf47cfb3f199b33cd1fdf02 pkgname = msp430-elf-gcc diff --git a/0001-Use-GET_MODE_BITSIZE-when-setting-TYPE_SIZE.patch b/0001-Use-GET_MODE_BITSIZE-when-setting-TYPE_SIZE.patch new file mode 100644 index 000000000000..688d8d1ce39a --- /dev/null +++ b/0001-Use-GET_MODE_BITSIZE-when-setting-TYPE_SIZE.patch @@ -0,0 +1,124 @@ +From 81ee936dcdde4f4a7d4036479dbbff77da1e72bb Mon Sep 17 00:00:00 2001 +From: Jozef Lawrynowicz <jozef.l@somniumtech.com> +Date: Wed, 12 Apr 2017 14:45:45 +0000 +Subject: [PATCH] Use GET_MODE_BITSIZE when setting TYPE_SIZE + +2017-05-XX Jozef Lawrynowicz <jozef.l@somniumtech.com> + + gcc/ + PR target/78849 + * stor-layout.c (initialize_sizetypes): Use GET_MODE_BITSIZE when setting TYPE_SIZE. + * tree.c (build_common_tree_nodes): Likewise. + + gcc/testsuite + PR target/78849 + * gcc.target/msp430/pr78849.c: New test. + * gcc.target/msp430/msp430.exp: Remove -pedantic-errors option from DEFAULT_CFLAGS. +--- + gcc/stor-layout.c | 5 +++-- + gcc/testsuite/gcc.target/msp430/msp430.exp | 13 +++++++++---- + gcc/testsuite/gcc.target/msp430/pr78849.c | 21 +++++++++++++++++++++ + gcc/tree.c | 6 ++++-- + 4 files changed, 37 insertions(+), 8 deletions(-) + create mode 100644 gcc/testsuite/gcc.target/msp430/pr78849.c + +diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c +index 10e9a32..1dbaba0 100644 +--- a/gcc/stor-layout.c ++++ b/gcc/stor-layout.c +@@ -2602,13 +2602,14 @@ initialize_sizetypes (void) + /* Now layout both types manually. */ + SET_TYPE_MODE (sizetype, smallest_mode_for_size (precision, MODE_INT)); + SET_TYPE_ALIGN (sizetype, GET_MODE_ALIGNMENT (TYPE_MODE (sizetype))); +- TYPE_SIZE (sizetype) = bitsize_int (precision); ++ TYPE_SIZE (sizetype) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (sizetype))); + TYPE_SIZE_UNIT (sizetype) = size_int (GET_MODE_SIZE (TYPE_MODE (sizetype))); + set_min_and_max_values_for_integral_type (sizetype, precision, UNSIGNED); + + SET_TYPE_MODE (bitsizetype, smallest_mode_for_size (bprecision, MODE_INT)); + SET_TYPE_ALIGN (bitsizetype, GET_MODE_ALIGNMENT (TYPE_MODE (bitsizetype))); +- TYPE_SIZE (bitsizetype) = bitsize_int (bprecision); ++ TYPE_SIZE (bitsizetype) ++ = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (bitsizetype))); + TYPE_SIZE_UNIT (bitsizetype) + = size_int (GET_MODE_SIZE (TYPE_MODE (bitsizetype))); + set_min_and_max_values_for_integral_type (bitsizetype, bprecision, UNSIGNED); +diff --git a/gcc/testsuite/gcc.target/msp430/msp430.exp b/gcc/testsuite/gcc.target/msp430/msp430.exp +index e54d531..ce5c3dc 100644 +--- a/gcc/testsuite/gcc.target/msp430/msp430.exp ++++ b/gcc/testsuite/gcc.target/msp430/msp430.exp +@@ -24,10 +24,15 @@ if { ![istarget msp430-*-*] } then { + # Load support procs. + load_lib gcc-dg.exp + +-# If a testcase doesn't have special options, use these. ++# The '-pedantic-errors' option in the global variable DEFAULT_CFLAGS that is ++# set by other drivers causes an error when the __int20 type is used, so remove ++# this option from DEFAULT_CFLAGS for the msp430 tests. + global DEFAULT_CFLAGS +-if ![info exists DEFAULT_CFLAGS] then { +- set DEFAULT_CFLAGS "" ++if [info exists DEFAULT_CFLAGS] then { ++ set MSP430_DEFAULT_CFLAGS \ ++ [ string map { "-pedantic-errors" "" } $DEFAULT_CFLAGS ] ++} else { ++ set MSP430_DEFAULT_CFLAGS "" + } + + # Initialize `dg'. +@@ -35,7 +40,7 @@ dg-init + + # Main loop. + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ +- "" $DEFAULT_CFLAGS ++ "" $MSP430_DEFAULT_CFLAGS + + # All done. + dg-finish +diff --git a/gcc/testsuite/gcc.target/msp430/pr78849.c b/gcc/testsuite/gcc.target/msp430/pr78849.c +new file mode 100644 +index 0000000..97792e9 +--- /dev/null ++++ b/gcc/testsuite/gcc.target/msp430/pr78849.c +@@ -0,0 +1,21 @@ ++/* { dg-do link } */ ++ ++struct s_1 ++{ ++ __int20 array[2]; ++ char elem; ++}; ++ ++struct s_1 instance = ++{ ++ { ++ 0, ++ 1, ++ }, ++ 2 ++}; ++ ++int main (void) ++{ ++ return 0; ++} +diff --git a/gcc/tree.c b/gcc/tree.c +index 72dbba4..12f2635 100644 +--- a/gcc/tree.c ++++ b/gcc/tree.c +@@ -10285,8 +10285,10 @@ build_common_tree_nodes (bool signed_char) + { + int_n_trees[i].signed_type = make_signed_type (int_n_data[i].bitsize); + int_n_trees[i].unsigned_type = make_unsigned_type (int_n_data[i].bitsize); +- TYPE_SIZE (int_n_trees[i].signed_type) = bitsize_int (int_n_data[i].bitsize); +- TYPE_SIZE (int_n_trees[i].unsigned_type) = bitsize_int (int_n_data[i].bitsize); ++ TYPE_SIZE (int_n_trees[i].signed_type) ++ = bitsize_int (GET_MODE_BITSIZE (int_n_data[i].m)); ++ TYPE_SIZE (int_n_trees[i].unsigned_type) ++ = bitsize_int (GET_MODE_BITSIZE (int_n_data[i].m)); + + if (int_n_data[i].bitsize > LONG_LONG_TYPE_SIZE + && int_n_enabled_p[i]) +-- +1.8.3.1 + @@ -2,9 +2,9 @@ _target="msp430-elf" pkgname=${_target}-gcc -pkgver=6.3.0 +pkgver=7.1.0 _islver=0.18 -pkgrel=2 +pkgrel=1 pkgdesc="The GNU Compiler Collection for the ${_target} target." arch=(i686 x86_64) license=('GPL' 'LGPL') @@ -14,28 +14,30 @@ options=('staticlibs' '!buildflags' '!libtool' '!emptydirs' 'zipman' 'docs' '!st conflicts=("${_target}-gcc-stage1") replaces=("${_target}-gcc-stage1") provides=("${_target}-gcc-stage1") -source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2 - http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2 - fix-insn-delay_cycles_32x.patch - sync-devicelist.patch) -sha256sums=('f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f' - '6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b' - '0cd87771d1fd8ec5d0c413ae8c18b9b2599f2c66a0fa8b5fd4aa2f01ac1b5f86' - 'c9fdb1ac5f86dcbde673c0aed448a5e61d706fc4cbfa417f91be95e292cb5c26') +source=(http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2 + ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2 + revert-pr71289.patch + 0001-Use-GET_MODE_BITSIZE-when-setting-TYPE_SIZE.patch) +sha256sums=('6b8b0fd7f81d0a957beb3679c81bbb34ccc7568d5682844d8924424a0dadcb1b' + '8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17' + '836ecb799c88b1c4db7e6ef2df72437a8fe162d1a2d3fb395198fba702f7d9d6' + '28f39dd3ef931d87de1eccf7700406c5b76fa7a6ecf47cfb3f199b33cd1fdf02') + prepare() { cd "${srcdir}/gcc-${pkgver}" [[ -L isl ]] && rm -f isl ln -s ../isl-${_islver} isl - # synchronize device list with binutils - patch -p1 < ../sync-devicelist.patch - - # this did not make it into 6.3.0 - patch -p1 < ../fix-insn-delay_cycles_32x.patch - [[ -d gcc-build ]] && rm -rf gcc-build mkdir gcc-build + + # Until pr79242 is resolved, revert pr71289. Yes, the underlying bug is still + # there, but I do not have the time to investigate it and fix it at the + # moment. Patches/comments are welcome. + patch -p1 < ../revert-pr71289.patch + # while we are at it, fix pr78849 + patch -p1 < ../0001-Use-GET_MODE_BITSIZE-when-setting-TYPE_SIZE.patch } build() { diff --git a/revert-pr71289.patch b/revert-pr71289.patch new file mode 100644 index 000000000000..298386e65d1e --- /dev/null +++ b/revert-pr71289.patch @@ -0,0 +1,20 @@ +diff -rupN gcc-7.1.0-pristine/gcc/match.pd gcc-7.1.0-modified/gcc/match.pd +--- gcc-7.1.0-pristine/gcc/match.pd 2017-04-04 05:06:04.000000000 -0400 ++++ gcc-7.1.0-modified/gcc/match.pd 2017-07-26 10:46:14.079911462 -0400 +@@ -3071,16 +3071,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) + && types_match (TREE_TYPE (@0), TREE_TYPE (@1))) + (out (imagpart @2) { build_zero_cst (TREE_TYPE (@0)); })))) + +-/* For unsigned operands, -1 / B < A checks whether A * B would overflow. +- Simplify it to __builtin_mul_overflow (A, B, <unused>). */ +-(for cmp (lt ge) +- out (ne eq) +- (simplify +- (cmp:c (trunc_div:s integer_all_onesp @1) @0) +- (if (TYPE_UNSIGNED (TREE_TYPE (@0)) && !VECTOR_TYPE_P (TREE_TYPE (@0))) +- (with { tree t = TREE_TYPE (@0), cpx = build_complex_type (t); } +- (out (imagpart (IFN_MUL_OVERFLOW:cpx @0 @1)) { build_zero_cst (t); }))))) +- + /* Simplification of math builtins. These rules must all be optimizations + as well as IL simplifications. If there is a possibility that the new + form could be a pessimization, the rule should go in the canonicalization |