public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Regarding Bug 85539 - x86_64: loads are not always narrowed [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85539]
@ 2019-05-20  7:36 navya deepika Garakapati
  0 siblings, 0 replies; 2+ messages in thread
From: navya deepika Garakapati @ 2019-05-20  7:36 UTC (permalink / raw)
  To: rguenth, gcc; +Cc: tilkax

Hi All,



I am looking https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85539 bug and did
some analysis.

please help me on the below query.


For the  below testcase,

$cat test.c



int foo(long *p)

{

return *p;

}



when compile with clang -O2

$clang test.c -O2 -S

$cat test.s

foo:

        movl    (%rdi), %eax

        retq



while gcc gives



$gcc test.c -O2 -S

$cat test.s

foo:

        movq    (%rdi), %rax

        retq



As you can see the difference clang is loading value in eax(32 bit) while
gcc uses rax(64 bit).


While analysing it we found that ,



In gcc trunck with -O0 optimization,



we can notice that in ira pass, there is a conversion information from
64bit to 32bit (subreg:SI (reg:DI 82 [ _1 ]) 0)):



ira pass:

(insn 8 7 11 2 (set (reg:SI 83 [ _4 ])

        (subreg:SI (reg:DI 82 [ _1 ]) 0)) "t.c":3:8 67 {*movsi_internal}

     (expr_list:REG_DEAD (reg:DI 82 [ _1 ])

        (nil)))



while reload pass is deleting this information and assigning 32bit to 32bit
i.e; SI to SI which results this as a dead code for the next pass and as a
result this insn 8 is getting deleted in next pass which is split2 pass.



reload pass:

(insn 8 7 15 2 (set (reg:SI 0 ax [orig:83 _4 ] [83])

        (reg:SI 0 ax [orig:82 _1 ] [82])) "t.c":3:8 67 {*movsi_internal}

     (nil))



We would like to know why  conversion from DI to SI is converted to SI to
SI in reload pass (which uses any target hook).




Thanks & Regards

Navya.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Regarding Bug 85539 - x86_64: loads are not always narrowed [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85539]
@ 2019-05-06  6:57 navya deepika Garakapati
  0 siblings, 0 replies; 2+ messages in thread
From: navya deepika Garakapati @ 2019-05-06  6:57 UTC (permalink / raw)
  To: gcc; +Cc: rguenth

Hi All,



For the  below testcase,

$cat test.c



int foo(long *p)

{

return *p;

}



when compile with clang -O2

$clang test.c -O2 -S

$cat test.s

foo:

        movl    (%rdi), %eax

        retq



while gcc gives



$gcc test.c -O2 -S

$cat test.s

foo:

        movq    (%rdi), %rax

        retq



As you can see the difference clang is loading value in eax(32 bit) while
gcc uses rax(64 bit).


While analysing it we found that ,



In gcc trunck with -O0 optimization,



we can notice that in ira pass, there is a conversion information from
64bit to 32bit (subreg:SI (reg:DI 82 [ _1 ]) 0)):



ira pass:

(insn 8 7 11 2 (set (reg:SI 83 [ _4 ])

        (subreg:SI (reg:DI 82 [ _1 ]) 0)) "t.c":3:8 67 {*movsi_internal}

     (expr_list:REG_DEAD (reg:DI 82 [ _1 ])

        (nil)))



while reload pass is deleting this information and assigning 32bit to 32bit
i.e; SI to SI which results this as a dead code for the next pass and as a
result this insn 8 is getting deleted in next pass which is split2 pass.



reload pass:

(insn 8 7 15 2 (set (reg:SI 0 ax [orig:83 _4 ] [83])

        (reg:SI 0 ax [orig:82 _1 ] [82])) "t.c":3:8 67 {*movsi_internal}

     (nil))



We would like to know why  conversion from DI to SI is converted to SI to
SI in reload pass (which uses any target hook).




Thanks & Regards

Navya.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-20  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-20  7:36 Regarding Bug 85539 - x86_64: loads are not always narrowed [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85539] navya deepika Garakapati
  -- strict thread matches above, loose matches on Subject: below --
2019-05-06  6:57 navya deepika Garakapati

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).