https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65534

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Bernhard Reutner-Fischer from comment #2)
> (In reply to Jan Hubicka from comment #1)
> > > #ifndef OPTIMIZE_MANUALLY
> > > void setutent(void) {
> > >     ((void)0);
> > >     __setutent_unlocked();
> > >     ((void)0);
> > > }
> > > #else
> > > extern __typeof (__setutent_unlocked) setutent
> > >     __attribute__ ((alias ("__setutent_unlocked")));
> > > #endif
> > 
> > I do not think GCC can safely optimize this, becuase in the first
> > case &setutent != &__setutent_unlocked, wile in the optimized
> > case the addresses are equal.
> 
> Note that __setutent_unlocked is static, so i don't see how this specific
> case would prevent optimization?

Hi.

Agree with you that IPA ICF pass can handle this case even w/o
-fmerge-all-functions.
Both features are written on TODO list for GCC 7.

Martin

Reply via email to