From ddc5a1dfbd293763de09ec27e6e650d185bbabd4 Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 19 Feb 2018 21:58:04 +0000 Subject: PR target/84146 * reg-notes.def (REG_CALL_ARG_LOCATION): New reg note. * insn-notes.def (NOTE_INSN_CALL_ARG_LOCATION): Remove. * var-tracking.c (emit_note_insn_var_location): Remove all references to NOTE_INSN_CALL_ARG_LOCATION. (emit_notes_in_bb): Emit arguments as REG_CALL_ARG_LOCATION note on the CALL_INSN rather than separate NOTE_INSN_CALL_ARG_LOCATION note. Use copy_rtx_if_shared. * dwarf2out.c (gen_subprogram_die): Use XEXP with 0 instead of NOTE_VAR_LOCATION on ca_loc->call_arg_loc_note. (dwarf2out_var_location): Remove handling of NOTE_INSN_CALL_ARG_LOCATION, instead handle REG_CALL_ARG_LOCATION note on call_insn. * final.c (final_scan_insn): Remove all references to NOTE_INSN_CALL_ARG_LOCATION. (rest_of_clean_state): Likewise. Remove REG_CALL_ARG_LOCATION notes before dumping final insns. * except.c (emit_note_eh_region_end): Remove all references to NOTE_INSN_CALL_ARG_LOCATION. * config/alpha/alpha.c (alpha_pad_function_end): Likewise. * config/c6x/c6x.c (c6x_gen_bundles): Likewise. * config/arc/arc.c (hwloop_optimize): Likewise. * config/arm/arm.c (create_fix_barrier): Likewise. * config/s390/s390.c (s390_chunkify_start): Likewise. * config/sh/sh.c (find_barrier): Likewise. * config/i386/i386.c (rest_of_insert_endbranch, ix86_seh_fixup_eh_fallthru): Likewise. * config/xtensa/xtensa.c (hwloop_optimize): Likewise. * config/iq2000/iq2000.c (final_prescan_insn): Likewise. * config/frv/frv.c (frv_function_prologue): Likewise. * emit-rtl.c (try_split): Likewise. Copy over REG_CALL_ARG_LOCATION reg note. (note_outside_basic_block_p): Remove all references to NOTE_INSN_CALL_ARG_LOCATION. * gengtype.c (adjust_field_rtx_def): Likewise. * print-rtl.c (rtx_writer::print_rtx_operand_code_0, print_insn): Likewise. * jump.c (cleanup_barriers, delete_related_insns): Likewise. * cfgrtl.c (force_nonfallthru_and_redirect): Likewise. * gcc.target/i386/pr84146.c: Add -fcompare-debug to dg-options. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257826 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/final.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'gcc/final.c') diff --git a/gcc/final.c b/gcc/final.c index cbebbfdf5b0..78a750388e6 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -2467,7 +2467,6 @@ final_scan_insn_1 (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, break; case NOTE_INSN_VAR_LOCATION: - case NOTE_INSN_CALL_ARG_LOCATION: if (!DECL_IGNORED_P (current_function_decl)) { debug_hooks->var_location (insn); @@ -4846,15 +4845,21 @@ rest_of_clean_state (void) SET_NEXT_INSN (insn) = NULL; SET_PREV_INSN (insn) = NULL; + if (CALL_P (insn)) + { + rtx note = find_reg_note (insn, REG_CALL_ARG_LOCATION, NULL_RTX); + if (note) + remove_note (insn, note); + } + if (final_output - && (!NOTE_P (insn) || - (NOTE_KIND (insn) != NOTE_INSN_VAR_LOCATION - && NOTE_KIND (insn) != NOTE_INSN_BEGIN_STMT - && NOTE_KIND (insn) != NOTE_INSN_INLINE_ENTRY - && NOTE_KIND (insn) != NOTE_INSN_CALL_ARG_LOCATION - && NOTE_KIND (insn) != NOTE_INSN_BLOCK_BEG - && NOTE_KIND (insn) != NOTE_INSN_BLOCK_END - && NOTE_KIND (insn) != NOTE_INSN_DELETED_DEBUG_LABEL))) + && (!NOTE_P (insn) + || (NOTE_KIND (insn) != NOTE_INSN_VAR_LOCATION + && NOTE_KIND (insn) != NOTE_INSN_BEGIN_STMT + && NOTE_KIND (insn) != NOTE_INSN_INLINE_ENTRY + && NOTE_KIND (insn) != NOTE_INSN_BLOCK_BEG + && NOTE_KIND (insn) != NOTE_INSN_BLOCK_END + && NOTE_KIND (insn) != NOTE_INSN_DELETED_DEBUG_LABEL))) print_rtl_single (final_output, insn); } -- cgit v1.2.1 From 42b1063146566519fef7a8589e3fd82b7240ae0f Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 20 Feb 2018 10:04:13 +0000 Subject: Add limit for maximal alignment options (PR c/84310). 2018-02-20 Martin Liska PR c/84310 PR target/79747 * final.c (shorten_branches): Build align_tab array with one more element. * opts.c (finish_options): Add alignment option limit check. (MAX_CODE_ALIGN): Likewise. (MAX_CODE_ALIGN_VALUE): Likewise. * doc/invoke.texi: Document maximum allowed option value for all -falign-* options. 2018-02-20 Martin Liska PR c/84310 PR target/79747 * gcc.target/i386/pr84310.c: New test. * gcc.target/i386/pr84310-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257842 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/final.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/final.c') diff --git a/gcc/final.c b/gcc/final.c index 78a750388e6..d2c3cd8a06e 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -911,7 +911,7 @@ shorten_branches (rtx_insn *first) char *varying_length; rtx body; int uid; - rtx align_tab[MAX_CODE_ALIGN]; + rtx align_tab[MAX_CODE_ALIGN + 1]; /* Compute maximum UID and allocate label_align / uid_shuid. */ max_uid = get_max_uid (); @@ -1016,7 +1016,7 @@ shorten_branches (rtx_insn *first) alignment of n. */ uid_align = XCNEWVEC (rtx, max_uid); - for (i = MAX_CODE_ALIGN; --i >= 0;) + for (i = MAX_CODE_ALIGN + 1; --i >= 0;) align_tab[i] = NULL_RTX; seq = get_last_insn (); for (; seq; seq = PREV_INSN (seq)) -- cgit v1.2.1