From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 24164 invoked from network); 21 May 1998 03:55:17 -0000 Received: from mescaline.gnu.org (we-refuse-to-spy-on-our-users@158.121.106.21) by mail2.redhat.com with SMTP; 21 May 1998 03:55:17 -0000 Received: from melange.gnu.org by mescaline.gnu.org (8.8.5/8.6.12GNU) with ESMTP id XAA02450 for ; Wed, 20 May 1998 23:55:15 -0400 Received: (burley@localhost) by melange.gnu.org (8.8.5/8.6.12GNU) id XAA21517; Wed, 20 May 1998 23:55:14 -0400 (EDT) Date: Wed, 20 May 1998 23:55:14 -0400 (EDT) Message-Id: <199805210355.XAA21517@melange.gnu.org> From: Craig Burley To: axp-list@redhat.com In-reply-to: <356397D4.E80C0705@paralleldata.com> (wsb@paralleldata.com) Subject: Re: gprof on mixed gcc/g77 code >Craig Burley wrote: >> >Switching '-pg' to '-p' muddies the waters. Why pick a flag >already associated with different meaning from the users >point of view? Only reason I see is that gxx does not intend >to ever support the old mode and so just changed it's >meaning to the new mode of profiling in the internal code. >The docs should definitely stop referencing the prof binary >since it seems to have disappeared though. There's a *lot* of that sort of transformation of options going on in the gcc driver (and its kin, including g77). cpp gets passed very different options; so do cc1/f771/cc1plus; so does as; so does ld. It's a *driver*. Its job is to present a consistent user interface, and, being a GNU product, that across a wide variety of platforms, including those that might already have non-GNU `prof' on them (not likely to include Linux systems, is my guess). It *might* be nice to get the programs under control of gcc to accept exactly the same options gcc itself accepts, so they need no transformation, but that's probably impossible. Certainly making as and ld, often not GNU programs, accept the literal options is impossible. Making any of that work with `specs' files is probably impossible. Making gcc refuse to accept any options or specifications it can't reliably pass to all these subprograms without filtering would make gcc unusable for 99.9% of its present audience. The end result is that, no matter what we do, users will likely see *something* they don't understand in the output of `g77 -v'. (The same is true for the output of `gcc -S', or even `gcc -E'. Expecting to read the output of these options without first studying what the output is *supposed* to be is unwise, though at least for -S and -E I've seen a few other people try to do so, but not for -v.) You can either take this as a suggestion to think apparent symptoms through a bit more, or as more opportunity to claim that gcc is somehow the "problem" here. So far, IMO, you haven't persuaded anyone, certainly myself, about the latter. In short, almost all output of any compiler is *going* to be confusing to users who don't take the time to learn how to properly understand that output -- especially output regarding internal goings-on. >If I see a need to submit a bug report, I will. Not to the point >yet that I understand what's wrong. Once I do, I'll let the >appropriate folks know. For now I'm just looking to see if >anyone else has had better luck with it than I have. So far, >it doesn't look like it. At least no one admits they have... You *already* submitted what looked like a bug report, as I said earlier, and to a list that included *some* of the "appropriate folks", like myself. >> At least, it looked to *me* like you were trying to submit a >> bug report saying `-p' was incorrectly passed to f771 instead >> of `-pg'. If anyone else disagrees, I hope they'll speak up; >> I could certainly use a lesson in how to avoid responding to >> bug reports that aren't, so I can spend more time getting >> productive work done. > >Here is what I said: > >"I've got binaries where I mix C/FORTRAN and am trying >to gprof them on a RH5.0 system. Strictly C programs >appear to profile fine after adding the '-pg' flag to the >compile/link. However, when I add this flag to g77, >it seems to convert it to '-p'. Not what I want to >have happen. Is this what it does?? If so, why??" > >Looks to me like I asked if this is normal and if so >WHY? Since I know '-p' is different from '-pg', I >noticed it was doing something that looked odd. >English... great language to communicate in.... I know English, dammit. I worked as a technical writer for several years, starting at the Senior level, moving up to Lead, then Manager. All as an "ex"-programmer. When you write "g77 does X. Not what I want to have happen", that *is* a statement that g77 is doing something you don't want -- it's a bug report, just a poorly worded one, which is why I asked you *questions* about it. I guess I'll just learn to ignore bug reports you file in the future, here or elsewhere. I've wasted an awful lot of time trying to explain the obvious here, and educate you about how to properly ask questions and report bugs in products. Though, the alternative in this case was that I completely ignored your original question in the first place, which could easily result in the statement "g77 doesn't do profiling right because it passes `-p' instead of `-pg' to the f771 driver" being spread far and wide. That sort of thing *often* happens -- there are web pages with obsolete, somewhat incorrect information about g77 that stemmed from initial, confused reports about its behavior (and the same is surely true about many other products) -- so it seemed appropriate *at the time* that I ask specific questions regarding why you considered g77 passing `-p' to be a bug. >Think you implied the inverse of my statement about >'-p'. No where did I say gcc didn't do that. I just >said what I observed g77 doing.... No, you didn't *just* say that. You said it was NOT WHAT YOU WANTED TO HAVE HAPPEN. I can read English; please take some time to learn to write what you mean, or at least have the decency to admit that what you meant turned out to be wrong. (In this case, g77 passing `-p' *does* appear to be what you want to have happen. You'd also like profiling to work generally; it doesn't; that appears to be a separate problem.) If you want a clue about how to word a report like that, consider this modest translation of the paragraph you quoted above: "I've got binaries where I mix C/FORTRAN and am trying to gprof them on a RH5.0 system. Strictly C programs appear to profile fine after adding the '-pg' flag to the compile/link. [But strictly/mixed Fortran programs, compiled the same way, don't profile properly at all (explain symptoms).] I notice that when I add this flag to g77, it seems to convert it to '-p'. [I didn't check whether gcc did that; I suppose I should.] Is anyone aware of whether f771 needs the `-pg' option passed to it for gprof to work? Besides that, is anyone able to get g77 to output profilable programs, or know why it might or might not work?" The stuff in brackets is optional, depending on whether they state facts you knew at the time. If you thoughtfully compare what you wrote with the above, you should be able to see why your original quote appeared to be a bug report against *g77* because it wasn't faithfully passing `-pg' as such to the f771 driver -- as you said, it wasn't what you wanted to have happen. But you didn't say *why* it wasn't what you wanted, and the construction of the paragraph implied that this was why you were (presumably) having trouble getting profiling working on your system. You can either learn from this quietly, or continue avoiding to. It's up to you. -- "Practice random senselessness and act kind of beautiful." James Craig Burley, Software Craftsperson burley@gnu.org