[PATCH] Fix memory leak within ipa_inline

2013-10-09 Thread David Malcolm
ipa-inline.c:ipa_inline leaks "order" when optimizations are disabled. This potentially becomes significant in my JIT branch since the compilation code could be invoked many times within one process. Bootstrapped and regtested against trunk on x86_64-unknown-linux. OK for trunk? (Seen using valg

Re: [3/6] OpenMP 4.0 C++ FE support

2013-10-09 Thread Jason Merrill
On 10/08/2013 03:53 PM, Jakub Jelinek wrote: case OMP_CLAUSE_REDUCTION: - gcc_assert (!is_invisiref_parm (OMP_CLAUSE_DECL (stmt))); + if (is_invisiref_parm (OMP_CLAUSE_DECL (stmt))) + { + *walk_subtrees = 0; + if (OMP_CLAUSE_REDUCTION_INIT (stmt)) +

coverage.c: Fix leak of da_file_name

2013-10-09 Thread David Malcolm
coverage_init allocates da_file_name using XNEWVEC, but it is never freed. This shows up as a slow memory leak in my JIT code when repeatedly invoking the compiler code within a single process. This patch frees it in coverage_finish with XDELETEVEC (and NULLs it to be sure). Bootstrapped and reg

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-10-09 Thread Jason Merrill
On 10/09/2013 01:43 PM, Jakub Jelinek wrote: Perhaps DECL_TEMPLATE_INFO check could also be less expensive to be done before calling decl_maybe_constant_var_p or undeduced_auto_decl ? Sure. + DECL_LOCAL_FUNCTION_P (fndecl) = 1; This should be set by pushdecl_maybe_friend_1, so I don

[PATCH] Add --enable-host-shared configuration option

2013-10-09 Thread David Malcolm
My JIT branch requires embedding GCC's code as a shared library on the host. To do requires building the host code as position-independent, which unfortunately incurs a small speed hit. Hence we need a configuration option, so that you can opt-in to position-independent host code. This patch add

[PATCH 1/2] Handwritten part of conversion of IPA pass hooks to virtual functions

2013-10-09 Thread David Malcolm
* passes.c (ipa_opt_pass_d::generate_summary): New. (ipa_opt_pass_d::write_summary): New. (ipa_opt_pass_d::read_summary): New. (ipa_opt_pass_d::write_optimization_summary): New. (ipa_opt_pass_d::read_optimization_summary): New. (ipa_opt_pass_d::stmt_f

[PATCH 0/2] Convert IPA pass hooks to virtual functions

2013-10-09 Thread David Malcolm
r201505 and r201508 converted passes to C++ classes, with the gate and execute hooks becoming virtual functions, allowing for the possibility of storing state within pass instances, rather than statically allocating it. This has benefits for state-isolation, for example within my JIT branch, which

Re: [GOOGLE] Represent the callsite with lineno only for AutoFDO

2013-10-09 Thread Xinliang David Li
Ok (please add a short comment on the decl_lineno which encodes discriminator in it). David On Wed, Oct 9, 2013 at 4:57 PM, Dehao Chen wrote: > In legacy AutoFDO, callsite is represented as a (lineno, callee_name) > pair because there could be multiple calls in one line. However, as we > enhance

[PATCH 2/2] Automated conversion of IPA passes to new API

2013-10-09 Thread David Malcolm
gcc/ Patch autogenerated by refactor_ipa_passes.py from https://github.com/davidmalcolm/gcc-refactoring-scripts revision 9518113a5604ede755ea1dc1f073a1863f5a6de5 * ipa-cp.c (pass_ipa_cp): Convert to new API for IPA passes. * ipa-devirt.c (pass_ipa_devirt):

Re: [PATCH] Add --enable-host-shared configuration option

2013-10-09 Thread Joseph S. Myers
On Wed, 9 Oct 2013, David Malcolm wrote: > This patch adds an "--enable-host-shared" option throughout the various > configure/Make machinery for host code, adding "-fPIC" where appropriate > when enabled. Please document this in install.texi (even if it isn't particularly useful at the stage wh

Re: coverage.c: Fix leak of da_file_name

2013-10-09 Thread Ian Lance Taylor
On Wed, Oct 9, 2013 at 5:18 PM, David Malcolm wrote: > coverage_init allocates da_file_name using XNEWVEC, but it is never > freed. This shows up as a slow memory leak in my JIT code when > repeatedly invoking the compiler code within a single process. > > This patch frees it in coverage_finish w

Re: [PATCH] Reassociate X == CST1 || X == CST2 if popcount (CST2 - CST1) == 1 into ((X - CST1) & ~(CST2 - CST1)) == 0

2013-10-09 Thread Jeff Law
On 08/05/13 02:08, Zhenqiang Chen wrote: Hi The patch reassociates X == CST1 || X == CST2 if popcount (CST2 - CST1) == 1 into ((X - CST1) & ~(CST2 - CST1)) == 0. Bootstrap on x86-64 and ARM chromebook. No make check regression on x86-64 and panda board. For some targets/options, the "(X == CST

Go patch committed: Don't inherit types of logical operators

2013-10-09 Thread Ian Lance Taylor
The Go frontend has a minor type error: it inherited the types of operands of logical operators (&& and ||) from the context. This patch fixes the bug. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Will commit to 4.8 branch when it reopens. Ian diff -r

Go patch committed: Fix test for make argument too large

2013-10-09 Thread Ian Lance Taylor
This patch to the Go frontend fixes the test for whether a constant argument to the builtin function make is too large. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Will commit to 4.8 when the branch opens. Ian diff -r 5aa7a9d25a56 go/expressions.cc ---

Re: [GOOGLE] Iterative AutoFDO

2013-10-09 Thread Xinliang David Li
> /* Program behavior changed, original promoted (and inlined) target is not > hot any more. Will avoid promote the original target. */ > if (total >= info->first * 0.5) > return false; This part is still not clear: Difference between OLD_INFO and INFO, factor 0.5 comes from where etc. > g

<    1   2