[PATCH] Print function attributes in rtl dumps
Tom de Vries
Tom_deVries@mentor.com
Thu Mar 29 10:44:00 GMT 2018
[ Fix ENOPATCH ]
On 03/29/2018 12:17 PM, Tom de Vries wrote:
> Hi,
>
> when we compile a function with attributes:
> ...
> int __attribute__((noinline, noclone))
> foo (void)
> {
> Â return 2;
> }
> ...
>
> like this:
> ...
> gcc main.c -fdump-tree-all -fdump-rtl-all
> ...
>
> we find the function attributes starting from foo.c.004t.gimple:
> ...
> __attribute__((noclone, noinline))
> foo ()
> {
> Â int D.1961;
>
> Â D.1961 = 2;
> Â return D.1961;
> }
> ...
> to foo.c.232t.optimized.
>
>
> But we don't find the attributes in the rtl dumps:
> ...
> $ grep __attribute__ foo.c.*r.*
> $
> ...
>
> This patch adds printing of the function attributes in the rtl dump,
> f.i. foo.c.235r.vregs looks like this :
> ...
> ;; Function foo (foo, funcdef_no=0, decl_uid=1958, cgraph_uid=0,
> symbol_order=0)
>
> function foo attributes: __attribute__((noclone, noinline))
> (note 1 0 3 NOTE_INSN_DELETED)
> (note 3 1 2 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
> (note 2 3 5 2 NOTE_INSN_FUNCTION_BEG)
> (insn 5 2 8 2 (set (reg:SI 87 [ _1 ])
> Â Â Â Â Â Â Â (const_int 2 [0x2])) "foo.c":4 86 {*movsi_internal}
> Â Â Â Â (nil))
> (insn 8 5 12 2 (set (reg:SI 88 [ <retval> ])
> Â Â Â Â Â Â Â (reg:SI 87 [ _1 ])) "foo.c":4 86 {*movsi_internal}
> Â Â Â Â (nil))
> (insn 12 8 13 2 (set (reg/i:SI 0 ax)
> Â Â Â Â Â Â Â (reg:SI 88 [ <retval> ])) "foo.c":5 86 {*movsi_internal}
> Â Â Â Â (nil))
> (insn 13 12 0 2 (use (reg/i:SI 0 ax)) "foo.c":5 -1
> Â Â Â Â (nil))
> ...
>
> I've added the "function foo attributes" prefix because in other rtl
> dumps there may be quite a number of lines between the ";; Function foo"
> header and the first insn.
>
> OK for stage1 if bootstrap and reg-test on x86 succeeds?
>
> Thanks,
> - Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Print-function-attributes-in-rtl-dump.patch
Type: text/x-patch
Size: 4073 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180329/dd3879f3/attachment.bin>
More information about the Gcc-patches
mailing list