From 192997cf186527359a267c1002fef67218269e2e Mon Sep 17 00:00:00 2001 From: Anatoly Sokolov Date: Mon, 21 Feb 2011 19:22:21 +0300 Subject: [PATCH] stormy16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove. * config/stormy16/stormy16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove. * config/stormy16/stormy16-protos.h (xstormy16_mode_dependent_address_p): Remove. * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p): Make static. Change return type to bool. Change argument type to const_rtx. Remove dead code. (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. From-SVN: r170367 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/stormy16/stormy16-protos.h | 3 +-- gcc/config/stormy16/stormy16.c | 29 +++++++++-------------------- gcc/config/stormy16/stormy16.h | 10 +--------- 4 files changed, 21 insertions(+), 31 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fbd8007..47bca58 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-02-21 Anatoly Sokolov + + * config/stormy16/stormy16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove. + * config/stormy16/stormy16-protos.h + (xstormy16_mode_dependent_address_p): Remove. + * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p): + Make static. Change return type to bool. Change argument type to + const_rtx. Remove dead code. + (TARGET_MODE_DEPENDENT_ADDRESS_P): Define. + 2011-02-21 Richard Guenther PR lto/47820 diff --git a/gcc/config/stormy16/stormy16-protos.h b/gcc/config/stormy16/stormy16-protos.h index ad44e15..5b4957b 100644 --- a/gcc/config/stormy16/stormy16-protos.h +++ b/gcc/config/stormy16/stormy16-protos.h @@ -1,5 +1,5 @@ /* Prototypes for exported functions defined in xstormy16.c - Copyright (C) 2000, 2001, 2003, 2004, 2007, 2008, 2010 + Copyright (C) 2000, 2001, 2003, 2004, 2007, 2008, 2010, 2011 Free Software Foundation, Inc. Contributed by Red Hat, Inc. @@ -44,7 +44,6 @@ extern rtx xstormy16_function_value (const_tree, const_tree); extern void xstormy16_emit_cbranch (enum rtx_code, rtx, rtx, rtx); extern char *xstormy16_output_cbranch_hi (rtx, const char *, int, rtx); extern char *xstormy16_output_cbranch_si (rtx, const char *, int, rtx); -extern int xstormy16_mode_dependent_address_p (rtx); extern void xstormy16_print_operand (FILE *, rtx, int); extern void xstormy16_print_operand_address (FILE *, rtx); diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index e4cd10e..120c5ec 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -1,6 +1,6 @@ /* Xstormy16 target functions. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Red Hat, Inc. This file is part of GCC. @@ -647,40 +647,27 @@ xstormy16_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, return false; } -/* Return nonzero if memory address X (an RTX) can have different - meanings depending on the machine mode of the memory reference it - is used for or if the address is valid for some modes but not - others. - - Autoincrement and autodecrement addresses typically have mode-dependent - effects because the amount of the increment or decrement is the size of the - operand being addressed. Some machines have other mode-dependent addresses. - Many RISC machines have no mode-dependent addresses. - - You may assume that ADDR is a valid address for the machine. +/* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P. On this chip, this is true if the address is valid with an offset of 0 but not of 6, because in that case it cannot be used as an address for DImode or DFmode, or if the address is a post-increment or pre-decrement address. */ -int -xstormy16_mode_dependent_address_p (rtx x) +static bool +xstormy16_mode_dependent_address_p (const_rtx x) { if (LEGITIMATE_ADDRESS_CONST_INT_P (x, 0) && ! LEGITIMATE_ADDRESS_CONST_INT_P (x, 6)) - return 1; + return true; if (GET_CODE (x) == PLUS && LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 0) && ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 6)) - return 1; - - if (GET_CODE (x) == PLUS) - x = XEXP (x, 0); + return true; /* Auto-increment addresses are now treated generically in recog.c. */ - return 0; + return false; } int @@ -2619,6 +2606,8 @@ static const struct default_options xstorym16_option_optimization_table[] = #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P xstormy16_legitimate_address_p +#undef TARGET_MODE_DEPENDENT_ADDRESS_P +#define TARGET_MODE_DEPENDENT_ADDRESS_P xstormy16_mode_dependent_address_p #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE xstormy16_can_eliminate diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h index c92af1d..0a2bc76 100644 --- a/gcc/config/stormy16/stormy16.h +++ b/gcc/config/stormy16/stormy16.h @@ -1,6 +1,6 @@ /* Xstormy16 cpu description. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. + 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Contributed by Red Hat, Inc. This file is part of GCC. @@ -371,14 +371,6 @@ enum reg_class #define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X) -/* On this chip, this is true if the address is valid with an offset - of 0 but not of 6, because in that case it cannot be used as an - address for DImode or DFmode, or if the address is a post-increment - or pre-decrement address. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - if (xstormy16_mode_dependent_address_p (ADDR)) \ - goto LABEL - #define LEGITIMATE_CONSTANT_P(X) 1 -- 2.7.4