Re: [AArch64] [SVE] PR88837 - Poor vector construction code in VL-specific mode

2019-05-30 Thread Prathamesh Kulkarni
On Wed, 29 May 2019 at 18:10, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > Hi, > > The attached patch tries to improve initialization for fixed-length > > SVE vector and it's algorithm is described in comments for > > aarch64_sve_expand_vector_

[AArch64] [SVE] PR88837 - Poor vector construction code in VL-specific mode

2019-05-27 Thread Prathamesh Kulkarni
+test on patch in qemu. Does the patch look OK ? Thanks, Prathamesh 2019-05-27 Prathamesh Kulkarni Richard Sandiford * vector-builder.h (vector_builder::count_dups): New method. * config/aarch64/aarch64-protos.h (aarch64_expand_sve_vector_init): De

cse.c typo fix

2019-05-22 Thread Prathamesh Kulkarni
Hi, The attached patch fixes a typo in cse_dump_path, which I came across while debugging another issue. OK to commit ? Thanks, Prathamesh 2019-05-22 Prathamesh Kulkarni * cse.c (cse_dump_path): s/dump_file/f. diff --git a/gcc/cse.c b/gcc/cse.c index 6c9cda16a98..35840a6d5ca 100644

Re: [PATCH] Add simplification rule tanh (x) * cosh (x) -> sinh (x)

2019-04-29 Thread Prathamesh Kulkarni
On Tue, 30 Apr 2019 at 02:56, Jeff Law wrote: > > On 1/30/19 7:10 AM, Bárbara de Castro Fernandes wrote: > > This patch simplifies the function tanh (x) * cosh (x) -> sinh (x). > > This rule is derived from the relationship between hyperbolic > > functions. > > > > I ran the tests and gfortran.dg/

[SVE ACLE] Fix for PR88839

2019-04-06 Thread Prathamesh Kulkarni
Hi, I committed attached patch, which fixes PR88839 to sve-acle-branch after approval from Richard Sandiford offline. Thanks, Prathamesh diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index ec60e972f5f..f8d5270b982 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/confi

[SVE ACLE] Implement svlsl

2019-02-12 Thread Prathamesh Kulkarni
Committed attached patch to aarch64/sve-acle-branch. Thanks, Prathamesh diff --git a/gcc/config/aarch64/aarch64-sve-builtins.c b/gcc/config/aarch64/aarch64-sve-builtins.c index ed06db9b7c6..598411fb834 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.c +++ b/gcc/config/aarch64/aarch64-sve-buil

[SVE ACLE] Implement svlsl_wide

2019-01-18 Thread Prathamesh Kulkarni
Hi, I committed the attached patch to aarch64/sve-acle-branch that implements svlsl_wide. Thanks, Prathamesh diff --git a/gcc/config/aarch64/aarch64-sve-builtins.c b/gcc/config/aarch64/aarch64-sve-builtins.c index f080a67ef00..0e3db669422 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins.c +++

Re: PR88788 - Infinite loop in malloc_candidate_p_1

2019-01-15 Thread Prathamesh Kulkarni
On Tue, 15 Jan 2019 at 14:33, Richard Biener wrote: > > On Tue, 15 Jan 2019, Jakub Jelinek wrote: > > > On Tue, Jan 15, 2019 at 12:29:21PM +0530, Prathamesh Kulkarni wrote: > > > 2019-01-15 Richard Biener > > > Prathamesh Kulkarni > > > >

PR88788 - Infinite loop in malloc_candidate_p_1

2019-01-14 Thread Prathamesh Kulkarni
, Prathamesh 2019-01-15 Richard Biener Prathamesh Kulkarni PR ipa/88378 * ipa-pure-const.c (malloc_candidate_p_1): Add parameter visited and return true if SSA_NAME is already marked in visited bitmap. * (malloc_candidate_p): Pass visited to

Re: PR83750: CSE erf/erfc pair

2018-11-08 Thread Prathamesh Kulkarni
On Tue, 6 Nov 2018 at 16:04, Richard Biener wrote: > > On Mon, Nov 5, 2018 at 3:11 PM Prathamesh Kulkarni > wrote: > > > > On Mon, 5 Nov 2018 at 18:14, Richard Biener > > wrote: > > > > > > On Mon, Nov 5, 2018 at 1:11 PM Prathamesh Kulkarni > &

Re: [ARM] Implement division using vrecpe, vrecps

2018-11-08 Thread Prathamesh Kulkarni
On Mon, 5 Nov 2018 at 19:22, Ramana Radhakrishnan wrote: > > On 26/10/2018 06:04, Prathamesh Kulkarni wrote: > > Hi, > > This is a rebased version of patch that adds a pattern to neon.md for > > implementing division with multiplication by reciprocal using > > vr

Re: PR83750: CSE erf/erfc pair

2018-11-05 Thread Prathamesh Kulkarni
On Mon, 5 Nov 2018 at 18:14, Richard Biener wrote: > > On Mon, Nov 5, 2018 at 1:11 PM Prathamesh Kulkarni > wrote: > > > > On Mon, 5 Nov 2018 at 15:10, Richard Biener > > wrote: > > > > > > On Fri, Nov 2, 2018 at 10:37 AM Prathamesh Kulkarni > &g

