X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fdojump.c;h=4337348195533fb4c5804cc869f0bc5ed01e608f;hb=4aba1ac0d8d8d5486ac1ea5791c6378fa02a41ce;hp=da162d676802c6a764293fb7bde2a9c7de12b763;hpb=c071a2dff4d3e938f05021e7568bfae44bde944c;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/dojump.c b/gcc/dojump.c index da162d67680..43373481955 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -1,12 +1,13 @@ /* Convert tree expression to rtl instructions, for GNU compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +16,8 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -53,7 +53,8 @@ init_pending_stack_adjust (void) /* Discard any pending stack adjustment. This avoid relying on the RTL optimizers to remove useless adjustments when we know the stack pointer value is dead. */ -void discard_pending_stack_adjust (void) +void +discard_pending_stack_adjust (void) { stack_pointer_delta -= pending_stack_adjust; pending_stack_adjust = 0; @@ -69,7 +70,7 @@ void clear_pending_stack_adjust (void) { if (optimize > 0 - && (! flag_omit_frame_pointer || current_function_calls_alloca) + && (! flag_omit_frame_pointer || cfun->calls_alloca) && EXIT_IGNORE_STACK && ! (DECL_INLINE (current_function_decl) && ! flag_no_inline)) discard_pending_stack_adjust (); @@ -217,9 +218,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) rtx set_label, clr_label; /* Strip narrowing integral type conversions. */ - while ((TREE_CODE (exp0) == NOP_EXPR - || TREE_CODE (exp0) == CONVERT_EXPR - || TREE_CODE (exp0) == NON_LVALUE_EXPR) + while (CONVERT_EXPR_P (exp0) && TREE_OPERAND (exp0, 0) != error_mark_node && TYPE_PRECISION (TREE_TYPE (exp0)) <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (exp0, 0)))) @@ -274,10 +273,10 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) && (mode = mode_for_size (i + 1, MODE_INT, 0)) != BLKmode && (type = lang_hooks.types.type_for_mode (mode, 1)) != 0 && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp)) - && (cmp_optab->handlers[(int) TYPE_MODE (type)].insn_code + && (optab_handler (cmp_optab, TYPE_MODE (type))->insn_code != CODE_FOR_nothing)) { - do_jump (convert (type, exp), if_false_label, if_true_label); + do_jump (fold_convert (type, exp), if_false_label, if_true_label); break; } goto normal; @@ -333,10 +332,10 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) if (! SLOW_BYTE_ACCESS && type != 0 && bitsize >= 0 && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp)) - && (cmp_optab->handlers[(int) TYPE_MODE (type)].insn_code + && (optab_handler (cmp_optab, TYPE_MODE (type))->insn_code != CODE_FOR_nothing)) { - do_jump (convert (type, exp), if_false_label, if_true_label); + do_jump (fold_convert (type, exp), if_false_label, if_true_label); break; } goto normal; @@ -550,37 +549,6 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) } break; - /* Special case: - __builtin_expect (, 0) and - __builtin_expect (, 1) - - We need to do this here, so that is not converted to a SCC - operation on machines that use condition code registers and COMPARE - like the PowerPC, and then the jump is done based on whether the SCC - operation produced a 1 or 0. */ - case CALL_EXPR: - /* Check for a built-in function. */ - { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); - - if (fndecl - && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL - && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT - && arglist != NULL_TREE - && TREE_CHAIN (arglist) != NULL_TREE) - { - rtx seq = expand_builtin_expect_jump (exp, if_false_label, - if_true_label); - - if (seq != NULL_RTX) - { - emit_insn (seq); - return; - } - } - } - /* Fall through and generate the normal code. */ default: normal: @@ -916,11 +884,26 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp, if_true_label, if_false_label); break; + case GTU: + do_jump_by_parts_greater_rtx (mode, 1, op0, op1, + if_false_label, if_true_label); + break; + + case GEU: + do_jump_by_parts_greater_rtx (mode, 1, op1, op0, + if_true_label, if_false_label); + break; + case LT: do_jump_by_parts_greater_rtx (mode, 0, op1, op0, if_false_label, if_true_label); break; + case LE: + do_jump_by_parts_greater_rtx (mode, 0, op0, op1, + if_true_label, if_false_label); + break; + case GT: do_jump_by_parts_greater_rtx (mode, 0, op0, op1, if_false_label, if_true_label);