Mike Shapiro wrote:
> On Sat, Jan 12, 2008 at 07:41:30AM +0100, Roland Mainz wrote:
> > Is it "legal" to disable CTF for OS/Net libraries ? I'm asking since CTF
> > has caused nothing but pain for us in the last year, including the
> > C99/VLA issue (which requires some work to "backport" code to use
> > |alloca()| (which is not possible in all cases, e.g. it's not possible
> > to replace a VLA with |alloca()| within a loop)), that the current CTF
> > generation seems to be completely incompatible to the Sun Studio
> > interprocedural optimizer (as consequence performace gets damaged) etc.
> > ... and at some point I'm wondering whether these "costs" are justified
> > by the "benefits" ...
>
> Can you be a bit more specific? I haven't heard of these issues before.
Uhm... and I thought I was close from being banned from this list
because I'm howling&&wailing too often about it... ;-/
> What is the c99/vla issue?
"VLA" means "variable length arrays" which means you can use an integer
variable to declare the size of a dimension in a C array (this is a
feature added in C99), e.g.
-- snip --
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
void myprint(const char *s1, const char *s2)
{
/* use VLA to allocate a dynamically sized buffer */
char buff[strlen(s1)+strlen(s2)+1];
sprintf(buff, "%s%s", s1, s2);
puts(buff);
}
int main( void )
{
myprint("hello", "world");
return EXIT_SUCCESS;
}
-- snip --
This works Ok with gcc, Sun Studio 10 Studio 11 etc. outside OS/Net but
"ctfconvert" fail because it hit an unknown stab:
-- snip --
ERROR: ctfconvert: pics/bltins/read.o: Couldn't parse stab
"#vla0:(0,14)" (source file pics/bltins/read.o)
Removing pics/bltins/read.o
-- snip --
(And I'm howling&&wailing about this since we did some larger work which
made use of this feature and had to undo these changes (and I'm not
really a big fan of wasting work that way... ;-( ) when we realised that
the flag day which switched from Studio 10 to Studio 11 ruined this
feature (and |alloca()| can't be used as replacement in some cases and
the workarounds which hack "ctfconvert" to ignore this stuff are not
likely to pass the code review and my knowledge of CTF isn't that good
that I am even imagine how the correct solution may look like...))
> (and provide a bugid if there is one)
See http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6575435
('ctf tools cannot handle C99 VLAs ("variable length arrays")') ...
> How is ctf incompatible with the interprocedural optimizer? (this
> statement is confusing to me since we're just post-processing debug
> information after the compiler runs).
Erm... yes... but the XIPO stuff runs the optimizer over all source
files (e.g. doing inlining across source file borders etc.) in one
single step at the _final_ link stage - which seems to shift some stuff
around which the CTF tools don't expect (as I said above I know almost
nothing about CTF... right now I'm only guessing what may be wrong...).
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [EMAIL PROTECTED]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code