Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-18 Thread Martin Liška
On 05/18/2017 03:36 PM, Thomas Schwinge wrote:
> The very most, but not not all.  

Thanks for the fix.

Martin


Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-18 Thread Thomas Schwinge
Hi!

On Wed, 17 May 2017 11:02:09 +0200, Martin Liška  wrote:
> On 05/17/2017 09:44 AM, Richard Biener wrote:
> > On Tue, May 16, 2017 at 4:55 PM, Martin Liška  wrote:
> >> On 05/16/2017 03:48 PM, Richard Biener wrote:
> >>> On Fri, May 12, 2017 at 3:00 PM, Martin Liška  wrote:
>  Second part changes 'int flags' to a new typedef.
>  All corresponding interfaces have been changed.

The very most, but not not all.  ;-)

> installed as r248140.

[...]/gcc/brig/brigfrontend/brig-to-generic.cc: In constructor 
'brig_to_generic::brig_to_generic()':
[...]/gcc/brig/brigfrontend/brig-to-generic.cc:89:56: error: cannot convert 
'int*' to 'dump_flags_t* {aka long unsigned int*}' for argument '2' to 'FILE* 
dump_begin(int, dump_flags_t*)'
   m_dump_file = dump_begin (TDI_original, _dump_flags);
^

As obvious, committed to trunk in r248200:

commit 6059695267f35a22932f75471ab78467eeddf5e8
Author: tschwinge 
Date:   Thu May 18 13:34:29 2017 +

More dump_flags_t conversion

gcc/brig/
* brigfrontend/brig-to-generic.h (class brig_to_generic): Use
"dump_flags_t" for "m_dump_flags" member.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248200 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/brig/ChangeLog  | 5 +
 gcc/brig/brigfrontend/brig-to-generic.h | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git gcc/brig/ChangeLog gcc/brig/ChangeLog
index 3c563b1..1b1a1eb 100644
--- gcc/brig/ChangeLog
+++ gcc/brig/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-18  Thomas Schwinge  
+
+   * brigfrontend/brig-to-generic.h (class brig_to_generic): Use
+   "dump_flags_t" for "m_dump_flags" member.
+
 2017-05-13  Pekka Jääskeläinen  
 
* brigfrontend/brig-code-entry-handler.cc
diff --git gcc/brig/brigfrontend/brig-to-generic.h 
gcc/brig/brigfrontend/brig-to-generic.h
index 09d7c42..b94ff7c 100644
--- gcc/brig/brigfrontend/brig-to-generic.h
+++ gcc/brig/brigfrontend/brig-to-generic.h
@@ -169,7 +169,7 @@ private:
   FILE *m_dump_file;
 
   /* The original dump file flags.  */
-  int m_dump_flags;
+  dump_flags_t m_dump_flags;
 };
 
 /* Produce a "mangled name" for the given brig variable.  The mangling is used


Grüße
 Thomas


Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-17 Thread Martin Liška
On 05/17/2017 09:44 AM, Richard Biener wrote:
> On Tue, May 16, 2017 at 4:55 PM, Martin Liška  wrote:
>> On 05/16/2017 03:48 PM, Richard Biener wrote:
>>> On Fri, May 12, 2017 at 3:00 PM, Martin Liška  wrote:
 Second part changes 'int flags' to a new typedef.
 All corresponding interfaces have been changed.

 Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

 Ready to be installed?
>>>
>>> @@ -113,6 +114,14 @@ enum tree_dump_index
>>>  #define OPTGROUP_ALL(OPTGROUP_IPA | OPTGROUP_LOOP | 
>>> OPTGROUP_INLINE \
>>>   | OPTGROUP_OMP | OPTGROUP_VEC | 
>>> OPTGROUP_OTHER)
>>>
>>> +/* Dump flags type.  */
>>> +
>>> +typedef uint64_t dump_flags_t;
>>> +
>>> +/* Dump flags type.  */
>>> +
>>> +typedef uint64_t dump_flags_t;
>>> +
>>>
>>> duplicate.
>>
>> Yes, wrong patch merge.
>>
>>>
>>> +#define TDF_NONE 0
>>>
>>> this now seems to "conflict" with
>>>
>>> #define TDF_LANG0   /* is a lang-specific dump.  */
>>>
>>> ?
>>
>> I'll make TDF_LANG 1 and will increment next TDF_KIND_MASK values.
>> Re-running regression tests.
> 
> You'll have to adjust the & value as well then.
> 
> I didn't mean to really change this but eventually just document the
> behavior of TDF_NONE to just affect the bits "above" TDF_KIND_MASK.
> 
> Thus when you test for TDF_NONE you'd use
> 
> TDF_FLAGS (flags) == TDF_NONE
> 
> rather than flags == TDF_NONE.

