From 03d5ebc23720af3c24da27bda6858c394d5cb54f Mon Sep 17 00:00:00 2001 From: olegendo Date: Mon, 22 Dec 2014 18:53:44 +0000 Subject: [PATCH] gcc/testsuite/ PR target/58314 * gcc.target/sh/torture/pr58314-2.c: New. * gcc.target/sh/torture/pr58314.c: Don't set -Os option. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219030 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 7 +- gcc/testsuite/gcc.target/sh/torture/pr58314-2.c | 160 ++++++++++++++++++++++++ gcc/testsuite/gcc.target/sh/torture/pr58314.c | 8 +- 3 files changed, 171 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/sh/torture/pr58314-2.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e756a1738f0..525937517fd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-12-22 Oleg Endo + + PR target/58314 + * gcc.target/sh/torture/pr58314-2.c: New. + * gcc.target/sh/torture/pr58314.c: Don't set -Os option. + 2014-12-22 Janus Weil PR fortran/63363 @@ -6551,7 +6557,6 @@ * gcc.dg/attr-isr.c: Move SH specific test to ... * gcc.target/sh/attr-isr.c: ... here. ->>>>>>> .r217525 2014-10-17 Marek Polacek PR c/63567 diff --git a/gcc/testsuite/gcc.target/sh/torture/pr58314-2.c b/gcc/testsuite/gcc.target/sh/torture/pr58314-2.c new file mode 100644 index 00000000000..a617c6e0c36 --- /dev/null +++ b/gcc/testsuite/gcc.target/sh/torture/pr58314-2.c @@ -0,0 +1,160 @@ +/* { dg-do compile } */ + +struct unipair +{ + unsigned short unicode; + unsigned short fontpos; +}; + +struct __large_struct +{ + unsigned long buf[100]; +}; + +struct vc_data +{ + unsigned long *vc_uni_pagedir_loc; +}; + +struct uni_pagedir +{ + unsigned short **uni_pgdir[32]; +}; + +void con_get_unimap (struct vc_data *vc, unsigned short ct, unsigned short *uct, + struct unipair *list) +{ + int i, j, k, ect; + unsigned short **p1, *p2; + struct uni_pagedir *p; + + ect = 0; + + if (*vc->vc_uni_pagedir_loc) + { + p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; + for (i = 0; i < 32; i++) + if ((p1 = p->uni_pgdir[i])) + for (j = 0; j < 32; j++) + if ((p2 = *(p1++))) + for (k = 0; k < 64; k++) + { + if (*p2 < 512 && ect++ < ct) + { + { + long __pu_err; + __typeof__(*((&list->unicode))) *__pu_addr = ((&list->unicode)); + __typeof__(*((&list->unicode))) __pu_val = + ((unsigned short)((i<<11)+(j<<6)+k)); + __pu_err = 0; + switch ((sizeof(*(&list->unicode)))) + { + case 1: + __asm__ __volatile__ ( + "1:\n\t" + "mov." "b" " %1, %2\n\t" + "2:\n" + ".section .fixup,\"ax\"\n" + "3:\n\t" + "mov.l 4f, %0\n\t" + "jmp @%0\n\t" + " mov %3, %0\n\t" + ".balign 4\n" + "4: .long 2b\n\t" + ".previous\n" + ".section __ex_table,\"a\"\n\t" + ".long 1b, 3b\n\t" + ".previous" + : "=&r" (__pu_err) + : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))), + "i" (-14), "0" (__pu_err) : "memory" ); + + break; + + case 2: + __asm__ __volatile__ ( + "1:\n\t" + "mov." "w" " %1, %2\n\t" + "2:\n" + ".section .fixup,\"ax\"\n" + "3:\n\t" + "mov.l 4f, %0\n\t" + "jmp @%0\n\t" + " mov %3, %0\n\t" + ".balign 4\n" + "4: .long 2b\n\t" + ".previous\n" + ".section __ex_table,\"a\"\n\t" + ".long 1b, 3b\n\t" + ".previous" + : "=&r" (__pu_err) + : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))), + "i" (-14), "0" (__pu_err) : "memory" ); + break; + + default: + break; + } + } + + + { + long __pu_err; + __typeof__(*((&list->fontpos))) *__pu_addr = ((&list->fontpos)); + __typeof__(*((&list->fontpos))) __pu_val = ((unsigned short) *p2); + __pu_err = 0; + switch ((sizeof(*(&list->fontpos)))) + { + case 1: + __asm__ __volatile__ ( + "1:\n\t" + "mov." "b" " %1, %2\n\t" + "2:\n" + ".section .fixup,\"ax\"\n" + "3:\n\t" + "mov.l 4f, %0\n\t" + "jmp @%0\n\t" + " mov %3, %0\n\t" + ".balign 4\n" + "4: .long 2b\n\t" + ".previous\n" + ".section __ex_table,\"a\"\n\t" + ".long 1b, 3b\n\t" + ".previous" + : "=&r" (__pu_err) + : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))), + "i" (-14), "0" (__pu_err) : "memory" ); + break; + + case 2: + __asm__ __volatile__ ( + "1:\n\t" + "mov." "w" " %1, %2\n\t" + "2:\n" + ".section .fixup,\"ax\"\n" + "3:\n\t" + "mov.l 4f, %0\n\t" + "jmp @%0\n\t" + " mov %3, %0\n\t" + ".balign 4\n" + "4: .long 2b\n\t" + ".previous\n" + ".section __ex_table,\"a\"\n\t" + ".long 1b, 3b\n\t" + ".previous" + : "=&r" (__pu_err) + : "r" (__pu_val), "m" ((*(struct __large_struct *)(__pu_addr))), + "i" (-14), "0" (__pu_err) : "memory" ); + break; + + default: + break; + } + } + + list++; + } + p2++; + } + } +} diff --git a/gcc/testsuite/gcc.target/sh/torture/pr58314.c b/gcc/testsuite/gcc.target/sh/torture/pr58314.c index 5f76b6af5c2..88505467a23 100644 --- a/gcc/testsuite/gcc.target/sh/torture/pr58314.c +++ b/gcc/testsuite/gcc.target/sh/torture/pr58314.c @@ -1,13 +1,15 @@ +/* { dg-additional-options "-std=gnu99" } */ /* { dg-do compile } */ -/* { dg-options "-Os" } */ typedef unsigned short __u16; typedef unsigned int __u32; - typedef signed short s16; -static inline __attribute__((always_inline)) __attribute__((__const__)) __u16 __arch_swab16(__u16 x) +static inline +__attribute__((always_inline)) +__attribute__((__const__)) +__u16 __arch_swab16(__u16 x) { __asm__( "swap.b %1, %0" -- 2.11.4.GIT