[GSoC][match-and-simplify] mark some more operators as commutative

2014-06-23 Thread Prathamesh Kulkarni
* match.pd: Mark operators in some bitwise and plus-minus patterns to be commutative. Thanks and Regards, Prathamesh Index: gcc/match.pd === --- gcc/match.pd (revision 211893) +++ gcc/match.pd (working copy) @@ -138,7 +138,7 @@ along

[GSoC][match-and-simplify] Remove gen_gimple_match_fail

2014-06-23 Thread Prathamesh Kulkarni
* genmatch.c (gen_gimple_match_fail): Remove. (expr::gen_gimple_transform): Remove call to gen_gimple_match_fail. Change fprintf (f, if (!res)) to fprintf (f, if (!res) return false;\n) Thanks and Regards, Prathamesh Index: gcc/genmatch.c

[GSoC] remove unnecessary temporaries

2014-06-24 Thread Prathamesh Kulkarni
Hi, This patch attempts to generate temporaries only when required. I have changed generation of operand names. All children of an expr-node are assigned at expr-node itself. Names are generated as follows at expr-node: olevelchild-pos = rhs; where level is level of the expr-node in decision

Re: [GSoC][match-and-simplify] factor expr check in gimple-match-head.c

2014-06-24 Thread Prathamesh Kulkarni
oops, didn't set plain text mode. sorry for re-post. On Tue, Jun 24, 2014 at 4:59 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: This patch factors out checking expression-code in gimple-match-head.c * gimple-match-head.c (check_gimple_assign): New function

Re: [PATCH][match-and-simplify] GENERIC code-gen

2014-06-24 Thread Prathamesh Kulkarni
On Tue, Jun 24, 2014 at 9:00 PM, Richard Biener rguent...@suse.de wrote: This massages things so GENERIC code-gen works (well, is emitted and compiles). The GENERIC interface matches that of fold_{unary,binary,ternary} with also supporting calls here. It's supposed to be called at the start

[GSoC][match-and-simplify] get rid of multiple def_stmt

2014-06-24 Thread Prathamesh Kulkarni
This patch avoids multiple definitions of def_stmt in different blocks, and moves it at the beginning of gimple_match_and_simplify. * genmatch.c (decision_tree::gen_gimple): Call fprintf to generate definition of def_stmt. (dt_operand::gen_gimple_expr): Adjust call to fprintf to generate

[GSoC][match-and-simplify] factor gimple expressions and builtin functions

