diff mbox

Fix prototype for print_insn in rtl.h

Message ID 561CBEF8.3040300@samsung.com
State New
Headers show

Commit Message

Nikolai Bozhenov Oct. 13, 2015, 8:21 a.m. UTC
Currently prototype for print_insn in rtl.h doesn't match it's 
definition in sched-vis.c The patch fixes this mismatch.

Thanks,
Nikolai
2015-10-13  Nikolai Bozhenov  <n.bozhenov@samsung.com>

    * gcc/rtl.h (print_insn): fix prototype

Comments

Jeff Law Oct. 13, 2015, 12:22 p.m. UTC | #1
On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
> Currently prototype for print_insn in rtl.h doesn't match it's
> definition in sched-vis.c The patch fixes this mismatch.
I'll run this through the usual bootstrap & regression testing before 
installing later today.
jeff
Nikolai Bozhenov Oct. 13, 2015, 12:41 p.m. UTC | #2
On 10/13/2015 03:22 PM, Jeff Law wrote:
> On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
>> Currently prototype for print_insn in rtl.h doesn't match it's
>> definition in sched-vis.c The patch fixes this mismatch.
> I'll run this through the usual bootstrap & regression testing before 
> installing later today.
> jeff
>
I've bootstrapped it on x86_64, but I don't see much sense in regression
testing this patch cause it's so small. Though, if you think it's necessary,
I can test it myself and write to you when I get the results.

Thanks,
Nikolai
Jeff Law Oct. 13, 2015, 1:02 p.m. UTC | #3
On 10/13/2015 06:41 AM, Nikolai Bozhenov wrote:
> On 10/13/2015 03:22 PM, Jeff Law wrote:
>> On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
>>> Currently prototype for print_insn in rtl.h doesn't match it's
>>> definition in sched-vis.c The patch fixes this mismatch.
>> I'll run this through the usual bootstrap & regression testing before
>> installing later today.
>> jeff
>>
> I've bootstrapped it on x86_64, but I don't see much sense in regression
> testing this patch cause it's so small. Though, if you think it's
> necessary,
> I can test it myself and write to you when I get the results.
It's standard procedure.  While I agree that a bootstrap is almost 
certainly sufficient here, it's not a big deal to add this to the 
regression run I set up to run while getting the kids ready for school :-)

jeff
Jeff Law Oct. 13, 2015, 3:32 p.m. UTC | #4
On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
> 2015-10-13  Nikolai Bozhenov<n.bozhenov@samsung.com>
>
>      * gcc/rtl.h (print_insn): fix prototype
Installed on the trunk after bootstrap & regression test.

jeff
Andrew MacLeod Oct. 15, 2015, 4:28 p.m. UTC | #5
On 10/13/2015 11:32 AM, Jeff Law wrote:
> On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
>> 2015-10-13  Nikolai Bozhenov<n.bozhenov@samsung.com>
>>
>>      * gcc/rtl.h (print_insn): fix prototype
> Installed on the trunk after bootstrap & regression test.
>
> jeff
>
Sorry, a little late to the party.. but why is print_insn even in 
rtl.h?  it seems that sched-vis.c is the only thing that uses it...

Andrew
Nikolai Bozhenov Oct. 15, 2015, 4:48 p.m. UTC | #6
On 10/15/2015 07:28 PM, Andrew MacLeod wrote:
> On 10/13/2015 11:32 AM, Jeff Law wrote:
>> On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
>>> 2015-10-13  Nikolai Bozhenov<n.bozhenov@samsung.com>
>>>
>>>      * gcc/rtl.h (print_insn): fix prototype
>> Installed on the trunk after bootstrap & regression test.
>>
>> jeff
>>
> Sorry, a little late to the party.. but why is print_insn even in 
> rtl.h?  it seems that sched-vis.c is the only thing that uses it...
>
> Andrew
>
>
I'm going to use it in the scheduler...

