This is the mail archive of the gcc-help@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: valreg at calls.c is 0 at a moment


On Sat, Oct 3, 2009 at 1:28 AM, Ian Lance Taylor <iant@google.com> wrote:
> "Kim, Eunchan" <helpbygrace@gmail.com> writes:
>
>> So, the error occurs at calls.c:2880. which code is..
>>
>>>>----------
>> ? ? ? if (pass && (flags & ECF_LIBCALL_BLOCK))
>> +---- 60 : {---------------------------------------------------------------------
>> ? ? ? else if (pass && (flags & ECF_MALLOC))
>> ? ? {
>> ? ? ? rtx temp = gen_reg_rtx (GET_MODE (valreg));
>> ? ? ? rtx last, insns;
>> ----------<<
>>
>> at this statement, valreg was 0 when i printed that value. i wondered
>> why valreg is 0. most assignment of valreg is determined by
>> structure_value_addr, which is non-zero at this time. It means that
>> 'malloc' returns BLKmode value. isn't it?
>
> valreg certainly shouldn't be zero either. ?But malloc does not return
> a BLKmode value; it returns a Pmode value. ?You mention
> structure_value_addr but you don't say whether it is non-NULL.
> Certainly structure_value_addr should be NULL for a call to malloc, as
> malloc does not return a structure. ?If structure_value_addr is not
> NULL, that implies that aggregate_value_p returned true for a call to
> malloc, and I don't see how that could happen.
>
> Ian
>

when valreg was zero, structure_value_addr was not NULL. It pointed
certain memory address(pointer). It means that
aggregate_value_p(exp,fndecl) is true, and target or MEM_P(target) or
CALL_EXPR_RETURN_SLOT_OPT(exp) is not true.

I have a question. what exactly aggregate_value_p(exp, fndecl) means?
so, if aggregate_value_p is not true. May this problem be solved?

-- Eunchan


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