This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Valarray work (Was... Re: Efficiency)


Gabriel Dos Reis wrote:

>My attention has been called on something more urgent.  Here is the
>diffs I have for valarray -- no guarantee it compilers and all
>reasonable instantiations or does something useful.  It contains fixes
>to issue DJ raised a few week ago and fixes to the non-POD uses with
>valarray.  I'll flesh it out later.
>
>One thing I don't quite remember is what problems we were solving with
>the explicit instantiations in src/valarray-inst.cc.  Most of the
>changes here affect inline functions.  You may want to look over ABI
>breakage issue and see whether they are acceptable to you.
>  
>
Hi Gaby,

I had a look to the patch and, as far as I can see, doesn't look so
dangerous from the binary compatibility point of view. Indeed, your are
removing some functions and adding some but mostly are not exported from
the library and not part of the external interface. So far so good. The
only serious problem I can see at the moment is with __valarray_copy
which, indeed, is instantiated in src/valarray-inst.cc. I noticed that
immediately because the build fails there:

../../../../trunk/libstdc++-v3/src/valarray-inst.cc:43: error:
'__valarray_copy' is not a template function
../../../../trunk/libstdc++-v3/src/valarray-inst.cc: In function 'size_t
std::__valarray_product(const std::valarray<unsigned int>&)':
../../../../trunk/libstdc++-v3/src/valarray-inst.cc:60: error: invalid
initialization of reference of type 'const std::valarray<unsigned int>&'
from expression of type 'unsigned int*'
../../../../trunk/libstdc++-v3/src/valarray-inst.cc:52: error: in
passing argument 1 of 'size_t std::__valarray_product(const
std::valarray<unsigned int>&)'
make[2]: *** [valarray-inst.lo] Error 1

If that is really the only issue (I mostly think so) it would be rather
easy keeping the code around with the customary "XXX ABI deprecated"
comment. After all we are only talking about a few lines in
valarrary_array.h, right? Only the version of __valarray_copy taking a
pointer, a size and a pointer is exported, therefore would be one small
function + struct _Array_copier.

If we agree about the above, then, well, I would ask you to finish up
the thing, add a couple of testcases (one for the "non-POD issue", one
for DJ?)...

Again, please let me know if you want me to help for something...
Otherwise, in the meanwhile I'm going to look into possible more subtle
binary compatibility issues...

Thanks,
Paolo.


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