Re: PR83750: CSE erf/erfc pair

2018-11-05 Thread Prathamesh Kulkarni
On Mon, 5 Nov 2018 at 15:10, Richard Biener wrote: > > On Fri, Nov 2, 2018 at 10:37 AM Prathamesh Kulkarni > wrote: > > > > Hi, > > This patch adds two transforms to match.pd to CSE erf/erfc pair. > > erfc(x) is canonicalized to 1 - erf(x) and is the

Re: [ARM] Implement division using vrecpe, vrecps

2018-11-04 Thread Prathamesh Kulkarni
On Fri, 2 Nov 2018 at 19:08, Wilco Dijkstra wrote: > > Prathamesh Kulkarni wrote: > > > This is a rebased version of patch that adds a pattern to neon.md for > > implementing division with multiplication by reciprocal using > > vrecpe/vrecps with -funsafe-math-optimizat

Re: [ARM] Implement division using vrecpe, vrecps

2018-11-02 Thread Prathamesh Kulkarni
On Fri, 26 Oct 2018 at 10:34, Prathamesh Kulkarni wrote: > > Hi, > This is a rebased version of patch that adds a pattern to neon.md for > implementing division with multiplication by reciprocal using > vrecpe/vrecps with -funsafe-math-optimizations excluding -Os. > The newly ad

PR83750: CSE erf/erfc pair

2018-11-02 Thread Prathamesh Kulkarni
> 0 which resolves the regression. Bootstrapped+tested on x86_64-unknown-linux-gnu. Cross-testing on arm and aarch64 variants in progress. OK for trunk if passes ? Thanks, Prathamesh 2018-11-02 Prathamesh Kulkarni * match.pd (erfc(x) -> 1 - erf(x)): New pattern. (1 - e

[ARM] Implement division using vrecpe, vrecps

2018-10-25 Thread Prathamesh Kulkarni
which stalled the patch). Bootstrap+tested on arm-linux-gnueabihf. Cross-tested on arm*-*-* variants. OK for trunk ? Thanks, Prathamesh 2018-10-26 Prathamesh Kulkarni * config/arm/neon.md (div3): New pattern. testsuite/ * gcc.target/arm/neon-vect-div-1.c: New

Re: PR85787: Extend malloc_candidate_p to handle multiple phis.

2018-10-04 Thread Prathamesh Kulkarni
On Fri, 14 Sep 2018 at 22:49, Jeff Law wrote: > > On 8/28/18 5:26 AM, Prathamesh Kulkarni wrote: > > H > > The attached patch extends malloc_candidate_p to handle multiple phis. > > There's a lot of noise in the patch because I moved most of > > mallo

Re: PR85787: Extend malloc_candidate_p to handle multiple phis.

2018-09-05 Thread Prathamesh Kulkarni
On 28 August 2018 at 16:56, Prathamesh Kulkarni wrote: > H > The attached patch extends malloc_candidate_p to handle multiple phis. > There's a lot of noise in the patch because I moved most of > malloc_candidate_p into > new function malloc_candidate_p_1. The only real chan

PR85787: Extend malloc_candidate_p to handle multiple phis.

2018-08-28 Thread Prathamesh Kulkarni
ainst 0 and the phi. Bootstrapped+tested on x86_64-unknown-linux-gnu. OK to commit ? Thanks, Prathamesh 2018-08-28 Prathamesh Kulkarni PR tree-optimization/85787 * ipa-pure-const.c (malloc_candidate_p_1): Move most of malloc_candidate_p into this function and add suppor

Fix typo "permutaion" in vect_grouped_store_supported.

2018-08-23 Thread Prathamesh Kulkarni
Committed as obvious in r263819. Regards, Prathamesh 2018-08-23 Prathamesh Kulkarni * tree-vect-data-refs.c (vect_grouped_store_supported): Fix typo "permutaion". diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index d70d207c7d2..909728919c7 10

Re: Warning about -Wmain for local variables

2018-08-15 Thread Prathamesh Kulkarni
On 28 June 2018 at 08:46, Jeff Law wrote: > On 05/30/2018 09:51 AM, Prathamesh Kulkarni wrote: >> On 30 May 2018 at 18:12, Jonathan Wakely wrote: >>> On 30 May 2018 at 11:40, Prathamesh Kulkarni wrote: >>>> gcc with -Wmain warns for local variables

Re: [tree.c] Replace cast to (char *) by const_cast

2018-06-18 Thread Prathamesh Kulkarni
On 18 June 2018 at 19:28, Nick Clifton wrote: > Hi Prathamesh, > >> I am getting the following build error with trunk: >> ../../gcc/gcc/tree.c: In member function ‘void >> escaped_string::escape(const char*)’: >> ../../gcc/gcc/tree.c:12457:20: error: cast from type ‘const char*’ to >> type ‘char*’

[tree.c] Replace cast to (char *) by const_cast

2018-06-18 Thread Prathamesh Kulkarni
Hi, I am getting the following build error with trunk: ../../gcc/gcc/tree.c: In member function ‘void escaped_string::escape(const char*)’: ../../gcc/gcc/tree.c:12457:20: error: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Werror=cast-qual] m_str = (char *) unescaped;

