From 565e35c947856aca0d02fd0db6456a5ba1611739 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 18 Jan 2007 19:33:01 +0000 Subject: [PATCH] m68k.md (cmpsi): Remove outdated flag_pic handling. gcc/ * config/m68k/m68k.md (cmpsi): Remove outdated flag_pic handling. gcc/testsuite/ 200x-xx-xx Nathan Sidwell * gcc.dg/m68k-pic-1.c: New. From-SVN: r120919 --- gcc/ChangeLog | 4 ++++ gcc/config/m68k/m68k.md | 11 ----------- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/m68k-pic-1.c | 18 ++++++++++++++++++ 4 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/m68k-pic-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 94e18bfc326..91d9a0c91d3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2007-01-18 Richard Sandiford + + * config/m68k/m68k.md (cmpsi): Remove outdated flag_pic handling. + 2007-01-18 Kazu Hirata Richard Sandiford diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 429f43363bb..f7971923706 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -308,8 +308,6 @@ } }) -;; This is the second "hook" for PIC code (in addition to movsi). See -;; comment of movsi for a description of PIC handling. (define_expand "cmpsi" [(set (cc0) (compare (match_operand:SI 0 "nonimmediate_operand" "") @@ -317,15 +315,6 @@ "" { m68k_last_compare_had_fp_operands = 0; - if (flag_pic && !TARGET_PCREL && symbolic_operand (operands[1], SImode)) - { - /* The source is an address which requires PIC relocation. - Call legitimize_pic_address with the source, mode, and a relocation - register (a new pseudo, or the final destination if reload_in_progress - is set). Then fall through normally */ - rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); - operands[1] = legitimize_pic_address (operands[1], SImode, temp); - } }) ;; A composite of the cmp, cmpa, cmpi & cmpm m68000 op codes. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dc33ec9f571..bac8a24077f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-01-18 Nathan Sidwell + + * gcc.dg/m68k-pic-1.c: New. + 2007-01-18 Roger Sayle * gfortran.dg/array_memcpy_4.f90: New test case. diff --git a/gcc/testsuite/gcc.dg/m68k-pic-1.c b/gcc/testsuite/gcc.dg/m68k-pic-1.c new file mode 100644 index 00000000000..631c2527501 --- /dev/null +++ b/gcc/testsuite/gcc.dg/m68k-pic-1.c @@ -0,0 +1,18 @@ +/* { dg-do compile { target m68k-*-* } } */ +/* { dg-options "-O2 -fpic" } */ + +extern void Foo (void *); + +char *ary[] = {"a", "b", "c", "d", "e"}; + +void Bar (void) +{ + int cnt = 0; + + for (cnt = 0; cnt < 4; ++cnt) + { + char *ptr = ary[cnt]; + + Foo (&ptr); + } +}