This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Early inlining with early optimization and passmanagerization of the inliner


> 
> The patch is ok, though you could have split some parts into a separate 
> patch
> (the dumping and -Q changes at least).  You didn't state how you tested the
> patch though - please make sure to include all languages in a
> bootstrap, including
> Ada, and maybe test an additional architecture for such changes.

Hi,
I've re-tested the patch on x86-64 with Ada and comitted.  There is one
regression appearing now:
libmudflap.c++/pass41-frag.cxx ( -O) execution test                             
libmudflap.c++/pass41-frag.cxx (-O2) execution test
libmudflap.c++/pass41-frag.cxx (-O3) execution test                             
libmudflap.c++/pass41-frag.cxx (-static) execution test
libmudflap.c++/pass41-frag.cxx execution test

What happens is that we are now able to inline:
operator<< (D.30480_3, endl);
and propagate the hook operand (endl) into direct call and subsequently
inline endl which was originally resulting in library call. (Hope that
Paolo will like this trick:)

Endl use __os object:
  __os.95_2 = (struct basic_ios<char,std::char_traits<char> > *)
  __os_1(D);
  D.30605_3 = __os_1(D)->_vptr.basic_ostream;
  D.30606_4 = D.30605_3 + -24;
  D.30607_5 = (long int *) D.30606_4;
  D.30608_6 = *D.30607_5;
  D.30609_7 = __os.95_2 + D.30608_6;
  D.30610_8 = widen (D.30609_7, 10);
  D.30611_9 = (int) D.30610_8;
  D.30612_10 = put (__os_1(D), D.30611_9);
  D.30613_11 = flush (D.30612_10);
and we further inline flush:
  D.30669_2 = flush (__os_1(D));
  D.30668_3 = D.30669_2;
  return D.30668_3;
So we now see the basic_ostream being directly written into
As a result we mudflapize extra memory access:
 __os.95 = (struct basic_ios<char,std::char_traits<char> > *) __os;
 __os.242 = (long int) __os;
 __mf_base.240 = (long unsigned int) __os.242;
 D.31156 = &__os->_vptr.basic_ostream;

and since it iscoming from alien non-mudflapized code, we get error on
it.  I believe either mudflap needs to deal with such an internals of
libstdc++ same way as it does with stdin and others, or libstdc++ must
limit inlining of this kind.

Paolo/Frank, can you please look into this issue or at least give me
some clues what would be preferred fix/workaround?

Thanks,
Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]