You are right, I've just added comment of the original version and installed as 
r248140.

Martin

> 
> RIchard.
> 
>> Martin
>>
>>>
>>> that is, TDF_RTL | TDF_NONE would still be "none" conceptually ...
>>>
>>> Ok with the duplicate typedef removed.
>>>
>>> Thanks,
>>> Richard.
>>>
 Martin
>>



Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-17 Thread Richard Biener
On Tue, May 16, 2017 at 4:55 PM, Martin Liška  wrote:
> On 05/16/2017 03:48 PM, Richard Biener wrote:
>> On Fri, May 12, 2017 at 3:00 PM, Martin Liška  wrote:
>>> Second part changes 'int flags' to a new typedef.
>>> All corresponding interfaces have been changed.
>>>
>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>>
>>> Ready to be installed?
>>
>> @@ -113,6 +114,14 @@ enum tree_dump_index
>>  #define OPTGROUP_ALL(OPTGROUP_IPA | OPTGROUP_LOOP | OPTGROUP_INLINE 
>> \
>>   | OPTGROUP_OMP | OPTGROUP_VEC | OPTGROUP_OTHER)
>>
>> +/* Dump flags type.  */
>> +
>> +typedef uint64_t dump_flags_t;
>> +
>> +/* Dump flags type.  */
>> +
>> +typedef uint64_t dump_flags_t;
>> +
>>
>> duplicate.
>
> Yes, wrong patch merge.
>
>>
>> +#define TDF_NONE 0
>>
>> this now seems to "conflict" with
>>
>> #define TDF_LANG0   /* is a lang-specific dump.  */
>>
>> ?
>
> I'll make TDF_LANG 1 and will increment next TDF_KIND_MASK values.
> Re-running regression tests.

You'll have to adjust the & value as well then.

I didn't mean to really change this but eventually just document the
behavior of TDF_NONE to just affect the bits "above" TDF_KIND_MASK.

Thus when you test for TDF_NONE you'd use

TDF_FLAGS (flags) == TDF_NONE

rather than flags == TDF_NONE.

RIchard.

> Martin
>
>>
>> that is, TDF_RTL | TDF_NONE would still be "none" conceptually ...
>>
>> Ok with the duplicate typedef removed.
>>
>> Thanks,
>> Richard.
>>
>>> Martin
>


Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-16 Thread Martin Liška
On 05/16/2017 03:48 PM, Richard Biener wrote:
> On Fri, May 12, 2017 at 3:00 PM, Martin Liška  wrote:
>> Second part changes 'int flags' to a new typedef.
>> All corresponding interfaces have been changed.
>>
>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>
>> Ready to be installed?
> 
> @@ -113,6 +114,14 @@ enum tree_dump_index
>  #define OPTGROUP_ALL(OPTGROUP_IPA | OPTGROUP_LOOP | OPTGROUP_INLINE \
>   | OPTGROUP_OMP | OPTGROUP_VEC | OPTGROUP_OTHER)
> 
> +/* Dump flags type.  */
> +
> +typedef uint64_t dump_flags_t;
> +
> +/* Dump flags type.  */
> +
> +typedef uint64_t dump_flags_t;
> +
> 
> duplicate.