Thanks,
Nikolai
Trevor Saunders Oct. 15, 2015, 6:42 p.m. UTC | #7
On Thu, Oct 15, 2015 at 07:48:18PM +0300, Nikolai Bozhenov wrote:
> 
> On 10/15/2015 07:28 PM, Andrew MacLeod wrote:
> >On 10/13/2015 11:32 AM, Jeff Law wrote:
> >>On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
> >>>2015-10-13  Nikolai Bozhenov<n.bozhenov@samsung.com>
> >>>
> >>>     * gcc/rtl.h (print_insn): fix prototype
> >>Installed on the trunk after bootstrap & regression test.
> >>
> >>jeff
> >>
> >Sorry, a little late to the party.. but why is print_insn even in rtl.h?
> >it seems that sched-vis.c is the only thing that uses it...
> >
> >Andrew
> >
> >
> I'm going to use it in the scheduler...

but then wouldn't something like sched-int.h make more sense? On
the other hand it seems like printing insns is generally useful
functionality, so I'm curious why the scheduler needs its own way of
doing it.

Trev

> 
> Thanks,
> Nikolai
Jeff Law Oct. 19, 2015, 3:14 p.m. UTC | #8
On 10/15/2015 10:28 AM, Andrew MacLeod wrote:
> On 10/13/2015 11:32 AM, Jeff Law wrote:
>> On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
>>> 2015-10-13  Nikolai Bozhenov<n.bozhenov@samsung.com>
>>>
>>>      * gcc/rtl.h (print_insn): fix prototype
>> Installed on the trunk after bootstrap & regression test.
>>
>> jeff
>>
> Sorry, a little late to the party.. but why is print_insn even in
> rtl.h?  it seems that sched-vis.c is the only thing that uses it...
Then let's move it to sched-int.h, unless there's some good reason not to.

jeff
Jeff Law Oct. 19, 2015, 4:32 p.m. UTC | #9
On 10/19/2015 09:14 AM, Jeff Law wrote:
> On 10/15/2015 10:28 AM, Andrew MacLeod wrote:
>> On 10/13/2015 11:32 AM, Jeff Law wrote:
>>> On 10/13/2015 02:21 AM, Nikolai Bozhenov wrote:
>>>> 2015-10-13  Nikolai Bozhenov<n.bozhenov@samsung.com>
>>>>
>>>>      * gcc/rtl.h (print_insn): fix prototype
>>> Installed on the trunk after bootstrap & regression test.
>>>
>>> jeff
>>>
>> Sorry, a little late to the party.. but why is print_insn even in
>> rtl.h?  it seems that sched-vis.c is the only thing that uses it...
> Then let's move it to sched-int.h, unless there's some good reason not to.
Because there isn't a sched-vis.h file and sched-vis.c would need to 
include sched-int.h.

That's all rather silly because sched-vis.c has nothing to do with 
scheduling.  It's just an RTL dumper.

I think moving all that stuff into print-rtl.[ch] is probably the better 
solution.

jeff
Nikolai Bozhenov Oct. 20, 2015, 7:02 a.m. UTC | #10
On 10/15/2015 09:42 PM, Trevor Saunders wrote:
>>> Sorry, a little late to the party.. but why is print_insn even in rtl.h?
>>> it seems that sched-vis.c is the only thing that uses it...
>>>
>>> Andrew
>> I'm going to use it in the scheduler...
> but then wouldn't something like sched-int.h make more sense? On
> the other hand it seems like printing insns is generally useful
> functionality, so I'm curious why the scheduler needs its own way of
> doing it.
>
> Trev
As for me, I believe sched-int.h is inappropriate place for print_insn
prototype because the function has nothing scheduler specific. And I like
Jeff's idea of removing sched-vis.c and moving everything from it into
print-rtl.[hc]. It would be nice if such code motion resulted also in some
interface and implementation unification for regular and slim dumpers.

Thanks,
Nikolai
diff mbox

Patch

diff --git a/gcc/rtl.h b/gcc/rtl.h
index a592a1e..d6edc71 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3574,7 +3574,7 @@  extern void dump_rtl_slim (FILE *, const rtx_insn *, const rtx_insn *,
 			   int, int);
 extern void print_value (pretty_printer *, const_rtx, int);
 extern void print_pattern (pretty_printer *, const_rtx, int);
-extern void print_insn (pretty_printer *, const_rtx, int);
+extern void print_insn (pretty_printer *, const rtx_insn *, int);
 extern void rtl_dump_bb_for_graph (pretty_printer *, basic_block);
 extern const char *str_pattern_slim (const_rtx);