Re: Documentation complex logarithm https://gcc.gnu.org/onlinedocs/gfortran/LOG.html
Am 13.06.2015 um 18:33 schrieb Gerald Pfeifer: > On Tue, 2 Jun 2015, C.Friedrich wrote: >> The LOG function returns the principal value of the complex logarithm >> whose imaginary part omega must be in the range -pi < omega <= pi. >> >> GFORTRAN does it correctly but the online documentation >> https://gcc.gnu.org/onlinedocs/gfortran/LOG.html gives -pi <= omega <= >> pi. Perhaps this should be corrected. > > Let me redirect this to the fort...@gcc.gnu.org list. Fixed on trunk as obvious after checking that 'make info', 'make dvi' and 'make pdf' still work. Will backport to gcc 5. Regards Thomas --- intrinsic.texi (Revision 224450) +++ intrinsic.texi (Arbeitskopie) @@ -8712,7 +8712,7 @@ The return value is of type @code{REAL} or @code{COMPLEX}. The kind type parameter is the same as @var{X}. If @var{X} is @code{COMPLEX}, the imaginary part @math{\omega} is in the range -@math{-\pi \leq \omega \leq \pi}. +@math{-\pi < \omega \leq \pi}. @item @emph{Example}: @smallexample 2015-06-14 Thomas Koenig * intrinsic.texi: Change \leq to < in descrition of imaginary part in argument to log.
Re: [PATCH, stage1] Make parloops gate more strict
On 13/03/15 11:36, Richard Biener wrote: On Fri, Mar 13, 2015 at 11:32 AM, Tom de Vries wrote: Hi, this patch moves a bunch of early-out tests from the parloops pass to the gate function. The only effect is for functions that we don't consider at all for parallelization in the parloops pass. We no longer dump those in the parloops dump file. Bootstrapped and reg-tested on x86_64. OK for stage1 trunk? Does it work with -fdump-passes? Hi, with -fdump-passes now fixed to work on a dummy function (r222129), I'm resubmitting this patch, split up in two patches. The first patch moves two trivial early-exit tests to the parloops gate. The second patch moves the number_of_loops test to the parloops gate, and adds a dummy loops structure in the dummy function for -fdump-passes. Bootstrapped and reg-tested on x86_64. Both patches OK for trunk? Thanks, - Tom Move parallelize_loops tests to parloops gate 2015-06-08 Tom de Vries * tree-parloops.c (parallelize_loops): Move early-exit tests to ... (pass_parallelize_loops::gate): ... here. --- gcc/tree-parloops.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 02f44eb..a1659a3 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2535,10 +2535,6 @@ parallelize_loops (void) source_location loop_loc; /* Do not parallelize loops in the functions created by parallelization. */ - if (parallelized_function_p (cfun->decl)) -return false; - if (cfun->has_nonlocal_label) -return false; gcc_obstack_init (&parloop_obstack); reduction_info_table_type reduction_list (10); @@ -2657,7 +2653,12 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_parallelize_loops > 1; } + virtual bool gate (function *fun) +{ + return (flag_tree_parallelize_loops > 1 + && !parallelized_function_p (fun->decl) + && !cfun->has_nonlocal_label); +} virtual unsigned int execute (function *); }; // class pass_parallelize_loops -- 1.9.1 Move parloops::execute test to parloops gate 2015-06-11 Tom de Vries * cfgloop.c (init_loops_structure): Add and handle dummy_p parameter. (flow_loops_find): Add extra argument to call to init_loops_structure. * cfgloop.h (init_loops_structure): Add bool parameter. * cgraphunit.c (init_lowered_empty_function): Add extra argument to call to init_loops_structure. * lto-streamer-in.c (input_cfg): Same. * tree-cfg.c (move_sese_region_to_fn): Same. * passes.c (pass_manager::dump_passes): Add dummy loops structure to dummy function. * tree-parloops.c (pass_parallelize_loops::execute): Move early-exit test to .. (pass_parallelize_loops::gate): ... here. --- gcc/cfgloop.c | 19 +++ gcc/cfgloop.h | 2 +- gcc/cgraphunit.c | 2 +- gcc/lto-streamer-in.c | 2 +- gcc/passes.c | 4 gcc/tree-cfg.c| 2 +- gcc/tree-parloops.c | 6 ++ 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index a279046..2b17585 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -356,8 +356,8 @@ alloc_loop (void) (including the root of the loop tree). */ void -init_loops_structure (struct function *fn, - struct loops *loops, unsigned num_loops) +init_loops_structure (struct function *fn, struct loops *loops, + unsigned num_loops, bool dummy_p) { struct loop *root; @@ -366,11 +366,14 @@ init_loops_structure (struct function *fn, /* Dummy loop containing whole function. */ root = alloc_loop (); - root->num_nodes = n_basic_blocks_for_fn (fn); - root->latch = EXIT_BLOCK_PTR_FOR_FN (fn); - root->header = ENTRY_BLOCK_PTR_FOR_FN (fn); - ENTRY_BLOCK_PTR_FOR_FN (fn)->loop_father = root; - EXIT_BLOCK_PTR_FOR_FN (fn)->loop_father = root; + if (!dummy_p) +{ + root->num_nodes = n_basic_blocks_for_fn (fn); + root->latch = EXIT_BLOCK_PTR_FOR_FN (fn); + root->header = ENTRY_BLOCK_PTR_FOR_FN (fn); + ENTRY_BLOCK_PTR_FOR_FN (fn)->loop_father = root; + EXIT_BLOCK_PTR_FOR_FN (fn)->loop_father = root; +} loops->larray->quick_push (root); loops->tree_root = root; @@ -427,7 +430,7 @@ flow_loops_find (struct loops *loops) if (!loops) { loops = ggc_cleared_alloc (); - init_loops_structure (cfun, loops, 1); + init_loops_structure (cfun, loops, 1, false); } /* Ensure that loop exits were released. */ diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index d811c56..e680941 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -260,7 +260,7 @@ struct GTY (()) loops { /* Loop recognition. */ bool bb_loop_header_p (basic_block); -void init_loops_structure (struct function *, struct loops *, unsigned); +void init_loops_structure (struct function *, struct loops *, unsigned, bool); extern struct loops *flow_loops_find (struct loops *); extern void disambiguate_loops_with_multiple_latche
New Swedish PO file for 'gcc' (version 5.1.0)
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Swedish team of translators. The file is available at: http://translationproject.org/latest/gcc/sv.po (This file, 'gcc-5.1.0.sv.po', has just now been sent to you in a separate email.) All other PO files for your package are available in: http://translationproject.org/latest/gcc/ Please consider including all of these in your next release, whether official or a pretest. Whenever you have a new distribution with a new version number ready, containing a newer POT file, please send the URL of that distribution tarball to the address below. The tarball may be just a pretest or a snapshot, it does not even have to compile. It is just used by the translators when they need some extra translation context. The following HTML page has been updated: http://translationproject.org/domain/gcc.html If any question arises, please contact the translation coordinator. Thank you for all your work, The Translation Project robot, in the name of your translation coordinator.
GCC 4.8.5 Status Report (2015-06-14) - branch frozen for release
The GCC 4.8 branch is now frozen for preparing of a release candidate for GCC 4.8.5. All changes to the branch require release manager approval from now on. I'll announce the GCC 4.8.5 release candidate once it is ready.
[PATCH] Disable snapshots from the 4.8 branch
Committed. Richard. 2015-06-14 Richard Biener * crontab: Disable snapshots from the 4.8 branch.
Re: [PATCH] Fix warnings from including fdl.texi into gnat-style.texi
On 23/03/15 16:00, Gerald Pfeifer wrote: On Fri, 20 Mar 2015, Tom de Vries wrote: The gnat-style.texi part is OK. I cannot approve the fdl part though. Gerald, Can you approve the fdl part? Let's assume I can. Okay. Can you just describe the _why_ a bit in a @comment (in simple words beyond showing the error message), that is, what the issue is and how you avoid it? That should help someone coming in later, trying to understand. Patch updated with comment. OK for trunk? Thanks, - Tom Fix warnings from including fdl.texi into gnat-style.texi 2015-02-22 Tom de Vries PR ada/65102 * doc/include/fdl.texi: Add nodefaultgnufreedocumentationlicensenode ifdef to allow disabling default @node GNU Free Documentation License. * gnat-style.texi: Set nodefaultgnufreedocumentationlicensenode and define @node GNU Free Documentation License locally. --- gcc/ada/gnat-style.texi | 3 +++ gcc/doc/include/fdl.texi | 7 +++ 2 files changed, 10 insertions(+) diff --git a/gcc/ada/gnat-style.texi b/gcc/ada/gnat-style.texi index 1fa7688..50adaab 100644 --- a/gcc/ada/gnat-style.texi +++ b/gcc/ada/gnat-style.texi @@ -937,6 +937,9 @@ except that they are all lower case. @c ** @c * GNU Free Documentation License * @c ** +@node GNU Free Documentation License,Index, Program Structure, Top +@unnumberedsec GNU Free Documentation License +@set nodefaultgnufreedocumentationlicensenode @include fdl.texi @c GNU Free Documentation License @cindex GNU Free Documentation License diff --git a/gcc/doc/include/fdl.texi b/gcc/doc/include/fdl.texi index 8f3d7be..4e3457f 100644 --- a/gcc/doc/include/fdl.texi +++ b/gcc/doc/include/fdl.texi @@ -30,9 +30,16 @@ of this license document, but changing it is not allowed. @end ifset @c man begin DESCRIPTION @ifclear gfdlhtml +@comment For some cases, this default @node/@unnumbered is not applicable and +@comment causes warnings. In those cases, the including file can set +@comment nodefaultgnufreedocumentationlicensenode and provide it's own version. +@comment F.i., when this file is included in an @raisesections context, the +@comment including file can use an @unnumberedsec. +@ifclear nodefaultgnufreedocumentationlicensenode @node GNU Free Documentation License @unnumbered GNU Free Documentation License @end ifclear +@end ifclear @cindex FDL, GNU Free Documentation License @center Version 1.3, 3 November 2008 -- 1.9.1
[PING][PATCH][PR65511] Fix edge probabilities in gimple_duplicate_sese_tail
On 30/03/15 11:54, Tom de Vries wrote: On 30-03-15 10:15, Jan Hubicka wrote: diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 64bdc92..c7a7c4d 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -6177,6 +6177,7 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU gphi *phi; tree def; struct loop *target, *aloop, *cloop; + int exit_prob = exit->probability; gcc_assert (EDGE_COUNT (exit->src->succs) == 2); exits[0] = exit; @@ -6268,6 +6269,8 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU sorig = single_succ_edge (switch_bb); sorig->flags = exits[1]->flags; snew = make_edge (switch_bb, nentry_bb, exits[0]->flags); + snew->probability = exit_prob; + sorig->probability = REG_BR_PROB_BASE - exit_prob; You need to also set snew->count/sorig->count. Thanks for noting that. Updated patch. OK for stage1 if bootstrap and reg-test on x86_64 are ok? Ping. Original posting at https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01536.html . Thanks, - Tom 0001-Fix-edge-probabilities-in-gimple_duplicate_sese_tail.patch Fix edge probabilities in gimple_duplicate_sese_tail 2015-03-27 Tom de Vries PR tree-optimization/65511 * tree-cfg.c (gimple_duplicate_sese_tail): Fix edge probabilities and counts. * gcc.dg/parloops-prob.c: New test. --- gcc/testsuite/gcc.dg/parloops-prob.c | 21 + gcc/tree-cfg.c | 11 +++ 2 files changed, 32 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/parloops-prob.c diff --git a/gcc/testsuite/gcc.dg/parloops-prob.c b/gcc/testsuite/gcc.dg/parloops-prob.c new file mode 100644 index 000..a3e767c --- /dev/null +++ b/gcc/testsuite/gcc.dg/parloops-prob.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target pthread } */ +/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-fixup_cfg4-all" } */ + +#define N 1000 + +unsigned int a[N]; +unsigned int b[N]; +unsigned int c[N]; + +void +f (unsigned int n) +{ + int i; + + for (i = 0; i < n; ++i) +c[i] = a[i] + b[i]; +} + +/* { dg-final { scan-tree-dump-not "freq 0" "fixup_cfg4" } } */ +/* { dg-final { cleanup-tree-dump "fixup_cfg4" } } */ diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 64bdc92..6db6dff 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -6177,11 +6177,18 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU gphi *phi; tree def; struct loop *target, *aloop, *cloop; + int exits_prob[2]; + gcov_type exits_count[2]; gcc_assert (EDGE_COUNT (exit->src->succs) == 2); exits[0] = exit; exits[1] = EDGE_SUCC (exit->src, EDGE_SUCC (exit->src, 0) == exit); + exits_prob[0] = exits[0]->probability; + exits_prob[1] = exits[1]->probability; + exits_count[0] = exits[0]->count; + exits_count[1] = exits[1]->count; + if (!can_copy_bbs_p (region, n_region)) return false; @@ -6268,6 +6275,10 @@ gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNU sorig = single_succ_edge (switch_bb); sorig->flags = exits[1]->flags; snew = make_edge (switch_bb, nentry_bb, exits[0]->flags); + snew->probability = exits_prob[0]; + snew->count = exits_count[0]; + sorig->probability = exits_prob[1]; + sorig->count = exits_count[1]; /* Register the new edge from SWITCH_BB in loop exit lists. */ rescan_loop_exit (snew, true, false); -- 1.9.1
[PING][PATCH][PR65511] Fix edge probabilities in move_sese_region_to_fn
On 30/03/15 11:54, Tom de Vries wrote: On 30-03-15 10:15, Jan Hubicka wrote: Also move_sese_region_to_fn seem to mis updating of counts. Can you, please, add that and send updated patch? Like this? OK for stage1 if bootstrap and reg-test on x86_64 are ok? Ping. Original posting at https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01537.html . Thanks, - Tom 0002-Preserve-edge-count-in-move_sese_region_to_fn.patch Preserve edge count in move_sese_region_to_fn 2015-03-30 Tom de Vries * tree-cfg.c (move_sese_region_to_fn): Add entry_count and exit_count arrays, and used the to propagate edge counts alongside edge probabilities. --- gcc/tree-cfg.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 6db6dff..ad528a3 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -6976,6 +6976,7 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, struct function *saved_cfun = cfun; int *entry_flag, *exit_flag; unsigned *entry_prob, *exit_prob; + gcov_type *entry_count, *exit_count; unsigned i, num_entry_edges, num_exit_edges, num_nodes; edge e; edge_iterator ei; @@ -7014,10 +7015,12 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, entry_pred = XNEWVEC (basic_block, num_entry_edges); entry_flag = XNEWVEC (int, num_entry_edges); entry_prob = XNEWVEC (unsigned, num_entry_edges); + entry_count = XNEWVEC (gcov_type, num_entry_edges); i = 0; for (ei = ei_start (entry_bb->preds); (e = ei_safe_edge (ei)) != NULL;) { entry_prob[i] = e->probability; + entry_count[i] = e->count; entry_flag[i] = e->flags; entry_pred[i++] = e->src; remove_edge (e); @@ -7029,10 +7032,12 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, exit_succ = XNEWVEC (basic_block, num_exit_edges); exit_flag = XNEWVEC (int, num_exit_edges); exit_prob = XNEWVEC (unsigned, num_exit_edges); + exit_count = XNEWVEC (gcov_type, num_exit_edges); i = 0; for (ei = ei_start (exit_bb->succs); (e = ei_safe_edge (ei)) != NULL;) { exit_prob[i] = e->probability; + exit_count[i] = e->count; exit_flag[i] = e->flags; exit_succ[i++] = e->dest; remove_edge (e); @@ -7044,6 +7049,7 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, exit_succ = NULL; exit_flag = NULL; exit_prob = NULL; + exit_count = NULL; } /* Switch context to the child function to initialize DEST_FN's CFG. */ @@ -7221,12 +7227,14 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, { e = make_edge (entry_pred[i], bb, entry_flag[i]); e->probability = entry_prob[i]; + e->count = entry_count[i]; } for (i = 0; i < num_exit_edges; i++) { e = make_edge (bb, exit_succ[i], exit_flag[i]); e->probability = exit_prob[i]; + e->count = exit_count[i]; } set_immediate_dominator (CDI_DOMINATORS, bb, dom_entry); @@ -7237,10 +7245,12 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb, if (exit_bb) { free (exit_prob); + free (exit_count); free (exit_flag); free (exit_succ); } free (entry_prob); + free (entry_count); free (entry_flag); free (entry_pred); bbs.release (); -- 1.9.1
[PATCH] PR ada/66242 Front-end error if exception propagation disabled
There are two issues in code expansion related to Ada.Finalization that aren’t properly handled in the presence of pragma Restriction (No_Exception_Propagation). The expanded code attempts to catch any exception propagated during Finalize and record that it happened, and later, if there was a caught exception, raise Program_Error instead. Given No_Exception_Propagation, this fails because no exception could have been propagated from Finalize in the first place, so Exp_Ch7.Build_Object_Declarations detects that No_Exception_Propagation is in force and omits the creation of the temporary variable which would have recorded the propagation. The attached patch modifies the two compiler source files affected and adds a new test case. Patched 5.1.0 code, bootstrap and regression test on x86_64-apple-darwin13. The patches apply to trunk with minor offsets. gcc/ada/Changelog: 2015–6-14 Simon Wright pr66242.diff Description: Binary data
[PATCH] Refactoring: use std::swap instead of manual swaps (part 2)
Hi all. The attached patch replaces manual swaps (i.e. "tmp = a; a = b; b = tmp;") with std::swap. It also removes a couple of static functions which were used only for implementing such swaps. Bootstrapped/regtested on x86_64-linux; full target list build in progress. OK for trunk? -- Regards, Mikhail Maltsev gcc/ChangeLog: 2015-06-14 Mikhail Maltsev * auto-inc-dec.c (reverse_mem): Remove. (reverse_inc): Remove. (parse_add_or_inc): Use std::swap instead of reverse_{mem,inc}. (find_inc): Likewise. * combine.c (combine_simplify_rtx): Use std::swap instead of manual swaps. * df-core.c (df_worklist_dataflow_doublequeue): Likewise. * df-scan.c (df_swap_refs): Remove. (df_sort_and_compress_refs): Use std::swap instead of df_swap_refs. * dominance.c (link_roots): Use std::swap instead of manual swaps. * expr.c (expand_expr_real_2, do_store_flag): Likewise. * fold-const.c (fold_relational_const): Likewise. * genattrtab.c (simplify_test_exp): Likewise. * gimple-match-head.c (gimple_resimplify2 gimple_resimplify3, gimple_simplify): Likewise. * ifcvt.c (noce_try_abs, find_if_header): Likewise. * internal-fn.c (expand_addsub_overflow, expand_mul_overflow): Likewise. * ipa-devirt.c (add_type_duplicate): Likewise. * loop-iv.c (get_biv_step_1, iv_number_of_iterations): Likewise. * lra-lives.c (lra_setup_reload_pseudo_preferenced_hard_reg): Likewise. * lra.c (lra_create_copy): Likewise. * lto-streamer-out.c (DFS::DFS): Likewise. * modulo-sched.c (get_sched_window): Likewise. * omega.c (omega_pretty_print_problem): Likewise. * optabs.c (prepare_float_lib_cmp, expand_mult_highpart): Likewise. * reload1.c (reloads_unique_chain_p): Likewise. * sel-sched-ir.c (exchange_lv_sets, exchange_av_sets): Remove. (exchange_data_sets): Move logic from exchange_{av,lv}_sets here and use std::swap. * simplify-rtx.c (simplify_unary_operation_1): Use std::swap instead of manual swaps. * tree-if-conv.c (is_cond_scalar_reduction, predicate_scalar_phi, predicate_mem_writes): Likewise. * tree-loop-distribution.c (pg_add_dependence_edges): Likewise. * tree-predcom.c (combine_chains): Likewise. * tree-ssa-alias.c (nonoverlapping_component_refs_p, refs_may_alias_p_1): Likewise. * tree-ssa-ifcombine.c (recognize_if_then_else): Likewise. * tree-ssa-loop-ivopts.c (extract_cond_operands): Likewise. * tree-ssa-loop-niter.c (refine_bounds_using_guard, number_of_iterations_cond): Likewise. * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise. * tree-ssa-sccvn.c (vn_nary_op_compute_hash): Likewise. * tree-vect-slp.c (vect_build_slp_tree): Likewise. * tree-vect-stmts.c (supportable_widening_operation): Likewise. * tree-vrp.c (extract_range_from_binary_expr_1, extract_range_from_unary_expr_1): Likewise. gcc/cp/ChangeLog: 2015-06-14 Mikhail Maltsev * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of manual swaps. * semantics.c (finish_omp_atomic): Likewise. * typeck.c (cp_build_array_ref): Likewise. gcc/c-family/ChangeLog: 2015-06-14 Mikhail Maltsev * c-common.c (scalar_to_vector): Use std::swap instead of manual swaps. diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c index 0bdf91a..1e93e7e 100644 --- a/gcc/auto-inc-dec.c +++ b/gcc/auto-inc-dec.c @@ -768,28 +768,6 @@ get_next_ref (int regno, basic_block bb, rtx_insn **next_array) } -/* Reverse the operands in a mem insn. */ - -static void -reverse_mem (void) -{ - rtx tmp = mem_insn.reg1; - mem_insn.reg1 = mem_insn.reg0; - mem_insn.reg0 = tmp; -} - - -/* Reverse the operands in a inc insn. */ - -static void -reverse_inc (void) -{ - rtx tmp = inc_insn.reg1; - inc_insn.reg1 = inc_insn.reg0; - inc_insn.reg0 = tmp; -} - - /* Return true if INSN is of a form "a = b op c" where a and b are regs. op is + if c is a reg and +|- if c is a const. Fill in INC_INSN with what is found. @@ -858,7 +836,7 @@ parse_add_or_inc (rtx_insn *insn, bool before_mem) { /* Reverse the two operands and turn *_ADD into *_INC since a = c + a. */ - reverse_inc (); + std::swap (inc_insn.reg0, inc_insn.reg1); inc_insn.form = before_mem ? FORM_PRE_INC : FORM_POST_INC; return true; } @@ -1018,7 +996,7 @@ find_inc (bool first_try) find this. Only try it once though. */ if (first_try && !mem_insn.reg1_is_const) { - reverse_mem (); + std::swap (mem_insn.reg0, mem_insn.reg1); return find_inc (false); } else @@ -1119,7 +1097,7 @@ find_inc (bool first_try) return false; if (!rtx_equal_p (m
Re: [PATCH] add self-tuning to x86 hardware fast path in libitm
Hello everyone, just wanted to ping back to say that I have been overwhelmed with work and will be back on this as soon as possible, most likely during July. Best regards, -- Nuno Diegues On Tue, May 19, 2015 at 3:17 PM, Torvald Riegel wrote: > On Mon, 2015-05-18 at 23:27 -0400, Nuno Diegues wrote: >> On Mon, May 18, 2015 at 5:29 PM, Torvald Riegel wrote: >> > >> > Are there better options for the utility function, or can we tune it to >> > be less affected by varying txn length and likelihood of txnal vs. >> > nontxnal code? What are the things we want to avoid with the tuning? I >> > can think of: >> > * Not needing to wait for serial txns, or being aborted by a serial txn. >> > * Not retrying using HTM too much so that the retry time is larger than >> > the scalability we actually gain by having other txns commit >> > concurrently. >> >> >> Yes, those are the key points we want to make sure that do not happen. >> >> > >> > >> > Anything else? Did you consider other utility functions during your >> > research? >> >> >> The txnal vs nontxnal is indeed a completely different story. To account for >> this we would need extra book-keeping to count only cycles spent inside >> txnal code. So this would require every thread (or a sample of threads) to >> perform a rdtsc (or equivalent) on every begin/end call rather than the >> current approach of a single rdtsc per optimization round. >> >> With this type of online optimization we found that the algorithm had to be >> very simple and cheap to execute. RDTSC was a good finding to fit this, and >> it enabled us to obtain gains. Other time sources failed to do so. >> >> I do not have, out of the box, a good alternative to offer. I suppose it >> would >> take some iterations of thinking/experimenting with, just like with any >> research >> problem :) > > So let's iterate on this in parallel with the other changes that we need > to get in place. I'd prefer to have some more confidence that measuring > txn throughput in epochs is the best way forward. > > Here are a few thoughts: > > Why do we actually need to measure succeeded transactions? If a HW txn > is just getting committed without interfering with anything else, is > this really different from, say, two HW txns getting committed? Aren't > we really just interested in wasted work, or delayed txns? That may > help taking care of the nontxnal vs. txnal problem. > > Measuring committed txns during a time that might otherwise be spent by > a serial txns could be useful to figure out how much other useful work a > serial txn prevents. But we'd see that as well if we'd just go serial > during the auto-tuning because then concurrent txns will have to wait; > and in this case we could measure it in the slow path of those > concurrent txns (ie, during waiting, where measurement overhead wouldn't > matter as much). > > If a serial txn is running, concurrent txns (that wait) are free to sync > and tell the serial how much cost it creates for the concurrent txns. > There, txn length could matter, but we won't find out for real until > after the concurrent ones have run (they could be pretty short, so we > can't simply assume that the concurrent ones are as long as the serial > one, so that simply the number of concurrent ones can be used to > calculate delayed work). > >> >> > Also, note that the mitigation strategy for rdtsc >> > short-comings that you mention in the paper is not applicable in >> > general, specifically not in libitm. >> >> >> I suppose you mean the preemption of threads inflating the cycles measured? > > Yes, preemption and migration of threads (in case there's no global > sync'ed TSC or similar) -- you mentioned in the paper that you pin > threads to cores... > >> This would be similarly a problem to any time source that tries to measure >> the >> amount of work performed; not sure how we can avoid it in general. Any >> thoughts? > > Not really as long as we keep depending on measuring time in a > light-weight way. Measuring smaller time intervals could make it less > likely that preemption happens during such an interval, though. > >> >> > Another issue is that we need to implement the tuning in a portable way. >> > You currently make it depend on whether the assembler knows about RTM, >> > whereas the rest of the code makes this more portable and defers to >> > arch-specific files. I'd prefer if we could use the tuning on other >> > archs too. But for that, we need to cleanly separate generic from >> > arch-specific parts. That affects magic numbers as well as things like >> > rdtsc(). >> >> >> Yes, I refrained from adding new calls to the arch-specific files, to >> contain the >> changes mainly. But that is possible and that's part of the feedback I >> was hoping >> to get. > > OK. Let me know if you want further input regarding this. > >> > I'm wondering about whether it really makes sense to treat XABORT like >> > conflicts and other abort reasons, instead of like capacity
Re: [PATCH, stage1] Make parloops gate more strict
On June 14, 2015 10:55:59 AM GMT+02:00, Tom de Vries wrote: >On 13/03/15 11:36, Richard Biener wrote: >> On Fri, Mar 13, 2015 at 11:32 AM, Tom de Vries > wrote: >>> Hi, >>> >>> this patch moves a bunch of early-out tests from the parloops pass >to the >>> gate function. >>> >>> The only effect is for functions that we don't consider at all for >>> parallelization in the parloops pass. We no longer dump those in the >>> parloops dump file. >>> >>> Bootstrapped and reg-tested on x86_64. >>> >>> OK for stage1 trunk? >> >> Does it work with -fdump-passes? >> > >Hi, > >with -fdump-passes now fixed to work on a dummy function (r222129), I'm > >resubmitting this patch, split up in two patches. > >The first patch moves two trivial early-exit tests to the parloops >gate. > >The second patch moves the number_of_loops test to the parloops gate, >and adds a dummy loops structure in the dummy function for >-fdump-passes. > >Bootstrapped and reg-tested on x86_64. > >Both patches OK for trunk? diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 02f44eb..a1659a3 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2535,10 +2535,6 @@ parallelize_loops (void) source_location loop_loc; /* Do not parallelize loops in the functions created by parallelization. */ - if (parallelized_function_p (cfun->decl)) -return false; - if (cfun->has_nonlocal_label) -return false; gcc_obstack_init (&parloop_obstack); reduction_info_table_type reduction_list (10); Now stray comment? Stopped reading here. Thanks,
Drop TYPE_NEEDS_CONSTRUCTING checks from ipa-pure-const and tree-inline
Hi, this patch removes last two remaining uses of TYPE_NEEDS_CONSTRUCTING in the back-end. I believe those are remainders from the time we did not gimplify as much as we do now. Alias analysis machinery already skips checks of TYPE_NEEDS_CONSTRUCTING and thus we need to mark tree correctly as non-readonly if it is constructed. Incrementally I would like to remove TYPE_NEEDS_CONSTRUCTING streaming and clear it in free_lang_data. Bootstrapped/regtested ppc64le-linux, OK? Honza * ipa-pure-const.c (check_decl): Do not check TYPE_NEEDS_CONSTRUCTING. * tree-inline.c (setup_one_parameter): Likewise. Index: ipa-pure-const.c === --- ipa-pure-const.c(revision 224463) +++ ipa-pure-const.c(working copy) @@ -335,7 +335,7 @@ if (DECL_EXTERNAL (t) || TREE_PUBLIC (t)) { /* Readonly reads are safe. */ - if (TREE_READONLY (t) && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (t))) + if (TREE_READONLY (t)) return; /* Read of a constant, do not change the function state. */ else { Index: tree-inline.c === --- tree-inline.c (revision 224463) +++ tree-inline.c (working copy) @@ -3151,18 +3151,6 @@ automatically replaced by the VAR_DECL. */ insert_decl_map (id, p, var); - /* Even if P was TREE_READONLY, the new VAR should not be. - In the original code, we would have constructed a - temporary, and then the function body would have never - changed the value of P. However, now, we will be - constructing VAR directly. The constructor body may - change its value multiple times as it is being - constructed. Therefore, it must not be TREE_READONLY; - the back-end assumes that TREE_READONLY variable is - assigned to only once. */ - if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (p))) -TREE_READONLY (var) = 0; - /* If there is no setup required and we are in SSA, take the easy route replacing all SSA names representing the function parameter by the SSA name passed to function.
Re: [PATCH, stage1] Make parloops gate more strict
On 14/06/15 23:49, Bernhard Reutner-Fischer wrote: On June 14, 2015 10:55:59 AM GMT+02:00, Tom de Vries wrote: On 13/03/15 11:36, Richard Biener wrote: On Fri, Mar 13, 2015 at 11:32 AM, Tom de Vries wrote: Hi, this patch moves a bunch of early-out tests from the parloops pass to the gate function. The only effect is for functions that we don't consider at all for parallelization in the parloops pass. We no longer dump those in the parloops dump file. Bootstrapped and reg-tested on x86_64. OK for stage1 trunk? Does it work with -fdump-passes? Hi, with -fdump-passes now fixed to work on a dummy function (r222129), I'm resubmitting this patch, split up in two patches. The first patch moves two trivial early-exit tests to the parloops gate. The second patch moves the number_of_loops test to the parloops gate, and adds a dummy loops structure in the dummy function for -fdump-passes. Bootstrapped and reg-tested on x86_64. Both patches OK for trunk? diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 02f44eb..a1659a3 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2535,10 +2535,6 @@ parallelize_loops (void) source_location loop_loc; /* Do not parallelize loops in the functions created by parallelization. */ - if (parallelized_function_p (cfun->decl)) -return false; - if (cfun->has_nonlocal_label) -return false; gcc_obstack_init (&parloop_obstack); reduction_info_table_type reduction_list (10); Now stray comment? Stopped reading here. Fixed in updated patch. Also: - made sure cfun is not used in the gate function - added missing update of function header comment for init_loops_structure - improved comment in pass_manager::dump_passes. OK for trunk? Thanks, - Tom [PATCH 1/2] Move parallelize_loops tests to parloops gate 2015-06-08 Tom de Vries * tree-parloops.c (parallelize_loops): Move early-exit tests to ... (pass_parallelize_loops::gate): ... here. --- gcc/tree-parloops.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 3495ac1..50b8d75 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -2531,12 +2531,6 @@ parallelize_loops (void) HOST_WIDE_INT estimated; source_location loop_loc; - /* Do not parallelize loops in the functions created by parallelization. */ - if (parallelized_function_p (cfun->decl)) -return false; - if (cfun->has_nonlocal_label) -return false; - gcc_obstack_init (&parloop_obstack); reduction_info_table_type reduction_list (10); init_stmt_vec_info_vec (); @@ -2654,7 +2648,14 @@ public: {} /* opt_pass methods: */ - virtual bool gate (function *) { return flag_tree_parallelize_loops > 1; } + virtual bool gate (function *fun) +{ + return (flag_tree_parallelize_loops > 1 + /* Do not parallelize loops in the functions created by + parallelization. */ + && !parallelized_function_p (fun->decl) + && !fun->has_nonlocal_label); +} virtual unsigned int execute (function *); }; // class pass_parallelize_loops -- 1.9.1 [PATCH 2/2] Move parloops::execute test to parloops gate 2015-06-11 Tom de Vries * cfgloop.c (init_loops_structure): Add and handle dummy_p parameter. (flow_loops_find): Add extra argument to call to init_loops_structure. * cfgloop.h (init_loops_structure): Add bool parameter. * cgraphunit.c (init_lowered_empty_function): Add extra argument to call to init_loops_structure. * lto-streamer-in.c (input_cfg): Same. * tree-cfg.c (move_sese_region_to_fn): Same. * passes.c (pass_manager::dump_passes): Add dummy loops structure to dummy function. * tree-parloops.c (pass_parallelize_loops::execute): Move early-exit test to .. (pass_parallelize_loops::gate): ... here. --- gcc/cfgloop.c | 22 +- gcc/cfgloop.h | 2 +- gcc/cgraphunit.c | 2 +- gcc/lto-streamer-in.c | 2 +- gcc/passes.c | 4 gcc/tree-cfg.c| 2 +- gcc/tree-parloops.c | 6 ++ 7 files changed, 23 insertions(+), 17 deletions(-) diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 20b81b3..2335ecb 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -349,11 +349,12 @@ alloc_loop (void) } /* Initializes loops structure LOOPS, reserving place for NUM_LOOPS loops - (including the root of the loop tree). */ + (including the root of the loop tree). If DUMMY_P, don't use information + from FN. */ void -init_loops_structure (struct function *fn, - struct loops *loops, unsigned num_loops) +init_loops_structure (struct function *fn, struct loops *loops, + unsigned num_loops, bool dummy_p) { struct loop *root; @@ -362,11 +363,14 @@ init_loops_structure (struct function *fn, /* Dummy loop containing whole function. */ root = alloc_loop (); - root->num_nodes = n_basic_blocks_for_fn (fn); - root->latch = EXIT_BLOCK_PTR_FOR_FN (fn); - root->header = ENTRY_
Re: [PATCH] Move gen_* stubs from defaults.h to genflags
On 10.06.2015 10:05, Richard Sandiford wrote: >> +/* Structure which holds data, required for generating stub gen_* function. >> */ > > No comma after "data" > >> +/* These instructions require default stub function. Stubs are never >> called. > > "require a default" > [snip] > Seems like this is more naturally a hash_table rather than a hash_map. > I think there's also a preference to avoid static constructor-based > initialisation. Fixed. > There again, this is a generator, so those kinds of concerns aren't > particularly important. If we do keep the above though, I think we > should put the hasher in hash-map-table.h now. Otherwise these FIXMEs > are just going to accumulate, and each time makes it less likely that > any consolidation will actually happen. Well, after changing hash_map to hash_table, the hasher class is no longer identical to other hash traits classes. As for fixing other occurrences, I think I'd better leave it for another patch. On 10.06.2015 17:55, Trevor Saunders wrote: >> + /* Number of arguments (i.e., instruction operands). */ >> + int opno; > > unsigned? Fixed. >> + /* Set to true when generator is output, so no stub is needed. */ >> + bool done; >> +}; >> + >> +/* These instructions require default stub function. Stubs are never >> called. > > are the ones that don't call gcc_unreachable () called? > Well, bootstrap on x86_64 passes without such calls, but in general case, I think they may get called (comment from genflags.c:main): /* We need to see all the possibilities. Elided insns may have direct calls to their generators in C code. */ For example, this would work if result of gen_* function is passed directly to some emit_pattern_* function (they can handle NULL pointers). >> +/* Print out a dummy for generator for instruction NAME with NUM arguments >> + which either does nothing, or aborts (depending on UNREACHABLE). */ > > I believe you should drop the first "for" in this sentence. Fixed. -- Regards, Mikhail Maltsev diff --git a/gcc/defaults.h b/gcc/defaults.h index 057b646..5beddea 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -1426,96 +1426,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define TARGET_VTABLE_USES_DESCRIPTORS 0 #endif -#ifndef HAVE_simple_return -#define HAVE_simple_return 0 -static inline rtx -gen_simple_return () -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_return -#define HAVE_return 0 -static inline rtx -gen_return () -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_epilogue -#define HAVE_epilogue 0 -static inline rtx -gen_epilogue () -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_mem_thread_fence -#define HAVE_mem_thread_fence 0 -static inline rtx -gen_mem_thread_fence (rtx) -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_memory_barrier -#define HAVE_memory_barrier 0 -static inline rtx -gen_memory_barrier () -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_mem_signal_fence -#define HAVE_mem_signal_fence 0 -static inline rtx -gen_mem_signal_fence (rtx) -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_load_multiple -#define HAVE_load_multiple 0 -static inline rtx -gen_load_multiple (rtx, rtx, rtx) -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_store_multiple -#define HAVE_store_multiple 0 -static inline rtx -gen_store_multiple (rtx, rtx, rtx) -{ - gcc_unreachable (); - return NULL; -} -#endif - -#ifndef HAVE_tablejump -#define HAVE_tablejump 0 -static inline rtx -gen_tablejump (rtx, rtx) -{ - gcc_unreachable (); - return NULL; -} -#endif - #endif /* GCC_INSN_FLAGS_H */ #endif /* ! GCC_DEFAULTS_H */ diff --git a/gcc/genflags.c b/gcc/genflags.c index 0da15f1..2fdf54f 100644 --- a/gcc/genflags.c +++ b/gcc/genflags.c @@ -26,10 +26,70 @@ along with GCC; see the file COPYING3. If not see #include "tm.h" #include "rtl.h" #include "obstack.h" +#include "hash-table.h" #include "errors.h" #include "read-md.h" #include "gensupport.h" +/* Structure which holds data required for generating stub gen_* function. */ + +struct stub_info_t : typed_noop_remove +{ + stub_info_t (const char *, unsigned); + + /* Instruction name. */ + const char *name; + /* Number of arguments (i.e., instruction operands). */ + unsigned opno; + /* Set to true when generator is output, so no stub is needed. */ + bool done; + + /* Helpers for hash_table. */ + typedef stub_info_t *value_type; + typedef const char *compare_type; + static inline hashval_t hash (const stub_info_t *); + static inline bool equal (const stub_info_t *, const char *); +}; + +stub_info_t::stub_info_t (const char *name_, unsigned opno_) : name (name_), + opno (opno_), + done (false) +{ +} + +inline hashval_t +stub_info_t::hash (cons
Remove streaming of TYPE_NO_FORCE_BLK
Hi, as disucssed in the PR log, TYPE_NO_FORCE_BLK is local bookkepping of stor-layout and does not need to be streamed. Bootstrapped/regtested x86_64-linux, tested on firefox build and committed. PR ipa/66181 * lto.c (compare_tree_sccs_1): Do not compare TYPE_NO_FORCE_BLK. * lto-streamer-out.c (hash_tree): Do not hash TYPE_NO_FORCE_BLK. * tree-streamer-out.c (pack_ts_type_common_value_fields): Do not stream TYPE_NO_FORCE_BLK. * tree-streamer-in.c (unpack_ts_type_common_value_fields): Likewise. Index: lto/lto.c === --- lto/lto.c (revision 224470) +++ lto/lto.c (working copy) @@ -1159,7 +1159,6 @@ compare_tree_sccs_1 (tree t1, tree t2, t { compare_values (TYPE_MODE); compare_values (TYPE_STRING_FLAG); - compare_values (TYPE_NO_FORCE_BLK); compare_values (TYPE_NEEDS_CONSTRUCTING); if (RECORD_OR_UNION_TYPE_P (t1)) { Index: lto-streamer-out.c === --- lto-streamer-out.c (revision 224470) +++ lto-streamer-out.c (working copy) @@ -1119,7 +1119,8 @@ hash_tree (struct streamer_tree_cache_d { hstate.add_wide_int (TYPE_MODE (t)); hstate.add_flag (TYPE_STRING_FLAG (t)); - hstate.add_flag (TYPE_NO_FORCE_BLK (t)); + /* TYPE_NO_FORCE_BLK is private to stor-layout and need +no streaming. */ hstate.add_flag (TYPE_NEEDS_CONSTRUCTING (t)); hstate.add_flag (TYPE_PACKED (t)); hstate.add_flag (TYPE_RESTRICT (t)); Index: tree-streamer-out.c === --- tree-streamer-out.c (revision 224470) +++ tree-streamer-out.c (working copy) @@ -318,7 +318,8 @@ pack_ts_type_common_value_fields (struct { bp_pack_machine_mode (bp, TYPE_MODE (expr)); bp_pack_value (bp, TYPE_STRING_FLAG (expr), 1); - bp_pack_value (bp, TYPE_NO_FORCE_BLK (expr), 1); + /* TYPE_NO_FORCE_BLK is private to stor-layout and need + no streaming. */ bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING (expr), 1); if (RECORD_OR_UNION_TYPE_P (expr)) { Index: tree-streamer-in.c === --- tree-streamer-in.c (revision 224470) +++ tree-streamer-in.c (working copy) @@ -370,7 +370,8 @@ unpack_ts_type_common_value_fields (stru mode = bp_unpack_machine_mode (bp); SET_TYPE_MODE (expr, mode); TYPE_STRING_FLAG (expr) = (unsigned) bp_unpack_value (bp, 1); - TYPE_NO_FORCE_BLK (expr) = (unsigned) bp_unpack_value (bp, 1); + /* TYPE_NO_FORCE_BLK is private to stor-layout and need + no streaming. */ TYPE_NEEDS_CONSTRUCTING (expr) = (unsigned) bp_unpack_value (bp, 1); if (RECORD_OR_UNION_TYPE_P (expr)) {
Re: [C++/58583] ICE instantiating NSDMIs
Ping? https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00674.html #On 06/09/15 09:46, Nathan Sidwell wrote: On 06/08/15 13:47, Jason Merrill wrote: How about using a DECL_LANG_FLAG instead of creating a garbage DEFAULT_ARG? This patch uses DECL_LANG_FLAG_2 on the FIELD_DECL to mark that its NSDMI is being instantiated. I also discovered I'd flubbed the markup on the testcase, not sure why I didn't notice that in the test results. I've double checked this time, and all looks good. built & tested on x86_64-linux-gnu nathan
RE: [RFC] Sanitize rtx_addr_can_trap_p_1
Hi, I have here an updated patch, which improves two things: First it moves debug code out to an extra patch, as suggested by Jakub. Secondly, it fixes the checks on STACK_GROWS_DOWNWARD and ARGS_GROW_DOWNWARD. Previously these used to be conditionally defined symbols, but recently they were changed to be always defined, but with 0 or 1. That made all #ifndef checks on those two flags work the wrong way, and it caused most of the false positives in the previous version. Now the number of false positives in the stage2 drops significantly to only 4 new ones: *** argp can trap: function=uw_init_context_1, pass=reload, offset=236, size=4, low_bound=-16, high_bound=16 *** argp can trap: function=uw_init_context_1, pass=reload, offset=236, size=4, low_bound=-16, high_bound=16 *** argp can trap: function=uw_init_context_1, pass=reload, offset=440, size=8, low_bound=-16, high_bound=16 *** argp can trap: function=uw_init_context_1, pass=reload, offset=440, size=8, low_bound=-16, high_bound=16 These came from libgcc/unwind-dw2.c They seem to have the same reason as the 2930 "frame can trap" warnings that were already there before the patch. All these seem to happen due to some hidden bug. In the debugger the call stack looks always like this: #0 rtx_addr_can_trap_p_1 (x=0x76ecb378, offset=440, size=8, mode=DImode, unaligned_mems=false) at ../../gcc-trunk/gcc/rtlanal.c:671 #1 0x00d90f4a in rtx_addr_can_trap_p_1 (x=0x767ac7f8, offset=0, size=8, mode=DImode, unaligned_mems=false) at ../../gcc-trunk/gcc/rtlanal.c:699 #2 0x00d953c4 in may_trap_p_1 (x=0x767ac810, flags=0) at ../../gcc-trunk/gcc/rtlanal.c:2760 #3 0x00d95619 in may_trap_p_1 (x=0x7671ac90, flags=0) at ../../gcc-trunk/gcc/rtlanal.c:2838 #4 0x00d956cc in may_trap_p (x=0x7671ac90) at ../../gcc-trunk/gcc/rtlanal.c:2857 #5 0x00c6b2ab in process_bb_lives (bb=0x76c3a958, curr_point=@0x7fffd8e4: 23, dead_insn_p=true) at ../../gcc-trunk/gcc/lra-lives.c:698 #6 0x00c6d19a in lra_create_live_ranges_1 (all_p=true, dead_insn_p=true) at ../../gcc-trunk/gcc/lra-lives.c:1262 #7 0x00c6d47c in lra_create_live_ranges (all_p=true, dead_insn_p=true) at ../../gcc-trunk/gcc/lra-lives.c:1327 #8 0x00c4a253 in lra (f=0x24f7940) at ../../gcc-trunk/gcc/lra.c:2309 #9 0x00bf3d25 in do_reload () at ../../gcc-trunk/gcc/ira.c:5401 #10 0x00bf40d3 in (anonymous namespace)::pass_reload::execute (this=0x23fce20) at ../../gcc-trunk/gcc/ira.c:5572 #11 0x00d08e37 in execute_one_pass (pass=0x23fce20) at ../../gcc-trunk/gcc/passes.c:2359 #12 0x00d09081 in execute_pass_list_1 (pass=0x23fce20) at ../../gcc-trunk/gcc/passes.c:2412 #13 0x00d090b2 in execute_pass_list_1 (pass=0x23fbda0) at ../../gcc-trunk/gcc/passes.c:2413 #14 0x00d090ef in execute_pass_list (fn=0x77044c78, pass=0x23f8bc0) at ../../gcc-trunk/gcc/passes.c:2423 #15 0x008de80c in cgraph_node::expand (this=0x76c09498) at ../../gcc-trunk/gcc/cgraphunit.c:1937 #16 0x008dee3d in expand_all_functions () at ../../gcc-trunk/gcc/cgraphunit.c:2073 #17 0x008df954 in symbol_table::compile (this=0x76ecf000) at ../../gcc-trunk/gcc/cgraphunit.c:2426 #18 0x008dfb68 in symbol_table::finalize_compilation_unit (this=0x76ecf000) at ../../gcc-trunk/gcc/cgraphunit.c:2513 #19 0x00e094ba in compile_file () at ../../gcc-trunk/gcc/toplev.c:580 #20 0x00e0b9fa in do_compile () at ../../gcc-trunk/gcc/toplev.c:2070 #21 0x00e0bc46 in toplev::main (this=0x7fffdc50, argc=35, argv=0x7fffdd58) at ../../gcc-trunk/gcc/toplev.c:2171 #22 0x016b656d in main (argc=35, argv=0x7fffdd58) at ../../gcc-trunk/gcc/main.c:39 I cannot find any instruction in the rtl dumps that corresponds to this large argp offset. So I think there must be something wrong along the call stack above, which looks identically even on the bogus frame pointer references. Is this patch OK for trunk now? At least Jakub and I are in favour of it, Eric is against it. That makes 2:1 ... Thanks Bernd. gcc/ChangeLog: 2015-06-11 Bernd Edlinger PR rtl-optimization/61047 * rtlanal.c (get_initial_register_offset): New function. (rtx_addr_can_trap_p_1): Check offsets of stack references. testsuite/ChangeLog: 2015-06-11 Bernd Edlinger PR rtl-optimization/61047 * gcc.c-torture/execute/20150611-1.c: New testcase. patch-pr61047.diff Description: Binary data patch-pr61047-debug.diff Description: Binary data