Yes, wrong patch merge.

> 
> +#define TDF_NONE 0
> 
> this now seems to "conflict" with
> 
> #define TDF_LANG0   /* is a lang-specific dump.  */
> 
> ?

I'll make TDF_LANG 1 and will increment next TDF_KIND_MASK values.
Re-running regression tests.

Martin

> 
> that is, TDF_RTL | TDF_NONE would still be "none" conceptually ...
> 
> Ok with the duplicate typedef removed.
> 
> Thanks,
> Richard.
> 
>> Martin



Re: [PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-16 Thread Richard Biener
On Fri, May 12, 2017 at 3:00 PM, Martin Liška  wrote:
> Second part changes 'int flags' to a new typedef.
> All corresponding interfaces have been changed.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?

@@ -113,6 +114,14 @@ enum tree_dump_index
 #define OPTGROUP_ALL(OPTGROUP_IPA | OPTGROUP_LOOP | OPTGROUP_INLINE \
  | OPTGROUP_OMP | OPTGROUP_VEC | OPTGROUP_OTHER)

+/* Dump flags type.  */
+
+typedef uint64_t dump_flags_t;
+
+/* Dump flags type.  */
+
+typedef uint64_t dump_flags_t;
+

duplicate.

+#define TDF_NONE 0

this now seems to "conflict" with

#define TDF_LANG0   /* is a lang-specific dump.  */

?

that is, TDF_RTL | TDF_NONE would still be "none" conceptually ...

Ok with the duplicate typedef removed.

Thanks,
Richard.

> Martin


[PATCH v2 2/N] Introduce dump_flags_t type and use it instead of int, type.

2017-05-12 Thread Martin Liška
Second part changes 'int flags' to a new typedef.
All corresponding interfaces have been changed.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin
>From fdcd3bc0c76140d8d2e28cd4b8d15cc55ddba4b0 Mon Sep 17 00:00:00 2001
From: marxin 
Date: Wed, 1 Feb 2017 15:34:52 +0100
Subject: [PATCH 2/3] Introduce dump_flags_t type and use it instead of int
 type.

gcc/cp/ChangeLog:

2017-05-12  Martin Liska  

	* class.c (dump_class_hierarchy): Introduce dump_flags_t type and
	use it instead of int type.
	(dump_vtable): Likewise.
	(dump_vtt): Likewise.
	* decl2.c (dump_tu): Likewise.

gcc/c-family/ChangeLog:

2017-05-12  Martin Liska  

	* c-common.h: Introduce dump_flags_t type and
	use it instead of int type.
	* c-gimplify.c (c_genericize): Likewise.
	* c-opts.c: Likewise.

gcc/c/ChangeLog:

2017-05-12  Martin Liska  

	* c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and
	use it instead of int type.

gcc/ChangeLog:

