This is the mail archive of the gcc@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: An issue for the SC: horrible documentation quality of GCC


Hi,

On Fri, 9 May 2003, Richard Kenner wrote:

> I want to repeat what I just said in a separate message: the amount of
> totally undocumented code in GCC is approaching very troublesome levels.

I don't know about you.  But when I look at gcse.c, I see heaps of
comments, before most of the functions.  Also before the *local_cprop*
functions, except local_cprop_pass(), which is only called at toplevel
from one_cprop_pass().  Also the whole gcse.c is documented on the top of
that file rather extensively.  And additionally a heap of paper references
are given for people really interested in the theoretic background.

I think you highly exaggerate the situation.

> There is no comment anywhere that I can find of the form "This phase performs
> the ABC optimization by doing the following algorithm.  This optimization
> is useful because XYZ and does not duplicate a similar optimization in QQQ
> because of BAR."

Well, on the top of gcse.c it says, that one of the passes in GCSE is
copy/constant propagation.  This is a standard optimization, and hence the
actual description of any algorithm (on the high level) seems superflous.
Tricks used in the implementation should of course be documented, but have
no place in any high level overview comments.

About the actual problem you have: There is code to adjust the REG_EQUAL
notes for changed libcall blocks, namely in adjust_libcall_notes() called
from do_local_cprop(), which sounds as if it should do what you wanted.
Ergo you probably want to look at that function, why it doesn't work.  The
third match for "LIBCALL" set me on the right track, so it wasn't exactly
difficult to find.


Ciao,
Michael.


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