From 2efd0aa69c0bb09ed9cbc004dfee3041d9af0f8b Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Fri, 18 Mar 2011 12:19:50 +0000 Subject: [PATCH] sh.c (sh_delegitimize_address): Handle UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. * config/sh/sh.c (sh_delegitimize_address): Handle UNSPEC_SYMOFF and UNSPEC_PCREL_SYMOFF. From-SVN: r171134 --- gcc/ChangeLog | 5 +++++ gcc/config/sh/sh.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4e40291f737..8c4233df2b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-03-18 Kaz Kojima + + * config/sh/sh.c (sh_delegitimize_address): Handle UNSPEC_SYMOFF + and UNSPEC_PCREL_SYMOFF. + 2011-03-18 Andreas Krebbel * config/s390/s390.md: Use define_c_enum for the unspec constant diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index ffe84b11bf8..18bd9642f7b 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -1,6 +1,6 @@ /* Output routines for GCC for Renesas / SuperH SH. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com). Improved by Jim Wilson (wilson@cygnus.com). @@ -10019,8 +10019,20 @@ sh_delegitimize_address (rtx orig_x) if (GET_CODE (y) == UNSPEC) { if (XINT (y, 1) == UNSPEC_GOT - || XINT (y, 1) == UNSPEC_GOTOFF) + || XINT (y, 1) == UNSPEC_GOTOFF + || XINT (y, 1) == UNSPEC_SYMOFF) return XVECEXP (y, 0, 0); + else if (XINT (y, 1) == UNSPEC_PCREL_SYMOFF) + { + if (GET_CODE (XVECEXP (y, 0, 0)) == CONST) + { + rtx symplt = XEXP (XVECEXP (y, 0, 0), 0); + + if (GET_CODE (symplt) == UNSPEC + && XINT (symplt, 1) == UNSPEC_PLT) + return XVECEXP (symplt, 0, 0); + } + } else if (TARGET_SHMEDIA && (XINT (y, 1) == UNSPEC_EXTRACT_S16 || XINT (y, 1) == UNSPEC_EXTRACT_U16)) -- 2.30.2