X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Frtlanal.c;h=d15dbe22822503f7d06d2beb92ea6e945103dd10;hb=132cae052ceb4556303898b4bfb854b6a4329e6b;hp=cc7775ffd638f553ef1528adddef93941520fe0e;hpb=0eee494eebaebc082bcad4872a68b1a2ea819357;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index cc7775ffd63..d15dbe22822 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1,7 +1,7 @@ /* Analyze RTL for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software - Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of GCC. @@ -39,18 +39,6 @@ along with GCC; see the file COPYING3. If not see #include "df.h" #include "tree.h" -/* Information about a subreg of a hard register. */ -struct subreg_info -{ - /* Offset of first hard register involved in the subreg. */ - int offset; - /* Number of hard registers involved in the subreg. */ - int nregs; - /* Whether this subreg can be represented as a hard reg with the new - mode. */ - bool representable_p; -}; - /* Forward declarations */ static void set_of_1 (rtx, const_rtx, void *); static bool covers_regno_p (const_rtx, unsigned int); @@ -58,9 +46,6 @@ static bool covers_regno_no_parallel_p (const_rtx, unsigned int); static int rtx_referenced_p_1 (rtx *, void *); static int computed_jump_p_1 (const_rtx); static void parms_set (rtx, const_rtx, void *); -static void subreg_get_info (unsigned int, enum machine_mode, - unsigned int, enum machine_mode, - struct subreg_info *); static unsigned HOST_WIDE_INT cached_nonzero_bits (const_rtx, enum machine_mode, const_rtx, enum machine_mode, @@ -282,7 +267,8 @@ rtx_addr_can_trap_p_1 (const_rtx x, HOST_WIDE_INT offset, HOST_WIDE_INT size, actual_offset -= STACK_POINTER_OFFSET; #endif - return actual_offset % GET_MODE_SIZE (mode) != 0; + if (actual_offset % GET_MODE_SIZE (mode) != 0) + return 1; } switch (code) @@ -1879,10 +1865,11 @@ find_regno_fusage (const_rtx insn, enum rtx_code code, unsigned int regno) } -/* Add register note with kind KIND and datum DATUM to INSN. */ +/* Allocate a register note with kind KIND and datum DATUM. LIST is + stored as the pointer to the next register note. */ -void -add_reg_note (rtx insn, enum reg_note kind, rtx datum) +rtx +alloc_reg_note (enum reg_note kind, rtx datum, rtx list) { rtx note; @@ -1895,16 +1882,24 @@ add_reg_note (rtx insn, enum reg_note kind, rtx datum) /* These types of register notes use an INSN_LIST rather than an EXPR_LIST, so that copying is done right and dumps look better. */ - note = alloc_INSN_LIST (datum, REG_NOTES (insn)); + note = alloc_INSN_LIST (datum, list); PUT_REG_NOTE_KIND (note, kind); break; default: - note = alloc_EXPR_LIST (kind, datum, REG_NOTES (insn)); + note = alloc_EXPR_LIST (kind, datum, list); break; } - REG_NOTES (insn) = note; + return note; +} + +/* Add register note with kind KIND and datum DATUM to INSN. */ + +void +add_reg_note (rtx insn, enum reg_note kind, rtx datum) +{ + REG_NOTES (insn) = alloc_reg_note (kind, datum, REG_NOTES (insn)); } /* Remove register note NOTE from the REG_NOTES of INSN. */ @@ -3089,7 +3084,7 @@ subreg_lsb (const_rtx x) offset - The byte offset. ymode - The mode of a top level SUBREG (or what may become one). info - Pointer to structure to fill in. */ -static void +void subreg_get_info (unsigned int xregno, enum machine_mode xmode, unsigned int offset, enum machine_mode ymode, struct subreg_info *info) @@ -4060,7 +4055,8 @@ nonzero_bits1 (const_rtx x, enum machine_mode mode, const_rtx known_x, low-order bits by left shifts. */ if (GET_CODE (XEXP (x, 1)) == CONST_INT && INTVAL (XEXP (x, 1)) >= 0 - && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT) + && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT + && INTVAL (XEXP (x, 1)) < GET_MODE_BITSIZE (GET_MODE (x))) { enum machine_mode inner_mode = GET_MODE (x); unsigned int width = GET_MODE_BITSIZE (inner_mode); @@ -4541,7 +4537,8 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x, num0 = cached_num_sign_bit_copies (XEXP (x, 0), mode, known_x, known_mode, known_ret); if (GET_CODE (XEXP (x, 1)) == CONST_INT - && INTVAL (XEXP (x, 1)) > 0) + && INTVAL (XEXP (x, 1)) > 0 + && INTVAL (XEXP (x, 1)) < GET_MODE_BITSIZE (GET_MODE (x))) num0 = MIN ((int) bitwidth, num0 + INTVAL (XEXP (x, 1))); return num0; @@ -4550,7 +4547,8 @@ num_sign_bit_copies1 (const_rtx x, enum machine_mode mode, const_rtx known_x, /* Left shifts destroy copies. */ if (GET_CODE (XEXP (x, 1)) != CONST_INT || INTVAL (XEXP (x, 1)) < 0 - || INTVAL (XEXP (x, 1)) >= (int) bitwidth) + || INTVAL (XEXP (x, 1)) >= (int) bitwidth + || INTVAL (XEXP (x, 1)) >= GET_MODE_BITSIZE (GET_MODE (x))) return 1; num0 = cached_num_sign_bit_copies (XEXP (x, 0), mode, @@ -5036,4 +5034,3 @@ constant_pool_constant_p (rtx x) x = avoid_constant_pool_reference (x); return GET_CODE (x) == CONST_DOUBLE; } -