From e4f2cd43ec2076e9a84f611c8a72454e34975e0c Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Thu, 31 Aug 2006 07:43:36 +0000 Subject: [PATCH] re PR target/24367 (unrecognizable insn with -fPIC -O2 -funroll-loops) 2006-08-31 Andreas Krebbel PR target/24367 * config/s390/s390.md ("movsi", "movdi" expander): Accept rtxes like r12 + SYMBOLIC_CONST. 2006-08-31 Andreas Krebbel PR target/24367 * gcc.dg/pr24367.c: New testcase. From-SVN: r116599 --- gcc/ChangeLog | 6 ++++++ gcc/config/s390/s390.md | 12 ++++++++++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr24367.c | 17 +++++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr24367.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 795c0a7181b..8f1fd347616 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-08-31 Andreas Krebbel + + PR target/24367 + * config/s390/s390.md ("movsi", "movdi" expander): Accept rtxes like + r12 + SYMBOLIC_CONST. + 2006-08-30 Richard Guenther * Makefile.in (see.o): Add $(EXPR_H) dependency. diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index d6443e08771..eb734e15e13 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -907,7 +907,11 @@ "" { /* Handle symbolic constants. */ - if (TARGET_64BIT && SYMBOLIC_CONST (operands[1])) + if (TARGET_64BIT + && (SYMBOLIC_CONST (operands[1]) + || (GET_CODE (operands[1]) == PLUS + && XEXP (operands[1], 0) == pic_offset_table_rtx + && SYMBOLIC_CONST (XEXP (operands[1], 1))))) emit_symbolic_move (operands); }) @@ -1158,7 +1162,11 @@ "" { /* Handle symbolic constants. */ - if (!TARGET_64BIT && SYMBOLIC_CONST (operands[1])) + if (!TARGET_64BIT + && (SYMBOLIC_CONST (operands[1]) + || (GET_CODE (operands[1]) == PLUS + && XEXP (operands[1], 0) == pic_offset_table_rtx + && SYMBOLIC_CONST (XEXP(operands[1], 1))))) emit_symbolic_move (operands); }) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ad0a274a28e..2e6cec9e1b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-08-31 Andreas Krebbel + + PR target/24367 + * gcc.dg/pr24367.c: New testcase. + 2006-08-30 Joseph Myers * gcc.dg/arm-mmx-1.c: Skip for -mfloat-abi=softfp. diff --git a/gcc/testsuite/gcc.dg/pr24367.c b/gcc/testsuite/gcc.dg/pr24367.c new file mode 100644 index 00000000000..64867190992 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr24367.c @@ -0,0 +1,17 @@ +/* { dg-do compile { target fpic } } */ +/* { dg-options "-O2 -fPIC -funroll-loops" } */ + +char * +test (const char *parent, const char *child) +{ + static char rtn_path[1024]; + char *s = rtn_path; + char *s_end = rtn_path + sizeof (rtn_path); + const char *s2 = child; + + while (*s != '\0') + s++; + while ((s < s_end) && (*s2 != '\0')) + *s++ = *s2++; + return (rtn_path); +} -- 2.30.2