Re: [Bug middle-end/111088] useless 'xor eax,eax' inserted when a value is not returned and icf

2023-08-21 Thread Jan Hubicka via Gcc-bugs
> But adds a return with a value. And then the inliner inlines foo into foo2 but
> we still have the return with a value around ...
I guess ICF can special case unused return value, but why this is not
taken care of by ipa-sra?


[Bug middle-end/111088] useless 'xor eax,eax' inserted when a value is not returned and icf

2023-08-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111088

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2023-08-21
 Status|UNCONFIRMED |NEW

--- Comment #2 from Andrew Pinski  ---
So ICF figures out foo and foo2 are the same and has foo2 tail calls foo:

   [local count: 1073741824]:
  retval.2_4 = foo (a_2(D)); [tail call]
  return retval.2_4;

But adds a return with a value. And then the inliner inlines foo into foo2 but
we still have the return with a value around ...

[Bug middle-end/111088] useless 'xor eax,eax' inserted when a value is not returned and icf

2023-08-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111088

--- Comment #1 from Andrew Pinski  ---
It is ICF coming into play and then inlining.