Re: Warning about -Wmain for local variables

2018-06-07 Thread Prathamesh Kulkarni
On 30 May 2018 at 21:21, Prathamesh Kulkarni wrote: > On 30 May 2018 at 18:12, Jonathan Wakely wrote: >> On 30 May 2018 at 11:40, Prathamesh Kulkarni wrote: >>> gcc with -Wmain warns for local variables named main. >>> >>> int foo() >>> { >>>

Re: Warning about -Wmain for local variables

2018-05-30 Thread Prathamesh Kulkarni
On 30 May 2018 at 18:12, Jonathan Wakely wrote: > On 30 May 2018 at 11:40, Prathamesh Kulkarni wrote: >> gcc with -Wmain warns for local variables named main. >> >> int foo() >> { >> int main = 0; >> return main; >> } >> >> a.c: In

PR85817

2018-05-18 Thread Prathamesh Kulkarni
x-gnu. OK to commit if passes ? Thanks, Prathamesh 2018-05-18 Prathamesh Kulkarni PR middle-end/85817 * ipa-pure-const.c (malloc_candidate_p): Remove the check integer_zerop for retval and return false if all args to phi are zero. testsuite/ * gcc.dg/tre

Re: PR83648

2018-05-17 Thread Prathamesh Kulkarni
On 15 May 2018 at 12:20, Richard Biener wrote: > On Tue, 15 May 2018, Prathamesh Kulkarni wrote: > >> On 12 January 2018 at 18:26, Richard Biener wrote: >> > On Fri, 12 Jan 2018, Prathamesh Kulkarni wrote: >> > >> >> On 12 January 2018 at 05:02, Jeff

Re: PR83648

2018-05-14 Thread Prathamesh Kulkarni
On 12 January 2018 at 18:26, Richard Biener wrote: > On Fri, 12 Jan 2018, Prathamesh Kulkarni wrote: > >> On 12 January 2018 at 05:02, Jeff Law wrote: >> > On 01/10/2018 10:04 PM, Prathamesh Kulkarni wrote: >> >> On 11 January 2018 at 04:50, Jeff Law wro

Re: PR85734

2018-05-14 Thread Prathamesh Kulkarni
On 14 May 2018 at 15:06, Richard Biener wrote: > On Mon, 14 May 2018, Prathamesh Kulkarni wrote: > >> On 14 May 2018 at 14:46, Richard Biener wrote: >> > On Mon, 14 May 2018, Prathamesh Kulkarni wrote: >> > >> >> Hi, >> >>

Re: PR85734

2018-05-14 Thread Prathamesh Kulkarni
On 14 May 2018 at 14:46, Richard Biener wrote: > On Mon, 14 May 2018, Prathamesh Kulkarni wrote: > >> Hi, >> The attached patch tries to fix PR85734, by gating on >> !function_always_visible_to_compiler_p. >> Bootstrap+test in progress on x86_64. >> OK

PR85734

2018-05-14 Thread Prathamesh Kulkarni
Hi, The attached patch tries to fix PR85734, by gating on !function_always_visible_to_compiler_p. Bootstrap+test in progress on x86_64. OK to commit if passes ? Thanks, Prathamesh 2018-05-14 Prathamesh Kulkarni PR ipa/85734 * ipa-pure-const.c (propagate_malloc): Gate call

Re: PR81703 and Martin's fix for PR83501

2018-01-14 Thread Prathamesh Kulkarni
On 12 January 2018 at 23:25, Jakub Jelinek wrote: > On Fri, Jan 12, 2018 at 10:38:39AM -0700, Jeff Law wrote: >> >>> Thanks for pointing it out. I see it there as well with >> >>> Prathamesh's test case, though not with the test case in >> >>> bug 83543. It is the same root cause in both. I agr

Re: PR81703 and Martin's fix for PR83501

2018-01-11 Thread Prathamesh Kulkarni
On 12 January 2018 at 06:15, Martin Sebor wrote: > On 01/11/2018 02:48 PM, Rainer Orth wrote: >> >> Hi Martin, >> I am not sure why constant string is not emitted for arm-linux-gnueabihf ? As far as this issue is concerned, should I simply XFAIL it on arm for now ? >>> >>> >>>

Re: PR83648

2018-01-11 Thread Prathamesh Kulkarni
On 12 January 2018 at 05:02, Jeff Law wrote: > On 01/10/2018 10:04 PM, Prathamesh Kulkarni wrote: >> On 11 January 2018 at 04:50, Jeff Law wrote: >>> On 01/09/2018 05:57 AM, Prathamesh Kulkarni wrote: >>>> >>>> As Jakub pointed out for the

Re: PR81703 and Martin's fix for PR83501

2018-01-11 Thread Prathamesh Kulkarni
On 11 January 2018 at 16:14, Prathamesh Kulkarni wrote: > On 11 January 2018 at 14:52, Christophe Lyon > wrote: >> Hi >> >> On 10 January 2018 at 19:42, Prathamesh Kulkarni >> wrote: >>> Hi, >>> I have attached patch for PR81703 rebased on Mar

Re: PR81703 and Martin's fix for PR83501

2018-01-11 Thread Prathamesh Kulkarni
On 11 January 2018 at 14:52, Christophe Lyon wrote: > Hi > > On 10 January 2018 at 19:42, Prathamesh Kulkarni > wrote: >> Hi, >> I have attached patch for PR81703 rebased on Martin's fix for PR83501 >> posted here since both had considerable overlaps: >>

Re: PR83648

2018-01-10 Thread Prathamesh Kulkarni
On 11 January 2018 at 10:34, Prathamesh Kulkarni wrote: > On 11 January 2018 at 04:50, Jeff Law wrote: >> On 01/09/2018 05:57 AM, Prathamesh Kulkarni wrote: >>> >>> As Jakub pointed out for the case: >>> void *f() >>> { >>> return __bu

Re: PR83648

2018-01-10 Thread Prathamesh Kulkarni
On 11 January 2018 at 04:50, Jeff Law wrote: > On 01/09/2018 05:57 AM, Prathamesh Kulkarni wrote: >> >> As Jakub pointed out for the case: >> void *f() >> { >> return __builtin_malloc (0); >> } >> >> The malloc propagation would set f()

PR83775

2018-01-10 Thread Prathamesh Kulkarni
Hi, The attached patch tries to fix PR83775. Validation in progress. OK to commit if passes ? Thanks, Prathamesh 2018-01-11 Prathamesh Kulkarni PR target/83775 * config/arm/arm.c (arm_declare_function_name): Set arch_to_print if targ_options->x_arm_arch_string is

PR81703 and Martin's fix for PR83501

2018-01-10 Thread Prathamesh Kulkarni
ls to pass validation on arm targets because of PR83775. Does it look OK? Thanks, Prathamesh 2018-10-01 Martin Sebor Prathamesh Kulkarni PR tree-optimization/83501 PR tree-optimization/81703 * tree-ssa-strlen.c (get_string_cst): Rename... (get_strin

Re: PR83648

2018-01-09 Thread Prathamesh Kulkarni
On 3 January 2018 at 18:58, Jan Hubicka wrote: > >> diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c >> index 09ca3590039..0406d5588d2 100644 >> --- a/gcc/ipa-pure-const.c >> +++ b/gcc/ipa-pure-const.c >> @@ -910,7 +910,8 @@ malloc_candidate_p (function *fun, bool ipa) >> #define DUMP_AND

Re: PR82665 - missing value range optimization for memchr

2018-01-09 Thread Prathamesh Kulkarni
On 7 January 2018 at 12:28, Prathamesh Kulkarni wrote: > On 5 January 2018 at 00:20, Jeff Law wrote: >> On 01/03/2018 12:08 AM, Prathamesh Kulkarni wrote: >>> On 3 January 2018 at 12:33, Prathamesh Kulkarni >>> wrote: >>>> On 2 January 2018 at 17:49, Jak

Re: PR82665 - missing value range optimization for memchr

2018-01-06 Thread Prathamesh Kulkarni
On 5 January 2018 at 00:20, Jeff Law wrote: > On 01/03/2018 12:08 AM, Prathamesh Kulkarni wrote: >> On 3 January 2018 at 12:33, Prathamesh Kulkarni >> wrote: >>> On 2 January 2018 at 17:49, Jakub Jelinek wrote: >>>> On Tue, Jan 02, 2018 at 05:39:1

Re: PR83501

2018-01-03 Thread Prathamesh Kulkarni
On 2 January 2018 at 19:29, Richard Biener wrote: > On Thu, Dec 28, 2017 at 8:42 AM, Prathamesh Kulkarni > wrote: >> On 21 December 2017 at 12:53, Prathamesh Kulkarni >> wrote: >>> Hi Jakub, >>> Based on your suggestions in PR83501, I have updated the patc

Re: PR82665 - missing value range optimization for memchr

2018-01-02 Thread Prathamesh Kulkarni
On 3 January 2018 at 12:33, Prathamesh Kulkarni wrote: > On 2 January 2018 at 17:49, Jakub Jelinek wrote: >> On Tue, Jan 02, 2018 at 05:39:17PM +0530, Prathamesh Kulkarni wrote: >>> --- /dev/null >>> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82665.c >>> @@ -

Re: PR82665 - missing value range optimization for memchr

2018-01-02 Thread Prathamesh Kulkarni
On 2 January 2018 at 17:49, Jakub Jelinek wrote: > On Tue, Jan 02, 2018 at 05:39:17PM +0530, Prathamesh Kulkarni wrote: >> --- /dev/null >> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr82665.c >> @@ -0,0 +1,22 @@ >> +/* { dg-do compile } */ >> +/* { dg-o

PR83648

2018-01-02 Thread Prathamesh Kulkarni
Hi, malloc_candidate_p() in ipa-pure-const misses detecting that a function is malloc-like if the return value is result of PHI and one of the arguments of PHI is 0. For example: void g(unsigned n) { return (n) ? __builtin_malloc (n) : 0; } The reason is that the following check: if (TREE_CODE

Re: PR82665 - missing value range optimization for memchr

2018-01-02 Thread Prathamesh Kulkarni
On 20 November 2017 at 16:19, Jakub Jelinek wrote: > On Mon, Nov 20, 2017 at 04:13:49PM +0530, Prathamesh Kulkarni wrote: >> Hi, >> The attached patch tries to fix PR82665 by adding value-range for 'n' >> to [0, PTRDIFF_MAX - 1] in the following case: >> def =

Re: PR83501

2017-12-27 Thread Prathamesh Kulkarni
On 21 December 2017 at 12:53, Prathamesh Kulkarni wrote: > Hi Jakub, > Based on your suggestions in PR83501, I have updated the patch to > check for integer_zerop for 2nd operand of mem_ref. > > With the patch, Warray-bounds started warning for the following test > in Warray-

PR83501

2017-12-20 Thread Prathamesh Kulkarni
+ i, ma.a5); Does it look OK ? Validation in progress. Thanks, Prathamesh 2017-12-21 Prathamesh Kulkarni * tree-ssa-strlen.c (get_string_cst): New. (handle_char_store): Call get_string_cst. testsuite/ * gcc.dg/tree-ssa/pr83501-1.c: New test. * c-c++-common/Warray-

PR82665 - missing value range optimization for memchr

2017-11-20 Thread Prathamesh Kulkarni
Hi, The attached patch tries to fix PR82665 by adding value-range for 'n' to [0, PTRDIFF_MAX - 1] in the following case: def = memchr(arg, 0, sz); n = def - arg where def and arg are char *. I suppose it's safe to assume that if arg is char *, then memchr(arg, 0, sz) would return a non NULL pointe

Re: PR82808

2017-11-14 Thread Prathamesh Kulkarni
On 3 November 2017 at 15:38, Richard Biener wrote: > On Fri, Nov 3, 2017 at 6:15 AM, Prathamesh Kulkarni > wrote: >> Hi Martin, >> As mentioned in PR, the issue here for propagating value of 'm' from >> f_c1 to foo() is that the jump function operation is FL

PR82808

2017-11-02 Thread Prathamesh Kulkarni
indicate that there is no operation ? b) Patch does not passing param_type from all callers. I suppose we could fix these incrementally ? Bootstrap+tested on x86_64-unknown-linux-gnu. OK for trunk ? Thanks, Prathamesh 2017-11-03 Prathamesh Kulkarni * ipa-cp.c (ipa_get_jf_pass_through_r

[wwwdocs] Document change that ipa-pure-const pass propagates malloc attribute.

2017-10-27 Thread Prathamesh Kulkarni
Applied the attached patch to changes.html. Thanks, Prathamesh * changes.html: Document change that ipa-pure-const is extended to propagate malloc attribute. Index: changes.html === RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-8/ch

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-10-27 Thread Prathamesh Kulkarni
On 25 October 2017 at 20:44, Jan Hubicka wrote: >> On 24 October 2017 at 16:26, Jan Hubicka wrote: >> >> 2017-10-13 Prathamesh Kulkarni >> >> >> >> * cgraph.h (set_malloc_flag): Declare. >> >> * cgraph.c (set_malloc_flag_1):

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-10-25 Thread Prathamesh Kulkarni
On 24 October 2017 at 16:26, Jan Hubicka wrote: >> 2017-10-13 Prathamesh Kulkarni >> >> * cgraph.h (set_malloc_flag): Declare. >> * cgraph.c (set_malloc_flag_1): New function. >> (set_malloc_flag): Likewise. >> * ipa-fnsummary

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-10-23 Thread Prathamesh Kulkarni
On 14 October 2017 at 03:20, Prathamesh Kulkarni wrote: > On 7 October 2017 at 12:35, Prathamesh Kulkarni > wrote: >> On 7 October 2017 at 11:23, Jan Hubicka wrote: >>>> On 6 October 2017 at 06:04, Jan Hubicka wrote: >>>> >> Hi Honza, >>>>

Re: [PATCH] Simplify floating point comparisons

2017-10-18 Thread Prathamesh Kulkarni
On 17 October 2017 at 21:58, Wilco Dijkstra wrote: > This patch implements some of the optimizations discussed in > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71026. > > Simplify (C / x > 0.0) into x > 0.0. > > If C is negative the comparison is reversed. > > Simplify (x * C1) > C2 into x > (C2

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-10-13 Thread Prathamesh Kulkarni
On 7 October 2017 at 12:35, Prathamesh Kulkarni wrote: > On 7 October 2017 at 11:23, Jan Hubicka wrote: >>> On 6 October 2017 at 06:04, Jan Hubicka wrote: >>> >> Hi Honza, >>> >> Thanks for the detailed suggestions, I have updated the patch >>>

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-10-07 Thread Prathamesh Kulkarni
; Seems OK to me. >> >> >> >> Patch passes bootstrap+test and lto bootstrap+test on >> >> x86_64-unknown-linux-gnu. >> >> Verfiied SPEC2k6 compiles and runs without miscompares with LTO >> >> enabled on aarch64-linux-gnu. >> &g

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-10-06 Thread Prathamesh Kulkarni
atch by building chromium or firefox. >> Would it be OK to commit if it passes above validations ? >> >> Thanks, >> Prathamesh >> > >> > Thanks, >> > Honza > >> 2017-10-05 Prathamesh Kulkarni >> >> * cgraph.h (set_malloc_fl

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-10-05 Thread Prathamesh Kulkarni
building chromium or firefox. Would it be OK to commit if it passes above validations ? Thanks, Prathamesh > > Thanks, > Honza 2017-10-05 Prathamesh Kulkarni * cgraph.h (set_malloc_flag): Declare. * cgraph.c (set_malloc_flag_1): New function. (set_malloc_fla

Re: Transform (x >> cst) != 0 to x >= (1 << cst) and (x >> cst) == 0 to x < (1 << cst)

2017-10-04 Thread Prathamesh Kulkarni
On 3 October 2017 at 14:10, Jeff Law wrote: > On 10/03/2017 03:00 PM, Marc Glisse wrote: >> On Tue, 3 Oct 2017, Jakub Jelinek wrote: >> >>> On Tue, Oct 03, 2017 at 12:54:39PM -0700, Prathamesh Kulkarni wrote: >>>> Hi, >>>> This follow-up pat

Transform (x >> cst) != 0 to x >= (1 << cst) and (x >> cst) == 0 to x < (1 << cst)

2017-10-03 Thread Prathamesh Kulkarni
Hi, This follow-up patch implements the patterns mentioned in $subject. Bootstrap+test in progress on x86_64-unknown-linux-gnu and aarch64-linux-gnu. OK to commit if passes ? Thanks, Prathamesh 2017-10-03 Prathamesh Kulkarni * match.pd ((X >> CST) == 0 -> X < (1 <<

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-09-26 Thread Prathamesh Kulkarni
On 25 September 2017 at 17:24, Jan Hubicka wrote: >> Hi Honza, >> Could you please have a look at this patch ? >> https://gcc.gnu.org/ml/gcc-patches/2017-07/msg02063.html > > I can and I should have done long time ago. I really apologize for slow > response > and I will try to be more timely from

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-09-25 Thread Prathamesh Kulkarni
On 15 September 2017 at 17:49, Prathamesh Kulkarni wrote: > On 1 September 2017 at 08:09, Prathamesh Kulkarni > wrote: >> On 17 August 2017 at 18:02, Prathamesh Kulkarni >> wrote: >>> On 8 August 2017 at 09:50, Prathamesh Kulkarni >>> wrote: >>>&g

Re: Transform (x / y) != 0 to x >=y and (x / y) == 0 to x < y if x, y are unsigned

2017-09-25 Thread Prathamesh Kulkarni
On 18 September 2017 at 15:40, Prathamesh Kulkarni wrote: > On 15 September 2017 at 22:09, Marc Glisse wrote: >> On Fri, 15 Sep 2017, Wilco Dijkstra wrote: >> >>> Marc Glisse wrote: >>> >>>> The question is whether, having computed c=a/b, it is che

Re: [libgfortran] Replace implicit conversions between enums in io/transfer.c by explicit casts.

2017-09-25 Thread Prathamesh Kulkarni
On 12 September 2017 at 17:08, Prathamesh Kulkarni wrote: > Hi, > I am working on patch for PR78736 > (https://gcc.gnu.org/ml/gcc-patches/2017-09/msg00011.html), > which adds a new warning -Wenum-conversion to C front-end to warn for > implicit conversion between different enums. &

Re: Transform (x / y) != 0 to x >=y and (x / y) == 0 to x < y if x, y are unsigned

2017-09-18 Thread Prathamesh Kulkarni
hat we do not need to check for single-use, makes the > patch simpler, thanks. > (let's ignore -Os) Hi, Thanks for the suggestions, I have updated the patch. Is this OK ? Bootstrap+test in progress on x86_64-unknown-linux-gnu. I will try address the right shift by 4 case in follow up patch.

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-09-15 Thread Prathamesh Kulkarni
On 1 September 2017 at 08:09, Prathamesh Kulkarni wrote: > On 17 August 2017 at 18:02, Prathamesh Kulkarni > wrote: >> On 8 August 2017 at 09:50, Prathamesh Kulkarni >> wrote: >>> On 31 July 2017 at 23:53, Prathamesh Kulkarni >>> wrote: >>>&

Transform (x / y) != 0 to x >=y and (x / y) == 0 to x < y if x, y are unsigned

2017-09-15 Thread Prathamesh Kulkarni
Hi, This patch adds the transforms mentioned in $subject. Bootstrap+test in progress on x86_64-unknown-linux-gnu. OK to commit if passes ? Thanks, Prathamesh 2017-09-15 Prathamesh Kulkarni * match.pd ((X / Y) == 0 -> X < Y): New pattern. ((X / Y) != 0 -> X >=

[libgfortran] Replace implicit conversions between enums in io/transfer.c by explicit casts.

2017-09-12 Thread Prathamesh Kulkarni
? Or are these warnings false positives ? The attached patch makes the conversion explicit to silence the warnings. Bootstrap+tested on x86_64-unknown-linux-gnu. Does the patch look OK ? Thanks, Prathamesh 2017-09-12 Prathamesh Kulkarni libgfortran/ * io/transfer.c (current_mode): Cast

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-08-31 Thread Prathamesh Kulkarni
On 17 August 2017 at 18:02, Prathamesh Kulkarni wrote: > On 8 August 2017 at 09:50, Prathamesh Kulkarni > wrote: >> On 31 July 2017 at 23:53, Prathamesh Kulkarni >> wrote: >>> On 23 May 2017 at 19:10, Prathamesh Kulkarni >>> wrote: >>>

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-08-31 Thread Prathamesh Kulkarni
On 26 August 2017 at 04:15, Joseph Myers wrote: > On Tue, 11 Jul 2017, Prathamesh Kulkarni wrote: > >> On 13 June 2017 at 01:47, Joseph Myers wrote: >> > This is OK with one fix: >> > >> >> +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabled

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-08-17 Thread Prathamesh Kulkarni
On 8 August 2017 at 09:50, Prathamesh Kulkarni wrote: > On 31 July 2017 at 23:53, Prathamesh Kulkarni > wrote: >> On 23 May 2017 at 19:10, Prathamesh Kulkarni >> wrote: >>> On 19 May 2017 at 19:02, Jan Hubicka wrote: >>>>> >>>>> * L

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-08-17 Thread Prathamesh Kulkarni
On 8 August 2017 at 09:51, Prathamesh Kulkarni wrote: > On 1 August 2017 at 00:10, Prathamesh Kulkarni > wrote: >> On 11 July 2017 at 17:59, Prathamesh Kulkarni >> wrote: >>> On 13 June 2017 at 01:47, Joseph Myers wrote: >>>> This is OK with one fix: >

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-08-07 Thread Prathamesh Kulkarni
On 1 August 2017 at 00:10, Prathamesh Kulkarni wrote: > On 11 July 2017 at 17:59, Prathamesh Kulkarni > wrote: >> On 13 June 2017 at 01:47, Joseph Myers wrote: >>> This is OK with one fix: >>> >>>> +C ObjC Var(warn_enum_conversion) Init(0) Warning

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-08-07 Thread Prathamesh Kulkarni
On 31 July 2017 at 23:53, Prathamesh Kulkarni wrote: > On 23 May 2017 at 19:10, Prathamesh Kulkarni > wrote: >> On 19 May 2017 at 19:02, Jan Hubicka wrote: >>>> >>>> * LTO and memory management >>>> This is a general question about LTO and mem

Re: PR78888 - add value range info for tolower/toupper

2017-08-03 Thread Prathamesh Kulkarni
On 3 August 2017 at 13:21, Jakub Jelinek wrote: > On Thu, Aug 03, 2017 at 12:58:06PM +0530, Prathamesh Kulkarni wrote: >> --- a/gcc/tree-vrp.c >> +++ b/gcc/tree-vrp.c >> @@ -3778,6 +3778,19 @@ extract_range_basic (value_range *vr, gimple *stmt) &g

PR78888 - add value range info for tolower/toupper

2017-08-03 Thread Prathamesh Kulkarni
Hi, The attached patch adds value-range info for __builtin_tolower and __builtin_toupper. In the patch, I have just settled for anti-range ~['a', 'z'] for return value of toupper. Would that be correct albeit imprecise ? A more precise range would be: [0, UCHAR_MAX] intersect ~['a', 'z'] union EOF

Add include-guard to tree-vrp.h

2017-08-02 Thread Prathamesh Kulkarni
Add include-guard to tree-vrp.h. OK to commit ? Thanks, Prathamesh 2017-08-02 Prathamesh Kulkarni * tree-vrp.h: Add include guard. diff --git a/gcc/tree-vrp.h b/gcc/tree-vrp.h index ef2c68a752b..f84403a0f83 100644 --- a/gcc/tree-vrp.h +++ b/gcc/tree-vrp.h @@ -17,6 +17,9 @@ You should

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-07-31 Thread Prathamesh Kulkarni
On 11 July 2017 at 17:59, Prathamesh Kulkarni wrote: > On 13 June 2017 at 01:47, Joseph Myers wrote: >> This is OK with one fix: >> >>> +C ObjC Var(warn_enum_conversion) Init(0) Warning LangEnabledBy(C Objc,Wall) >> >> I believe the LangEnabledBy argument

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-07-31 Thread Prathamesh Kulkarni
On 23 May 2017 at 19:10, Prathamesh Kulkarni wrote: > On 19 May 2017 at 19:02, Jan Hubicka wrote: >>> >>> * LTO and memory management >>> This is a general question about LTO and memory management. >>> IIUC the following sequence takes place during

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-07-11 Thread Prathamesh Kulkarni
tomisp/pci/atomisp2/atomisp_cmd.c:5342:8: warning: implicit conversion from ‘enum atomisp_input_format’ to ‘enum ia_css_stream_format’ [-Wenum-conversion] 2017-07-11 Prathamesh Kulkarni * doc/invoke.texi: Document -Wenum-conversion. * c-family/c.opt (Wenum-conversion): New optio

[ping * 2] PR78736: New C warning -Wenum-conversion

2017-05-23 Thread Prathamesh Kulkarni
Hi, I would like to ping this patch for review: https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00775.html Thanks, Prathamesh

remove call to memset in value-prof.c:free_hist()

2017-05-23 Thread Prathamesh Kulkarni
Hi Jeff, As discussed in the other thread, this patch removes dead call to memset in free_hist(). Bootstrap+tested on x86_64-unknown-linux-gnu. Cross-tested on arm*-*-*, aarch64*-*-*. OK for trunk ? Thanks, Prathamesh 2017-05-23 Prathamesh Kulkarni * value-prof.c (free_hist): Remove

Re: PR80806

2017-05-23 Thread Prathamesh Kulkarni
On 22 May 2017 at 10:03, Jeff Law wrote: > On 05/18/2017 12:55 PM, Prathamesh Kulkarni wrote: >> Hi, >> The attached patch tries to fix PR80806 by warning when a variable is >> set using memset (and friends) but not used. I chose to warn in dse >> pass since dse w

Re: [RFC] propagate malloc attribute in ipa-pure-const pass

2017-05-23 Thread Prathamesh Kulkarni
On 19 May 2017 at 19:02, Jan Hubicka wrote: >> >> * LTO and memory management >> This is a general question about LTO and memory management. >> IIUC the following sequence takes place during normal LTO: >> LGEN: generate_summary, write_summary >> WPA: read_summary, execute ipa passes, write_opt_su

PR80806

2017-05-18 Thread Prathamesh Kulkarni
Hi, The attached patch tries to fix PR80806 by warning when a variable is set using memset (and friends) but not used. I chose to warn in dse pass since dse would detect if the variable passed as 1st argument is a dead store. Does this approach look OK ? There were following fallouts observed duri

[ping] PR78736: New C warning -Wenum-conversion

2017-05-15 Thread Prathamesh Kulkarni
Hi, I would like to ping this patch for review: https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00775.html Thanks, Prathamesh

[RFC] propagate malloc attribute in ipa-pure-const pass

2017-05-15 Thread Prathamesh Kulkarni
Hi, I have attached a bare-bones prototype patch that propagates malloc attribute in ipa-pure-const. As far as I understand, from the doc a function could be annotated with malloc attribute if it returns a pointer to a newly allocated memory block (uninitialized or zeroed) and the pointer does not

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-10 Thread Prathamesh Kulkarni
On 9 May 2017 at 23:34, Martin Sebor wrote: > On 05/09/2017 07:24 AM, Prathamesh Kulkarni wrote: >> >> ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00161.html >> >> Thanks, >> Prathamesh >> >> On 3 May 2017 at 11:30, Prathamesh Kulkarni >

Re: PR77644

2017-05-10 Thread Prathamesh Kulkarni
On 10 May 2017 at 14:28, Richard Biener wrote: > On Tue, 9 May 2017, Prathamesh Kulkarni wrote: > >> Hi, >> The attached patch adds the following pattern to match.pd >> sqrt(x) cmp sqrt(y) -> x cmp y. >> and is enabled with -funsafe-math-optimization and -fno-math

PR77644

2017-05-09 Thread Prathamesh Kulkarni
-09 Prathamesh Kulkarni PR tree-optimization/77644 * match.pd (sqrt(x) cmp sqrt(y) -> x cmp y): New pattern. testsuite/ * gcc.dg/tree-ssa/pr77644.c: New test-case. diff --git a/gcc/match.pd b/gcc/match.pd index e3d98baa12f..9929f5a1c16 100644 --- a/gcc/match.pd +++

Re: [2/2] PR 78736: libgomp fallout

2017-05-09 Thread Prathamesh Kulkarni
ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00135.html Thanks, Prathamesh On 2 May 2017 at 22:43, Prathamesh Kulkarni wrote: > Hi, > During gcc bootstrap, there's a couple of places where the warning got > triggered. > I suppose this wasn't a false positive since e

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-09 Thread Prathamesh Kulkarni
ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00161.html Thanks, Prathamesh On 3 May 2017 at 11:30, Prathamesh Kulkarni wrote: > On 3 May 2017 at 03:28, Martin Sebor wrote: >> On 05/02/2017 11:11 AM, Prathamesh Kulkarni wrote: >>> >>> Hi, >>> The a

Re: PR80613

2017-05-05 Thread Prathamesh Kulkarni
On 5 May 2017 at 12:46, Richard Biener wrote: > On Thu, 4 May 2017, Jeff Law wrote: > >> On 05/04/2017 10:00 AM, Prathamesh Kulkarni wrote: >> > Hi, >> > As mentioned in PR, the issue is that cddce1 marks the call to >> > __builtin_strdup as necessary: >

PR80613

2017-05-04 Thread Prathamesh Kulkarni
ng on arm*-*-* and aarch64*-*-* in progress. OK to commit if testing passes ? Thanks Prathamesh 2017-05-04 Prathamesh Kulkarni PR tree-optimization/80613 * tree-ssa-dce.c (propagate_necessity): Add cases for BUILT_IN_STRDUP and BUILT_IN_STRNDUP. * (eliminate_unnece

Re: [1/2] PR 78736: New warning -Wenum-conversion

2017-05-02 Thread Prathamesh Kulkarni
On 3 May 2017 at 03:28, Martin Sebor wrote: > On 05/02/2017 11:11 AM, Prathamesh Kulkarni wrote: >> >> Hi, >> The attached patch attempts to add option -Wenum-conversion for C and >> objective-C similar to clang, which warns when an enum value of a type >> is impl

<    1   2   3   4   5   6   7   8   9   10   >