mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-27 04:55:01 +08:00
re PR target/58314 (SH4 error: 'asm' operand requires impossible reload)
gcc/testsuite/ PR target/58314 * gcc.target/sh/torture/pr58314-2.c: New. * gcc.target/sh/torture/pr58314.c: Don't set -Os option. From-SVN: r219030
This commit is contained in:
parent
0a6f14996a
commit
17839acd9d
@ -1,3 +1,9 @@
|
||||
2014-12-22 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
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 <janus@gcc.gnu.org>
|
||||
|
||||
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 <polacek@redhat.com>
|
||||
|
||||
PR c/63567
|
||||
|
160
gcc/testsuite/gcc.target/sh/torture/pr58314-2.c
Normal file
160
gcc/testsuite/gcc.target/sh/torture/pr58314-2.c
Normal file
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user