2017-05-12  Martin Liska  

	* cfg.c: Introduce dump_flags_t type and
	use it instead of int type.
	* cfg.h: Likewise.
	* cfghooks.c: Likewise.
	* cfghooks.h (struct cfg_hooks): Likewise.
	* cfgrtl.c: Likewise.
	* cfgrtl.h: Likewise.
	* cgraph.c (cgraph_node::get_body): Likewise.
	* coretypes.h: Likewise.
	* domwalk.c: Likewise.
	* domwalk.h: Likewise.
	* dumpfile.c (struct dump_option_value_info): Likewise.
	(dump_enable_all): Likewise.
	(dump_switch_p_1): Likewise.
	(opt_info_switch_p): Likewise.
	* dumpfile.h (enum tree_dump_index): Likewise.
	(struct dump_file_info): Likewise.
	* genemit.c: Likewise.
	* generic-match-head.c: Likewise.
	* gengtype.c (open_base_files): Likewise.
	* gimple-pretty-print.c: Likewise.
	* gimple-pretty-print.h: Likewise.
	* graph.c (print_graph_cfg): Likewise.
	* graphite-scop-detection.c (dot_all_sese): Likewise.
	* ipa-devirt.c (build_type_inheritance_graph): Likewise.
	* loop-unroll.c (report_unroll): Likewise.
	* passes.c (pass_manager::register_one_dump_file): Likewise.
	* print-tree.c: Likewise.
	* statistics.c: Likewise.
	* tree-cfg.c: Likewise.
	* tree-cfg.h: Likewise.
	* tree-dfa.c: Likewise.
	* tree-dfa.h: Likewise.
	* tree-dump.c (dump_function): Likewise.
	* tree-dump.h (struct dump_info): Likewise.
	* tree-pretty-print.c: Likewise.
	* tree-pretty-print.h: Likewise.
	* tree-ssa-live.c: Likewise.
	* tree-ssa-live.h: Likewise.
	* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise.
	* tree-vect-loop.c: Likewise.
	* tree-vect-slp.c: Likewise.
---
 gcc/c-family/c-common.h   |   2 +-
 gcc/c-family/c-gimplify.c |   2 +-
 gcc/c-family/c-opts.c |   6 +-
 gcc/c/c-decl.c|   2 +-
 gcc/cfg.c |   8 +--
 gcc/cfg.h |   6 +-
 gcc/cfghooks.c|   4 +-
 gcc/cfghooks.h|   6 +-
 gcc/cfgrtl.c  |   8 +--
 gcc/cfgrtl.h  |   4 +-
 gcc/cgraph.c  |   2 +-
 gcc/coretypes.h   |   1 +
 gcc/cp/class.c|  14 ++---
 gcc/cp/decl2.c|   2 +-
 gcc/domwalk.c |   2 +-
 gcc/domwalk.h |   2 +-
 gcc/dumpfile.c|  52 +
 gcc/dumpfile.h|  43 --
 gcc/genemit.c |   1 -
 gcc/generic-match-head.c  |   1 -
 gcc/gengtype.c|   3 +-
 gcc/gimple-pretty-print.c | 127 +-
 gcc/gimple-pretty-print.h |  10 ++--
 gcc/graph.c   |   4 +-
 gcc/graphite-scop-detection.c |   4 +-
 gcc/ipa-devirt.c  |   2 +-
 gcc/loop-unroll.c |   2 +-
 gcc/passes.c  |   3 +-
 gcc/print-tree.c  |   2 +-
 gcc/statistics.c  |   2 +-
 gcc/tree-cfg.c|  10 ++--
 gcc/tree-cfg.h|   4 +-
 gcc/tree-dfa.c|   2 +-
 gcc/tree-dfa.h|   2 +-
 gcc/tree-dump.c   |   4 +-
 gcc/tree-dump.h   |   4 +-
 gcc/tree-pretty-print.c   |  39 ++---
 gcc/tree-pretty-print.h   |  18 +++---
 gcc/tree-ssa-live.c   |   8 +--
 gcc/tree-ssa-live.h   |   6 +-
 gcc/tree-ssa-loop-ivcanon.c   |   2 +-
 gcc/tree-vect-loop.c  |   2 +-
 gcc/tree-vect-slp.c   |   2 +-
 43 files changed, 236 insertions(+), 194 deletions(-)

diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 9e3982d1ce8..ded0c37bc8a 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -904,7 +904,7 @@ extern bool c_common_post_options (const char **);
 extern bool c_common_init (void);
 extern void c_common_finish (void);
 extern void c_common_parse_file (void);
-extern FILE *get_dump_info (int, int *);
+extern FILE *get_dump_info (int, dump_flags_t *);
 extern alias_set_type c_common_get_alias_set (tree);
 extern void c_register_builtin_type (tree,