diff options
author | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2015-09-09 17:33:15 +0000 |
---|---|---|
committer | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2015-09-09 17:33:15 +0000 |
commit | 1778b45e337c6590e2f0b2d44f676715843c5f7f (patch) | |
tree | 42eaafb1cab5181b045d9055d875991c909f18f6 | |
parent | b9fc58968940f8cc8afa3cc066e09a98e57a786f (diff) | |
download | gcc-5-1778b45e337c6590e2f0b2d44f676715843c5f7f.tar.gz |
* Fix PR target/67143 (AArch64), ICE on valid code. LP: #1481333.
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-5@8220 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/patches/pr67143.diff | 143 | ||||
-rw-r--r-- | debian/rules.patch | 1 |
3 files changed, 145 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 64e7ae9..9ca3f92 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ gcc-5 (5.2.1-17) UNRELEASED; urgency=medium * Fix stage1 cross build for KFreeBSD. Closes: #796901. * libgo: Fix PR go/67508, rewrite lfstack packing/unpacking to look more like that in Go (Michael Hudson). LP: #1472650. + * Fix PR target/67143 (AArch64), ICE on valid code. LP: #1481333. [ Aurelien Jarno ] * Use --with-mips-plt on mips*. diff --git a/debian/patches/pr67143.diff b/debian/patches/pr67143.diff new file mode 100644 index 0000000..db7bd31 --- /dev/null +++ b/debian/patches/pr67143.diff @@ -0,0 +1,143 @@ +# DP: Fix PR target/67143 (AArch64), ICE on valid code. + +gcc/ + +2015-08-14 Matthew Wahab <matthew.wahab@arm.com> + + PR target/67143 + * config/aarch64/atomics.md (atomic_<optab><mode>): Replace + 'lconst_atomic' with 'const_atomic'. + (atomic_fetch_<optab><mode>): Likewise. + (atomic_<optab>_fetch<mode>): Likewise. + * config/aarch64/iterators.md (lconst-atomic): Move below + 'const_atomic'. + (const_atomic): New. + +gcc/testsuite/ + +2015-08-14 Matthew Wahab <matthew.wahab@arm.com> + Matthias Klose <doko@debian.org> + + PR target/67143 + * gcc.c-torture/compile/pr67143.c: New + * gcc.target/aarch64/atomic-op-imm.c + (atomic_fetch_add_negative_RELAXED): New. + (atomic_fetch_sub_negative_ACQUIRE): New. + +Index: gcc/testsuite/gcc.target/aarch64/atomic-op-imm.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/aarch64/atomic-op-imm.c (revision 226894) ++++ a/src/gcc/testsuite/gcc.target/aarch64/atomic-op-imm.c (revision 226895) +@@ -16,6 +16,18 @@ + } + + int ++atomic_fetch_add_negative_RELAXED () ++{ ++ return __atomic_fetch_add (&v, -4096, __ATOMIC_RELAXED); ++} ++ ++int ++atomic_fetch_sub_negative_ACQUIRE () ++{ ++ return __atomic_fetch_sub (&v, -4096, __ATOMIC_ACQUIRE); ++} ++ ++int + atomic_fetch_and_SEQ_CST () + { + return __atomic_fetch_and (&v, 4096, __ATOMIC_SEQ_CST); +@@ -75,4 +87,4 @@ + return __atomic_or_fetch (&v, 4096, __ATOMIC_CONSUME); + } + +-/* { dg-final { scan-assembler-times "\tw\[0-9\]+, w\[0-9\]+, #*4096" 12 } } */ ++/* { dg-final { scan-assembler-times "\tw\[0-9\]+, w\[0-9\]+, #*4096" 14 } } */ +Index: gcc/testsuite/gcc.c-torture/compile/pr67143.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/compile/pr67143.c (revision 0) ++++ a/src/gcc/testsuite/gcc.c-torture/compile/pr67143.c (revision 226895) +@@ -0,0 +1,21 @@ ++long a, c; ++int b; ++int d; ++void ut_dbg_assertion_failed() __attribute__((noreturn)); ++long dict_index_is_spatial(int *); ++void btr_block_get_func(char *); ++long btr_page_get_level_low(unsigned char *); ++void btr_validate_level(long p1) { ++ unsigned char *e; ++ while (p1 != btr_page_get_level_low(e)) { ++ if (__builtin_expect(b, 0)) ++ ut_dbg_assertion_failed(); ++ if (dict_index_is_spatial(&d)) ++ while (c != 5535) { ++ __sync_add_and_fetch(&a, 536870912); ++ btr_block_get_func(""); ++ } ++ } ++ for (long i; i; ++i) ++ btr_validate_level(-i); ++} +Index: gcc/config/aarch64/atomics.md +=================================================================== +--- a/src/gcc/config/aarch64/atomics.md (revision 226894) ++++ a/src/gcc/config/aarch64/atomics.md (revision 226895) +@@ -171,7 +171,7 @@ + [(set (match_operand:ALLI 0 "aarch64_sync_memory_operand" "+Q") + (unspec_volatile:ALLI + [(atomic_op:ALLI (match_dup 0) +- (match_operand:ALLI 1 "<atomic_op_operand>" "r<lconst_atomic>")) ++ (match_operand:ALLI 1 "<atomic_op_operand>" "r<const_atomic>")) + (match_operand:SI 2 "const_int_operand")] ;; model + UNSPECV_ATOMIC_OP)) + (clobber (reg:CC CC_REGNUM)) +@@ -216,7 +216,7 @@ + (set (match_dup 1) + (unspec_volatile:ALLI + [(atomic_op:ALLI (match_dup 1) +- (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>")) ++ (match_operand:ALLI 2 "<atomic_op_operand>" "r<const_atomic>")) + (match_operand:SI 3 "const_int_operand")] ;; model + UNSPECV_ATOMIC_OP)) + (clobber (reg:CC CC_REGNUM)) +@@ -261,7 +261,7 @@ + [(set (match_operand:ALLI 0 "register_operand" "=&r") + (atomic_op:ALLI + (match_operand:ALLI 1 "aarch64_sync_memory_operand" "+Q") +- (match_operand:ALLI 2 "<atomic_op_operand>" "r<lconst_atomic>"))) ++ (match_operand:ALLI 2 "<atomic_op_operand>" "r<const_atomic>"))) + (set (match_dup 1) + (unspec_volatile:ALLI + [(match_dup 1) (match_dup 2) +Index: gcc/config/aarch64/iterators.md +=================================================================== +--- a/src/gcc/config/aarch64/iterators.md (revision 226894) ++++ a/src/gcc/config/aarch64/iterators.md (revision 226895) +@@ -345,9 +345,6 @@ + ;; Attribute to describe constants acceptable in logical operations + (define_mode_attr lconst [(SI "K") (DI "L")]) + +-;; Attribute to describe constants acceptable in atomic logical operations +-(define_mode_attr lconst_atomic [(QI "K") (HI "K") (SI "K") (DI "L")]) +- + ;; Map a mode to a specific constraint character. + (define_mode_attr cmode [(QI "q") (HI "h") (SI "s") (DI "d")]) + +@@ -843,6 +840,16 @@ + (plus "aarch64_plus_operand") + (minus "aarch64_plus_operand")]) + ++;; Constants acceptable for atomic operations. ++;; This definition must appear in this file before the iterators it refers to. ++(define_code_attr const_atomic ++ [(plus "IJ") (minus "IJ") ++ (xor "<lconst_atomic>") (ior "<lconst_atomic>") ++ (and "<lconst_atomic>")]) ++ ++;; Attribute to describe constants acceptable in atomic logical operations ++(define_mode_attr lconst_atomic [(QI "K") (HI "K") (SI "K") (DI "L")]) ++ + ;; ------------------------------------------------------------------- + ;; Int Iterators. + ;; ------------------------------------------------------------------- diff --git a/debian/rules.patch b/debian/rules.patch index dd98282..d4c427f 100644 --- a/debian/rules.patch +++ b/debian/rules.patch @@ -90,6 +90,7 @@ debian_patches += \ pr66368 \ pr67280 \ pr67508 \ + pr67143 \ ifeq ($(libstdcxx_abi),new) debian_patches += libstdc++-functexcept |