2014-06-26 Thread Prathamesh Kulkarni
This patch factors expression checking for GIMPLE. Generates code as: if (TREE_CODE (opname) == SSA_NAME) { gimple def_stmt = SSA_NAME_DEF_STMT (opname); if (is_gimple_assign (def_stmt)) { if (gimple_assign_rhs_code (def_stmt) == expr-code1) { } if

[GSoC][match-and-simplify] add few test-cases

2014-07-06 Thread Prathamesh Kulkarni
Hi, This patch adds few test-cases for gimple match-and-simplfiy and removes match-2.c [gcc/testsuite/gcc.dg/tree-ssa] * match-2.c: Remove. * match-plusminus.c: New test-case. * match-bitwise.c: Likewise. * match-realimag.c: Likewise. Thanks and Regards, Prathamesh Index:

[GSoC][match-and-simplify] Add DEBUG_FUNCTION attribute

2014-07-13 Thread Prathamesh Kulkarni
This patch adds DEBUG_FUNCTION attribute to print_* functions in genmatch.c * genmatch.c (print_operand): Add attribute DEBUG_FUNCTION. (print_matches): Likewise. (decision_tree::print_node): Likewise. (decision_tree::print): Likewise. Thanks and Regards, Prathamesh Index: genmatch.c

[GSoC][match-and-simplify] use integral_op_p

2014-07-13 Thread Prathamesh Kulkarni
Hi, This patch uses integral_op_p instead of if (INTEGRAL_TYPE_P (TREE_TYPE (@0))) * match.pd: Remove INTEGRAL_TYPE_P (TREE_TYPE (@0)) in bitwise patterns and use integral_op_p@0 Thanks and Regards, Prathamesh Index: match.pd ===

Re: [GSoC] symbol to denote multiple operators

2014-07-14 Thread Prathamesh Kulkarni
On Mon, Jul 14, 2014 at 5:36 PM, Richard Biener richard.guent...@gmail.com wrote: On Fri, Jul 11, 2014 at 4:59 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: On 7/11/14, Richard Biener richard.guent...@gmail.com wrote: On Thu, Jul 10, 2014 at 8:05 PM, Prathamesh Kulkarni

[gsoc][match-and-simplify] allow multiple patterns inside for ?

2014-07-22 Thread Prathamesh Kulkarni
Would it be a good idea to allow multiple match_and_simplify within for ? * genmatch.c (parse_for): Adjust to parse multiple patterns. Thanks and Regards, Prathamesh Index: genmatch.c === --- genmatch.c (revision 212558) +++

Re: [gsoc][match-and-simplify] allow multiple patterns inside for ?

2014-07-22 Thread Prathamesh Kulkarni
On Wed, Jul 23, 2014 at 3:42 AM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: Would it be a good idea to allow multiple match_and_simplify within for ? allow multiple patterns (match_and_simplify, for). * genmatch.c (parse_for): Adjust to parse multiple patterns. Thanks and Regards

[GSoC][match-and-simplify] remove unnecessary debug information

2014-07-22 Thread Prathamesh Kulkarni
I was displaying pattern = number for debugging some issue related to implementing for-pattern, not meant for dumping with -v Removed accordingly. * genmatch.c (main): Remove unnecessary debug information. Thanks and Regards, Prathamesh Index: genmatch.c

[GSoC][match-and-simplify] change syntax of inner-if

2014-07-22 Thread Prathamesh Kulkarni
This patch changes syntax of inner-if to be parenthesized - (if (cond)) * genmatch.c (parse_match_and_simplify): Adjust to parse parenthesized if. (peek_ident): New function. * match.pd: Adjust patterns having if-expr to new syntax. Thanks and Regards, Prathamesh Index: gcc/genmatch.c

[GSoC][match-and-simplify] reject for that has no pattern defined

2014-07-26 Thread Prathamesh Kulkarni
Reject for that has no pattern defined. eg - (for op in plus minus) * genmatch.c (parse_for): Reject for that has no pattern defined. Thanks and Regards, Prathamesh Index: genmatch.c === --- genmatch.c (revision 212928) +++

[GSoC][match-and-simplify] sanitize option checking

2014-07-27 Thread Prathamesh Kulkarni
Added checks to see if either cmmand-line options is not repeated, and generates match-and-simplify code on both GENERIC and GIMPLE if both -generic and -gimple are specified. * genmatch.c (cmd_options): New struct. (check_repeated_arg): New function. (parse_cmd_arg): Likewise.

[GSoC][match-and-simplify] include is-a.h

2014-07-27 Thread Prathamesh Kulkarni
Is it okay to include is-a.h ? I have adjusted print_operand to use is_a and as_a in this patch. * genmatch.c (is-a.h): Include. (is_a_helper::test): Specialize for operand subclasses. (print_operand): Adjust to use is_a and as_a. Thanks, Prathamesh. Index: genmatch.c

Re: [GSoC][match-and-simplify] include is-a.h

2014-07-29 Thread Prathamesh Kulkarni
On Mon, Jul 28, 2014 at 7:30 PM, David Malcolm dmalc...@redhat.com wrote: On Mon, 2014-07-28 at 02:35 +0530, Prathamesh Kulkarni wrote: - if (o-type == operand::OP_CAPTURE) + if (is_acapture * (o)) { - capture *c = static_castcapture * (o); - fprintf (f, @%s

[C PATCH] warn for empty struct -Wc++-compat

2014-11-10 Thread Prathamesh Kulkarni
Hi, For the following test-case: struct A {}; clang -fsyntax-only -Wc++-compat gives following warning and gcc does not: empty-struct.c:1:1: warning: empty struct has size 0 in C, size 1 in C++ [-Wc++-compat] struct F {}; This patch adds the above warning to the C FE. Bootstrapped on

Re: [C PATCH] warn for empty struct -Wc++-compat

2014-11-10 Thread Prathamesh Kulkarni
On Tue, Nov 11, 2014 at 3:35 AM, Marek Polacek pola...@redhat.com wrote: On Tue, Nov 11, 2014 at 03:24:48AM +0530, Prathamesh Kulkarni wrote: * gcc/c/c-decl.c (warn_cxx_compat_finish_struct): Add new parameter of type location_t. Warn for empty struct. (finish_struct): Pass loc

Re: [C PATCH] warn for empty struct -Wc++-compat

2014-11-11 Thread Prathamesh Kulkarni
On Tue, Nov 11, 2014 at 4:30 PM, Marek Polacek pola...@redhat.com wrote: On Tue, Nov 11, 2014 at 04:45:46AM +0530, Prathamesh Kulkarni wrote: Index: gcc/c/c-decl.c === --- gcc/c/c-decl.c(revision 217287) +++ gcc/c/c-decl.c

Re: [C PATCH] warn for empty struct -Wc++-compat

2014-11-11 Thread Prathamesh Kulkarni
On Wed, Nov 12, 2014 at 1:28 AM, Marek Polacek pola...@redhat.com wrote: On Tue, Nov 11, 2014 at 11:27:21PM +0530, Prathamesh Kulkarni wrote: I tried the following: struct A { struct B {}; int x; } /* { dg-warning empty struct has size 0 in C

Re: [C PATCH] warn for empty struct -Wc++-compat

2014-11-14 Thread Prathamesh Kulkarni
On Sat, Nov 15, 2014 at 3:06 AM, Joseph Myers jos...@codesourcery.com wrote: On Wed, 12 Nov 2014, Prathamesh Kulkarni wrote: Is this version okay ? [gcc/c] * c-decl.c (warn_cxx_compat_finish_struct): New parameters code, record_loc. Warn for empty struct. (finish_struct

Re: [C PATCH] fix column number in comma expression warning

2014-04-19 Thread Prathamesh Kulkarni
I had sent this patch during stage-3 of gcc-4.9. Is the patch OK ? On Thu, Feb 20, 2014 at 6:26 PM, Marek Polacek pola...@redhat.com wrote: On Thu, Feb 20, 2014 at 05:52:09PM +0530, Prathamesh Kulkarni wrote: Show column number of left operand instead of comma operator in the warning left-hand

Re: -Wvariadic-macros does not print warning

2014-04-23 Thread Prathamesh Kulkarni
forgot to add gcc-patches@gcc.gnu.org. Sorry for the double-post. On Wed, Apr 23, 2014 at 11:28 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: This is a follow up mail to http://gcc.gnu.org/ml/gcc-help/2014-04/msg00096.html I have attached patch that prints the warning when passed

Re: -Wvariadic-macros does not print warning

2014-04-23 Thread Prathamesh Kulkarni
for pedantic or warn_traditional. Thanks and Regards, Prathamesh On Wed, Apr 23, 2014 at 11:30 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: forgot to add gcc-patches@gcc.gnu.org. Sorry for the double-post. On Wed, Apr 23, 2014 at 11:28 PM, Prathamesh Kulkarni bilbotheelffri

[libcpp] use CPP_PEDANTIC

2014-04-25 Thread Prathamesh Kulkarni
Use macro CPP_PEDANTIC (PF) instead of directly using it's definition: CPP_OPTION (PF, cpp_pedantic). [libcpp] * directives.c (_cpp_handle_directive): Use CPP_PEDANTIC macro. * macro.c (parse_params): Likewise. Bootstrapped on x86_64-unknown-linux-gnu. OK for trunk ? Thanks and Regards,

Re: [GSoC] use obstack in parse_c_expr

2014-04-25 Thread Prathamesh Kulkarni
:15 AM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: Hi, There was a comment in parse_c_expr, mentioning to use obstack to build c-code string. I have attached patch for the same. OK to commit ? * genmatch.c (parse_c_expr): Use obstack to build c code string. Thanks and Regards

Re: [libcpp] use CPP_PEDANTIC

2014-04-25 Thread Prathamesh Kulkarni
On Fri, Apr 25, 2014 at 11:19 PM, Tom Tromey tro...@redhat.com wrote: Prathamesh == Prathamesh Kulkarni bilbotheelffri...@gmail.com writes: Prathamesh Use macro CPP_PEDANTIC (PF) instead of directly using Prathamesh it's definition: CPP_OPTION (PF, cpp_pedantic). I'm curious why you want

[C PATCH] proposal to add new warning -Wsizeof-array-argument

2014-04-26 Thread Prathamesh Kulkarni
Hi, Shall it a good idea to add new warning -Wsizeof-array-argument that warns when sizeof is applied on parameter declared as an array ? Similar to clang's -Wsizeof-array-argument: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110613/042812.html This was also reported as

Re: [C PATCH] proposal to add new warning -Wsizeof-array-argument

2014-04-27 Thread Prathamesh Kulkarni
On Sun, Apr 27, 2014 at 5:31 PM, Trevor Saunders tsaund...@mozilla.com wrote: On Sun, Apr 27, 2014 at 02:31:46AM +0530, Prathamesh Kulkarni wrote: Hi, Shall it a good idea to add new warning -Wsizeof-array-argument that warns when sizeof is applied on parameter declared as an array

Re: [C PATCH] proposal to add new warning -Wsizeof-array-argument

2014-04-27 Thread Prathamesh Kulkarni
On Sun, Apr 27, 2014 at 8:48 PM, Trevor Saunders tsaund...@mozilla.com wrote: On Sun, Apr 27, 2014 at 06:21:20PM +0530, Prathamesh Kulkarni wrote: On Sun, Apr 27, 2014 at 5:31 PM, Trevor Saunders tsaund...@mozilla.com wrote: On Sun, Apr 27, 2014 at 02:31:46AM +0530, Prathamesh Kulkarni wrote

Re: [C PATCH] proposal to add new warning -Wsizeof-array-argument

2014-04-27 Thread Prathamesh Kulkarni
On Sun, Apr 27, 2014 at 11:22 PM, pins...@gmail.com wrote: On Apr 27, 2014, at 10:09 AM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: On Sun, Apr 27, 2014 at 8:48 PM, Trevor Saunders tsaund...@mozilla.com wrote: On Sun, Apr 27, 2014 at 06:21:20PM +0530, Prathamesh Kulkarni

Re: [C PATCH] proposal to add new warning -Wsizeof-array-argument

2014-04-27 Thread Prathamesh Kulkarni
On Mon, Apr 28, 2014 at 1:31 AM, Andrew Pinski pins...@gmail.com wrote: On Sun, Apr 27, 2014 at 12:50 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: On Sun, Apr 27, 2014 at 11:22 PM, pins...@gmail.com wrote: On Apr 27, 2014, at 10:09 AM, Prathamesh Kulkarni bilbotheelffri

Re: [C PATCH] proposal to add new warning -Wsizeof-array-argument

2014-04-27 Thread Prathamesh Kulkarni
On Mon, Apr 28, 2014 at 2:13 AM, Andrew Pinski pins...@gmail.com wrote: On Sun, Apr 27, 2014 at 1:25 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: On Mon, Apr 28, 2014 at 1:31 AM, Andrew Pinski pins...@gmail.com wrote: On Sun, Apr 27, 2014 at 12:50 PM, Prathamesh Kulkarni

Re: -Wvariadic-macros does not print warning

2014-04-29 Thread Prathamesh Kulkarni
On Tue, Apr 29, 2014 at 2:07 PM, Manuel López-Ibáñez lopeziba...@gmail.com wrote: On 23 April 2014 20:03, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: I didn't attach the patch, I am extremely sorry for the noise. I am re-posting the mail. This is a follow up mail to http

Re: -Wvariadic-macros does not print warning

2014-04-29 Thread Prathamesh Kulkarni
{-Wtraditional}. To inhibit the warning +messages, use @option{-Wno-variadic-macros}. @item -Wvarargs @opindex Wvarargs Thanks. I added this to the patch. On 29 April 2014 14:41, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: Is this version OK ? [libcpp] * macro.c (parse_params

Re: -Wvariadic-macros does not print warning

2014-04-29 Thread Prathamesh Kulkarni
On Tue, Apr 29, 2014 at 7:37 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: On Tue, Apr 29, 2014 at 6:49 PM, Manuel López-Ibáñez lopeziba...@gmail.com wrote: This hunk in your patch doesn't seem related: Oops, Sorry. Removed that, and re-tested. @@ -509,6 +509,9 @@ Warn about

[libcpp] modify undef diagnostic

2014-04-29 Thread Prathamesh Kulkarni
Append evaluates to 0, in Wundef diagnostic. clang prints the following diagnostic for -Wundef: undef.c:1:5: warning: 'FOO' is not defined, evaluates to 0 [-Wundef] #if FOO ^ OK to commit ? [libcpp] * expr.c (eval_token): Modify Wundef diagnostic. [gcc/testsuite/gcc.dg/cpp] * warn-undef.c:

Re: [C PATCH] proposal to add new warning -Wsizeof-array-argument

2014-05-03 Thread Prathamesh Kulkarni
On Fri, May 2, 2014 at 5:50 AM, Joseph S. Myers jos...@codesourcery.com wrote: The following apply to all versions of this patch: * New options need documenting in invoke.texi. Added. * New options need nonempty help text in c.opt. (It's unfortunate that the -Wsizeof-pointer-memaccess

[GSoC] [match-and-simplify] check for capture index

2014-06-18 Thread Prathamesh Kulkarni
Put a check for capture index. * genmatch.c (parse_capture): Add condition to check capture index. (capture_max): New constant. (stdlib.h): Include. Thanks and Regards, Prathamesh Index: genmatch.c

proposal to add -Wheader-guard option

2014-02-04 Thread Prathamesh Kulkarni
Hi, I was wondering if it's a good idea to add -Wheader-guard option that warns on mismatches between #ifndef and #define lines in header guard, similar to -Wheader-guard in clang-3.4 ? (http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html) I have implemented patch for -Wheader-guard

remove C_EXPR_APPEND macro

2014-02-07 Thread Prathamesh Kulkarni
This patch removes C_EXPR_APPEND macro in c-tree.h OK for trunk ? * c-parser.c (c_parser_get_builtin_args): replace calls to C_EXPR_APPEND (cexpr_list, expr) by vec_safe_push (cexpr_list, expr) * c-tree.h (C_EXPR_APPEND): removed Index: gcc/c/c-parser.c

Re: remove C_EXPR_APPEND macro

2014-02-07 Thread Prathamesh Kulkarni
On Sat, Feb 8, 2014 at 2:22 AM, Joseph S. Myers jos...@codesourcery.com wrote: On Sat, 8 Feb 2014, Prathamesh Kulkarni wrote: This patch removes C_EXPR_APPEND macro in c-tree.h OK for trunk ? Thanks, this is OK with the orphan comment A varray of c_expr_t. also removed (please send

Re: remove C_EXPR_APPEND macro

2014-02-07 Thread Prathamesh Kulkarni
On Sat, Feb 8, 2014 at 3:06 AM, Marek Polacek pola...@redhat.com wrote: On Sat, Feb 08, 2014 at 02:51:03AM +0530, Prathamesh Kulkarni wrote: On Sat, Feb 8, 2014 at 2:22 AM, Joseph S. Myers jos...@codesourcery.com wrote: On Sat, 8 Feb 2014, Prathamesh Kulkarni wrote: This patch removes

print quotes around )

2014-02-09 Thread Prathamesh Kulkarni
A trivial fix to print quotes around ) in libcpp/macro.c OK for trunk ? * macro.c (parse_params): print quote around ) in call to cpp_error() in case CPP_EOF Index: libcpp/macro.c === --- libcpp/macro.c(revision 207627) +++

Re: print quotes around )

2014-02-09 Thread Prathamesh Kulkarni
On Sun, Feb 9, 2014 at 8:31 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: A trivial fix to print quotes around ) in libcpp/macro.c OK for trunk ? Will not work for if pfile-cb.error callback does not recognize % and % (maybe clients other than c, c++ front-ends ?). So we cannot

fix typo in doc/generic.texi

2014-02-11 Thread Prathamesh Kulkarni
* (generic.texi): Fix typo Index: generic.texi === --- generic.texi(revision 207627) +++ generic.texi(working copy) @@ -53,7 +53,7 @@ seems inelegant. @node Deficiencies @section Deficiencies -There are many places in

fold strchr (e, 0) to e + strlen (e)

2014-02-15 Thread Prathamesh Kulkarni
This patch folds strchr (e, 0) to e + strlen (e), if e has no side-effects. Bootstrapped, regtested on x86_64-unknown-linux-gnu Ok for trunk ? [gcc] * gcc/builtins.c (fold_builtin_strchr): returns tree for s1 + strlen (s1) if TREE_SIDE_EFFECTS (s1) is false and integer_zerop (s2) is true.

Re: fold strchr (e, 0) to e + strlen (e)

2014-02-15 Thread Prathamesh Kulkarni
On Sat, Feb 15, 2014 at 2:28 PM, Jakub Jelinek ja...@redhat.com wrote: On Sat, Feb 15, 2014 at 02:23:24PM +0530, Prathamesh Kulkarni wrote: This patch folds strchr (e, 0) to e + strlen (e), if e has no side-effects. Bootstrapped, regtested on x86_64-unknown-linux-gnu Ok for trunk ? Why do

c-parser.c replace error() by error_at()

2014-02-19 Thread Prathamesh Kulkarni
Replace calls to error() by error_at(). * c-parser.c (c_parser_declspecs): replace call to error () by error_at () * c-parser.c (c_parser_parameter_declaration): Likewise Bootstrapped on x86_64-unknown-linux-gnu Ok for trunk ? Thanks and Regards, Prathamesh Index: gcc/c/c-parser.c

Re: c-parser.c replace error() by error_at()

2014-02-19 Thread Prathamesh Kulkarni
On Wed, Feb 19, 2014 at 7:01 PM, Marek Polacek pola...@redhat.com wrote: On Wed, Feb 19, 2014 at 06:05:12PM +0530, Prathamesh Kulkarni wrote: Replace calls to error() by error_at(). * c-parser.c (c_parser_declspecs): replace call to error () by error_at () Replace, drop ()'s, full stop

Re: c-parser.c replace error() by error_at()

2014-02-19 Thread Prathamesh Kulkarni
On Wed, Feb 19, 2014 at 7:56 PM, Marek Polacek pola...@redhat.com wrote: On Wed, Feb 19, 2014 at 07:43:56PM +0530, Prathamesh Kulkarni wrote: Index: gcc/testsuite/gcc.dg/decl-9.c === --- gcc/testsuite/gcc.dg/decl-9.c (revision

Re: c-parser.c replace error() by error_at()

2014-02-19 Thread Prathamesh Kulkarni
On Wed, Feb 19, 2014 at 9:41 PM, Marek Polacek pola...@redhat.com wrote: On Wed, Feb 19, 2014 at 08:45:04PM +0530, Prathamesh Kulkarni wrote: Index: gcc/c/c-parser.c === --- gcc/c/c-parser.c (revision 207700) +++ gcc/c/c-parser.c

Re: c-parser.c replace error() by error_at()

2014-02-20 Thread Prathamesh Kulkarni
On Wed, Feb 19, 2014 at 11:32 PM, Joseph S. Myers jos...@codesourcery.com wrote: On Wed, 19 Feb 2014, Prathamesh Kulkarni wrote: I have sent it attached this time. Thanks, this version is OK. Please start the copyright assignment paperwork process if you haven't already done so, if you may

[C PATCH] fix column number in comma expression warning

2014-02-20 Thread Prathamesh Kulkarni
Show column number of left operand instead of comma operator in the warning left-hand operand of comma expression has no effect Example: ax.c:4:6: warning: left-hand operand of comma expression has no effect [-Wunused-value] x , y; ^ Instead of comma operator, show location of

Re: [C PATCH] fix column number in comma expression warning

2014-02-20 Thread Prathamesh Kulkarni
On Thu, Feb 20, 2014 at 6:26 PM, Marek Polacek pola...@redhat.com wrote: On Thu, Feb 20, 2014 at 05:52:09PM +0530, Prathamesh Kulkarni wrote: Show column number of left operand instead of comma operator in the warning left-hand operand of comma expression has no effect Example: ax.c:4:6

[C PATCH] remove goto in c_parser_sizeof_expression

2014-02-22 Thread Prathamesh Kulkarni
Not sure if this a good idea, but it seemed to me that goto sizeof_expr; wasn't really required in c_parser_sizeof_expression. Bootstrapped and regression tested on x8_64-unknown-linux-gnu Ok for trunk ? * c-parser.c (c_parser_sizeof_expression): Remove goto sizeof_expr; Thanks and Regards,

Re: [C PATCH] remove goto in c_parser_sizeof_expression

2014-02-22 Thread Prathamesh Kulkarni
On Sat, Feb 22, 2014 at 10:34 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: Not sure if this a good idea, but it seemed to me that goto sizeof_expr; wasn't really required in c_parser_sizeof_expression. Bootstrapped and regression tested on x8_64-unknown-linux-gnu Ok for trunk

Re: [C PATCH] remove goto in c_parser_sizeof_expression

2014-02-22 Thread Prathamesh Kulkarni
On Sat, Feb 22, 2014 at 11:44 PM, Marek Polacek pola...@redhat.com wrote: On Sat, Feb 22, 2014 at 10:34:13PM +0530, Prathamesh Kulkarni wrote: Not sure if this a good idea, but it seemed to me that goto sizeof_expr; wasn't really required in c_parser_sizeof_expression. Bootstrapped

Re: [C PATCH] remove goto in c_parser_sizeof_expression

2014-02-24 Thread Prathamesh Kulkarni
On Sun, Feb 23, 2014 at 1:18 AM, Marek Polacek pola...@redhat.com wrote: On Sun, Feb 23, 2014 at 12:19:49AM +0530, Prathamesh Kulkarni wrote: Is this fine ? No, there still are some formatting issues. Index: gcc/c/c-parser.c

Re: [C PATCH] remove goto in c_parser_sizeof_expression

2014-02-24 Thread Prathamesh Kulkarni
On Mon, Feb 24, 2014 at 11:28 PM, Marek Polacek pola...@redhat.com wrote: On Mon, Feb 24, 2014 at 11:08:27PM +0530, Prathamesh Kulkarni wrote: I apologize for bothering with stupid mistakes. No problem, it takes some time to get up to speed. + mark_exp_read (expr.value); + if (TREE_CODE

hard-reg-set.h replace #else #if by #elif

2014-02-25 Thread Prathamesh Kulkarni
Not sure if this is a good idea, I thought it would be better to replace #else #if by #elif. * hard-reg-set.h: Replace #else #if by #elif. Bootstrapped on x86_64-unknown-linux-gnu. Ok for trunk ? Thanks and Regards, Prathamesh Index: gcc/hard-reg-set.h

[match-and-simplify] add new lower function

2014-10-23 Thread Prathamesh Kulkarni
Instead of iterating each time for calling lowering function (lower_opt_convert, etc.), add new lower function and pass lower_opt_convert, lower_for etc. to it as callback. * genmatch.c (lower): New overloaded function. (lower): Adjust to call overloaded lower. Thanks, Prathamesh Index:

support operator list

2014-10-25 Thread Prathamesh Kulkarni
Hi, This patch adds support for operator-lists, and uses them in match-bitwise.pd and match-comparison.pd * genmatch.c (parser::parse_operator_list): New member function in parser. (add_substitute): New function. (flatten_substitutes): Likewise. (parser::parse_for): Call

[match-and-simplify] error checking on user defined oper in for

2014-10-25 Thread Prathamesh Kulkarni
Currently this is accepted: (for plus (mult div) ...) which is incorrect. This patch puts more error-checks on the user-defined operator in for-pattern. * genmatch.c (insert_operator): New function. (parse_for): Call insert_operator. Thanks, Prathamesh Index: gcc/genmatch.c

Re: support operator list

2014-10-26 Thread Prathamesh Kulkarni
:44 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: Hi, This patch adds support for operator-lists, and uses them in match-bitwise.pd and match-comparison.pd * genmatch.c (parser::parse_operator_list): New member function in parser. (add_substitute): New function

[match-and-simplify] reject conditional convert and commutative ops in result operand

2014-10-27 Thread Prathamesh Kulkarni
I suppose we should reject conditional convert and commutative ops in result operand ? since it would create 1-n mapping from match - result. * genmatch.c (fatal_at): New overloaded function with source_location as first parameter. (has_opt_convert_or_commutative_ops): New function.

Re: [match-and-simplify] error checking on user defined oper in for

2014-10-28 Thread Prathamesh Kulkarni
On Tue, Oct 28, 2014 at 3:45 PM, Richard Biener richard.guent...@gmail.com wrote: On Sat, Oct 25, 2014 at 8:16 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: Currently this is accepted: (for plus (mult div) ...) which is incorrect. This patch puts more error-checks on the user

Re: [match-and-simplify] reject conditional convert and commutative ops in result operand

2014-10-28 Thread Prathamesh Kulkarni
On Tue, Oct 28, 2014 at 3:50 PM, Richard Biener richard.guent...@gmail.com wrote: On Mon, Oct 27, 2014 at 3:32 PM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: I suppose we should reject conditional convert and commutative ops in result operand ? since it would create 1-n mapping

[match-and-simplify] fix segfault in parser::parse_for

2014-10-29 Thread Prathamesh Kulkarni
genmatch segfaults if user-defined operator is not specified. eg: (for (oper1 oper2...) pattern) * genmatch.c (parser::parse_for): Call peek instead of peek_ident. Thanks, Prathamesh Index: genmatch.c === --- genmatch.c

[match-and-simplify] support operator list

2014-11-03 Thread Prathamesh Kulkarni
(had sent it earlier by private mail). The attached patch supports operator-list and it's use in for. For now, operator-list is rejected in expression. This patch also allows user-defined operator to be used as operator-list (user-defined ops are really temporary or scoped operator-lists). (for

[match-and-simplify] operator-lists in expression

2014-11-10 Thread Prathamesh Kulkarni
Hi, This patch adds support for operator-lists to be used in expression. I reuse operator-list as the iterator. This is not really valid since user-defined operator-lists cannot be iterator in 'for', but it was convenient to reuse operator-list as a 'for' iterator and lower_for doesn't care

[match-and-simplify] adjust for pattern to allow multiple ids

2014-09-07 Thread Prathamesh Kulkarni
Changes syntax of for pattern to: (for op (list1...) op2 (list2...) opN (listN...) patterns) Number of operator substitutions must be same. * genmatch.c (peek_ident): Change id to default argument with value 0. (parse_for): Adjust. * match-builtin.pd: Rewrite for-patterns to match new

[match-and-simplify] remove dt_node::level_max

2014-09-15 Thread Prathamesh Kulkarni
* genmatch.c (dt_node::level_max): Remove. Thanks, Prathamesh Index: genmatch.c === --- genmatch.c (revision 215271) +++ genmatch.c (working copy) @@ -466,7 +466,6 @@ struct dt_simplify: public dt_node { - static const unsigned

[match-and-simplify] CSE with expression captures

2014-09-15 Thread Prathamesh Kulkarni
This patch attempts to performs CSE on expression captures. I have reused captures[] to store the result of expression (capture::what). * genmatch.c (operand::gen_transform): Add dt_operand ** default argument to operand heirarchy. (expr::gen_transform): Adjust. (capture::gen_transform):

Re: [match-and-simplify] CSE with expression captures

2014-09-16 Thread Prathamesh Kulkarni
On Tue, Sep 16, 2014 at 2:15 AM, Marc Glisse marc.gli...@inria.fr wrote: On Tue, 16 Sep 2014, Prathamesh Kulkarni wrote: --- gcc/match-builtin.pd(revision 215271) +++ gcc/match-builtin.pd(working copy) @@ -44,8 +44,8 @@ /* ??? There is no way to CSE here. We'd

[GSoC][match-and-simplify] split match.pd

2014-07-30 Thread Prathamesh Kulkarni
I have split match.pd in this patch. Not sure if I have written the ChangeLog correctly though... * match-bitwise.pd: New file. * match-plusminus.pd: Likewise. * match-constant-folding.pd: Likewise. * match-builtin.pd: Likewise. * match-rotate.pd): New file. Adjust to

[GSoC][match-and-simplify] use dt_simplify::capture_max

2014-08-02 Thread Prathamesh Kulkarni
* genmatch.c (dt_simplify::gen_gimple): Use dt_simplify::capture_max. (dt_simplify::gen_generic): Likewise. Thanks, Prathamesh Index: genmatch.c === --- genmatch.c (revision 213343) +++ genmatch.c (working copy) @@ -1473,7

[GSoC][match-and-simplify] add pointerplus patterns

2014-08-04 Thread Prathamesh Kulkarni
Added patterns in associate_pointerplus and associate_pointerplus_diff. * genmatch.c (capture_max): Change value to 6. (match-plusminus.pd): Add new patterns. [gcc/testsuite/gcc.dg/tree-ssa] * match-plusminus.c (plusminus_9): New test-case. Thanks, Prathamesh Index: gcc/genmatch.c

[GSoC][match-and-simplify] reject builtin operator as for variable

2014-08-07 Thread Prathamesh Kulkarni
reject operator to be used as variable in for. eg: (for mult in plus minus) * genmatch.c (get_operator): New function. (e_operation::e_operation): Adjust to call get_operator. (parse_for): Add call to get_operator. Thanks, Prathamesh Index: genmatch.c

[GSoC][match-and-simplify] put check for EOF

2014-08-08 Thread Prathamesh Kulkarni
Put check for EOF in parse_for and parse_if, else it results in segmentation fault. eg: (if (0) eof Not sure why it segfaults. I got following back-trace (in gdb): #0 _cpp_lex_direct (pfile=pfile@entry=0x66f560) at ../../src/libcpp/lex.c:2183 #1 0x0041d50c in _cpp_lex_token

[GSoC][match-and-simplify] Add abs_expr pattern

2014-08-11 Thread Prathamesh Kulkarni
Add pattern: abs (abs (x)) - abs (x) * match.pd: Add new pattern. [gcc/testsuite/gcc.dg/tree-ssa] * match.c: New test-case. Thanks, Prathamesh Index: gcc/match.pd === --- gcc/match.pd (revision 213814) +++ gcc/match.pd (working

[GSoC][match-and-simplify] add few constant-folding tests

2014-08-12 Thread Prathamesh Kulkarni
[gcc/testsuite/gcc.dg/tree-ssa] * match-constant-folding.c: New test-case. Thanks, Prathamesh Index: gcc/testsuite/gcc.dg/tree-ssa/match-constant-folding.c === --- gcc/testsuite/gcc.dg/tree-ssa/match-constant-folding.c (revision 0)

[GSoC][match-and-simplify] add more constant folding tests

2014-08-17 Thread Prathamesh Kulkarni
We now have at-least one test-case for each of constant folding patterns in match-constant-folding.pd [gcc/testsuite/gcc.dg/tree-ssa] * match-constant-folding.c: Add test-cases. Thanks, Prathamesh Index: match-constant-folding.c

[GSoC][match-and-simplify] simple doc-fix

2014-08-17 Thread Prathamesh Kulkarni
[gcc/doc] * match-and-simplify.texi: Replace addres by address. Thanks, Prathamesh Index: match-and-simplify.texi === --- match-and-simplify.texi (revision 214020) +++ match-and-simplify.texi (working copy) @@ -22,7 +22,7 @@ tries

Re: [GSoC][match-and-simplify] simple doc-fix

2014-08-17 Thread Prathamesh Kulkarni
On Mon, Aug 18, 2014 at 2:11 AM, Prathamesh Kulkarni bilbotheelffri...@gmail.com wrote: [gcc/doc] * match-and-simplify.texi: Replace addres by address. This version adds a small note for capturing expressions. [gcc/doc] * match-and-simplify.texi: Add documentation for capturing expressions

Re: [GSoC][match-and-simplify] add more constant folding tests

2014-08-18 Thread Prathamesh Kulkarni
On Mon, Aug 18, 2014 at 11:06 PM, David Malcolm dmalc...@redhat.com wrote: On Mon, 2014-08-18 at 01:11 +0530, Prathamesh Kulkarni wrote: We now have at-least one test-case for each of constant folding patterns in match-constant-folding.pd [gcc/testsuite/gcc.dg/tree-ssa] * match-constant

[match-and-simplify] print capture name

2014-12-14 Thread Prathamesh Kulkarni
Print name of capture in patterns written by user. * genmatch.c (capture::name): New. (capture::capture): New default argument. (parse_capture): Pass id to capture::capture. (print_operand): Print name of capture if available. Thanks, Prathamesh

Re: [match-and-simplify] print capture name

2014-12-14 Thread Prathamesh Kulkarni
On 15 December 2014 at 02:03, Prathamesh Kulkarni prathamesh.kulka...@linaro.org wrote: Print name of capture in patterns written by user. * genmatch.c (capture::name): New. (capture::capture): New default argument. (parse_capture): Pass id to capture::capture. (print_operand

[match-and-simplify] set simplify::capture_max to 0 if pattern contains no captures

2014-12-14 Thread Prathamesh Kulkarni
Caused segfault for pattern containing no captures at: info.safe_grow_cleared(capture_max + 1); in capture_info::capture_info artificial test-case: (define_predicates integer_zerop) (simplify (bit_not integer_zerop) { build_zero_cst (type); }) * genmatch.c (simplify::simplify): Set

flattening cfgloop.h

2014-12-14 Thread Prathamesh Kulkarni
with languages c, c++ enabled. Thank you, Prathamesh 2014-12-14 Prathamesh Kulkarni prathamesh.kulka...@linaro.org * cfgloopanal.h: New header file containing function prototypes from cfgloopanal.c * cfgloop.h: Remove includes. (mark_irreducible_loops): Move prototype

[match-and-simplify] allow 't' only in user-defined predicates

2014-12-16 Thread Prathamesh Kulkarni
This patch rejects 't' outside user-defined predicates. 2014-12-16 Prathamesh Kulkarni prathamesh.kulka...@linaro.org * genmatch.c (parser::parsing_match): New. (parser::parser): Initialize parsing_match to false. (parser::parse_pattern): Reset parsing_match when

Re: [match-and-simplify] allow 't' only in user-defined predicates

2014-12-16 Thread Prathamesh Kulkarni
sorry for the noise. I sent it just before our conversation on IRC. On 16 December 2014 at 19:58, Prathamesh Kulkarni prathamesh.kulka...@linaro.org wrote: This patch rejects 't' outside user-defined predicates. 2014-12-16 Prathamesh Kulkarni prathamesh.kulka...@linaro.org

Re: flattening cfgloop.h

2014-12-17 Thread Prathamesh Kulkarni
On 17 December 2014 at 21:15, Richard Biener richard.guent...@gmail.com wrote: On Sun, Dec 14, 2014 at 10:39 PM, Prathamesh Kulkarni prathamesh.kulka...@linaro.org wrote: Hi, The attached patch flattens cfgloop.h. Created new file cfgloopanal.h which exports function prototypes from

[MAINTAINERS] add myself under write after approval

2014-12-17 Thread Prathamesh Kulkarni
Kraai kr...@ftbfs.org Jan Kratochvil jan.kratoch...@redhat.com +Prathamesh Kulkarniprathamesh.kulka...@linaro.org Venkataramanan Kumarvenkataramanan.ku...@amd.com Maxim Kuvyrkov maxim.kuvyr...@linaro.org Doug Kwan dougk...@google.com

Re: flatten expr.h

2014-12-18 Thread Prathamesh Kulkarni
Hi, I had a discussion with Michael, and would like to put this patch on hold for now till we have tree.h and rtl.h flattening patches checked in to avoid conflicts. Thankyou, Prathamesh On 16 December 2014 at 17:13, Prathamesh Kulkarni prathamesh.kulka...@linaro.org wrote: Hi, The attached

Re: Flatten tree.h and tree-core.h

2014-12-19 Thread Prathamesh Kulkarni
On 20 December 2014 at 02:16, Michael Collison michael.colli...@linaro.org wrote: The reason I included tree-core.h in all the .c files was the requirement in tree.h (now flattened to the .c files) for fold-const.h. In tree.h there are inline functions such as fold_build_pointer_plus_hwi_loc

[match-and-simplify] add default arguments to parser::parse_simplify.

2014-12-21 Thread Prathamesh Kulkarni
Committed (r218996) as obvious. Thanks, Prathamesh 2014-12-21 Prathamesh Kulkarni prathamesh.kulka...@linaro.org * genmatch.c (parser::parse_simplify): Make last two parametes have default value 0. (parser::parse_pattern): Adjust call to parser::parse_simplify to avoid passing

  1   2   3   4   5   6   7   8   9   10   >