X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ffunction.c;h=3721a60c713fa8d4c3e343fdaf9eba76d5be6cfc;hb=341714a96243da1bf4a6852d572d8fe4007ce3ac;hp=a561d8eefe0eb0bb148fda7d2c7fa76bdca16c03;hpb=464d029c17531adcbde5aaf2601ea82332e20f31;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/function.c b/gcc/function.c index a561d8eefe0..3721a60c713 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1682,7 +1682,7 @@ fixup_var_refs_insns_with_hash (ht, var, promoted_mode, unsignedp) rtx insn = XEXP (insn_list, 0); if (INSN_P (insn)) - fixup_var_refs_insn (insn, var, promoted_mode, unsignedp, 0); + fixup_var_refs_insn (insn, var, promoted_mode, unsignedp, 1); insn_list = XEXP (insn_list, 1); } @@ -2144,7 +2144,7 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements) { replacement = find_fixup_replacement (replacements, var); if (replacement->new == 0) - replacement->new = gen_reg_rtx (GET_MODE (var)); + replacement->new = gen_reg_rtx (promoted_mode); SUBREG_REG (x) = replacement->new; return; } @@ -2178,7 +2178,7 @@ fixup_var_refs_1 (var, promoted_mode, loc, insn, replacements) optimize_bit_field (x, insn, 0); if (GET_CODE (SET_SRC (x)) == SIGN_EXTRACT || GET_CODE (SET_SRC (x)) == ZERO_EXTRACT) - optimize_bit_field (x, insn, NULL_PTR); + optimize_bit_field (x, insn, 0); /* For a paradoxical SUBREG inside a ZERO_EXTRACT, load the object into a register and then store it back out. */ @@ -2991,14 +2991,19 @@ purge_addressof_1 (loc, insn, force, store, ht) result &= purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); return result; } - - else if (code == ADDRESSOF && GET_CODE (XEXP (x, 0)) == MEM) + else if (code == ADDRESSOF) { + rtx sub, insns; + + if (GET_CODE (XEXP (x, 0)) != MEM) + { + put_addressof_into_stack (x, ht); + return true; + } + /* We must create a copy of the rtx because it was created by overwriting a REG rtx which is always shared. */ - rtx sub = copy_rtx (XEXP (XEXP (x, 0), 0)); - rtx insns; - + sub = copy_rtx (XEXP (XEXP (x, 0), 0)); if (validate_change (insn, loc, sub, 0) || validate_replace_rtx (x, sub, insn)) return true; @@ -3210,22 +3215,9 @@ purge_addressof_1 (loc, insn, force, store, ht) } goto restart; } - give_up:; - /* else give up and put it into the stack */ - } - - else if (code == ADDRESSOF) - { - put_addressof_into_stack (x, ht); - return true; - } - else if (code == SET) - { - result = purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht); - result &= purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); - return result; } + give_up: /* Scan all subexpressions. */ fmt = GET_RTX_FORMAT (code); for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) @@ -6217,7 +6209,7 @@ init_function_start (subr, filename, line) /* Make sure first insn is a note even if we don't want linenums. This makes sure the first insn will never be deleted. Also, final expects a note to appear there. */ - emit_note (NULL_PTR, NOTE_INSN_DELETED); + emit_note (NULL, NOTE_INSN_DELETED); /* Set flags used by final.c. */ if (aggregate_value_p (DECL_RESULT (subr))) @@ -6430,10 +6422,10 @@ expand_function_start (subr, parms_have_cleanups) The move is supposed to make sdb output more accurate. */ /* Indicate the beginning of the function body, as opposed to parm setup. */ - emit_note (NULL_PTR, NOTE_INSN_FUNCTION_BEG); + emit_note (NULL, NOTE_INSN_FUNCTION_BEG); if (GET_CODE (get_last_insn ()) != NOTE) - emit_note (NULL_PTR, NOTE_INSN_DELETED); + emit_note (NULL, NOTE_INSN_DELETED); parm_birth_insn = get_last_insn (); context_display = 0; @@ -6505,7 +6497,7 @@ expand_function_start (subr, parms_have_cleanups) /* After the display initializations is where the tail-recursion label should go, if we end up needing one. Ensure we have a NOTE here since some things (like trampolines) get placed before this. */ - tail_recursion_reentry = emit_note (NULL_PTR, NOTE_INSN_DELETED); + tail_recursion_reentry = emit_note (NULL, NOTE_INSN_DELETED); /* Evaluate now the sizes of any types declared among the arguments. */ for (tem = nreverse (get_pending_sizes ()); tem; tem = TREE_CHAIN (tem)) @@ -6763,7 +6755,7 @@ expand_function_end (filename, line, end_bindings) /* Mark the end of the function body. If control reaches this insn, the function can drop through without returning a value. */ - emit_note (NULL_PTR, NOTE_INSN_FUNCTION_END); + emit_note (NULL, NOTE_INSN_FUNCTION_END); /* Must mark the last line number note in the function, so that the test coverage code can avoid counting the last line twice. This just tells @@ -6771,37 +6763,35 @@ expand_function_end (filename, line, end_bindings) already exists a copy of this note somewhere above. This line number note is still needed for debugging though, so we can't delete it. */ if (flag_test_coverage) - emit_note (NULL_PTR, NOTE_INSN_REPEATED_LINE_NUMBER); + emit_note (NULL, NOTE_INSN_REPEATED_LINE_NUMBER); /* Output a linenumber for the end of the function. SDB depends on this. */ emit_line_note_force (filename, line); + /* Before the return label (if any), clobber the return + registers so that they are not propogated live to the rest of + the function. This can only happen with functions that drop + through; if there had been a return statement, there would + have either been a return rtx, or a jump to the return label. */ + { + rtx before, after; + + before = get_last_insn (); + clobber_return_register (); + after = get_last_insn (); + + if (before != after) + cfun->x_clobber_return_insn = after; + } + /* Output the label for the actual return from the function, if one is expected. This happens either because a function epilogue is used instead of a return instruction, or because a return was done with a goto in order to run local cleanups, or because of pcc-style structure returning. */ - if (return_label) - { - rtx before, after; - - /* Before the return label, clobber the return registers so that - they are not propogated live to the rest of the function. This - can only happen with functions that drop through; if there had - been a return statement, there would have either been a return - rtx, or a jump to the return label. */ - - before = get_last_insn (); - clobber_return_register (); - after = get_last_insn (); - - if (before != after) - cfun->x_clobber_return_insn = after; - - emit_label (return_label); - } + emit_label (return_label); /* C++ uses this. */ if (end_bindings) @@ -6885,6 +6875,10 @@ expand_function_end (filename, line, end_bindings) convert_move (real_decl_rtl, decl_rtl, unsignedp); } + else if (GET_CODE (real_decl_rtl) == PARALLEL) + emit_group_load (real_decl_rtl, decl_rtl, + int_size_in_bytes (TREE_TYPE (decl_result)), + TYPE_ALIGN (TREE_TYPE (decl_result))); else emit_move_insn (real_decl_rtl, decl_rtl);