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: Re-implement VEC_* to be member functions of vec_t<T>


On Fri, Aug 24, 2012 at 11:08 AM, Diego Novillo <dnovillo@google.com> wrote:
> On 2012-08-24 12:03 , Gabriel Dos Reis wrote:
>
>> I would just use C++ standard function `at()' (e.g. as found in vector<T>)
>> for this.
>
>
> Sure.  For regular functions, using default-valued arguments would be fine.
> But I think the mechanism would be much more transparent if the compiler did
> the heavy lifting.
>
> 1- Add a class/function attribute that makes the compiler add 3 hidden
>    args for the caller location.
>
> 2- During code generation, the compiler fills in these values at call
>    sites.
>
> 3- The callee accesses these values by referencing specially named
>    arguments (much like 'this') or via __builtin_* accessors.
>    I think I prefer using __builtin_*.


I agree.  We need to find a way to solve 1. that does not introduce
ABI problems for operators.

Your idea of backtrace would be a solution, but JSM appears to indicate
it entails a non-trivial amount of non-portability...

-- Gaby


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