From: Jiong Wang <jiwang@tilera.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: <gdb-patches@sourceware.org>, Walter Lee <walt@tilera.com>
Subject: Re: [RFC/TileGX 1/6] fix args alignment bug
Date: Tue, 22 Jan 2013 10:28:00 -0000 [thread overview]
Message-ID: <50FE69DB.6090802@tilera.com> (raw)
In-Reply-To: <50F9638C.4020005@tilera.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030"; format=flowed, Size: 1907 bytes --]
ÓÚ 2013/1/18 23:00, Jiong Wang дµÀ:
> Hi Joel,
>
> thanks for your careful review
>
>>> - /* Loop backwards through arguments to determine stack
>>> alignment. */
>>> - alignlen = 0;
>>> -
>>> - for (j = nargs - 1; j >= i; j--)
>>> - {
>>> - typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
>>> - alignlen += (typelen + 3) & (~3);
>>> - }
>>> -
>>> - if (alignlen & 0x4)
>>> - stack_dest -= 4;
>> Do you have any hint as to why this code was written the way it was?
>> It doesn't seem like the type of code that would be added by accident.
>> Did Jeff (the apparent author) misunderstand the ABI?
>
> actually, these these copied from our tilepro target which is a
> pure 32bit target, and the
> compiler for that target is not gcc initially. so there maybe some
> historic reason for those code.
>
> but for tilegx, the ABI is actually very clear, 10 regs for
> arguments, then push on stack.
>
> so I just delete them, gdb works ok on both daily usage and dejagnu
>>
>>> typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
>>> - slacklen = ((typelen + 3) & (~3)) - typelen;
>>> + slacklen = ((typelen + 7) & (~7)) - typelen;
>> This is a detail, but can you use utils.c:align_up, in this case?
>> (I find those midly more readable than these incantations, but
>> it's OK if you prefer the code to stay as is).
> thanks, I change to align_up to reuse existing helper function
>>
>>> /* Add 2 words for linkage space to the stack. */
>>> - stack_dest = stack_dest - 8;
>>> - write_memory (stack_dest, two_zero_words, 8);
>>> + stack_dest = stack_dest - 16;
>>> + write_memory (stack_dest, four_zero_words, 16);
>> It looks like you need to adjust the comment as well.
>
> fixed.
>
> is this new 01-revise.patch ok for this issue?
>
Ping, are this and the other updated tilegx patches OK?
Thanks,
Jiong
next prev parent reply other threads:[~2013-01-22 10:28 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 9:23 Jiong Wang
2013-01-18 13:14 ` Joel Brobecker
2013-01-18 15:00 ` Jiong Wang
2013-01-22 10:28 ` Jiong Wang [this message]
2013-01-29 14:49 ` Jiong Wang
2013-01-30 4:34 ` Jiong Wang
2013-01-30 5:47 ` Joel Brobecker
2013-01-30 5:55 ` Jiong Wang
2013-02-08 18:33 ` Joel Brobecker
2013-09-17 3:11 ` [RFC/TileGX 1/2] fix gdbserver build failure Jiong Wang
2013-09-17 3:24 ` [RFC/TileGX 2/2] fix gdbserver runtime crash Jiong Wang
2013-09-17 12:33 ` Joel Brobecker
2013-09-17 12:39 ` Jiong Wang
2013-09-17 13:22 ` Jiong Wang
2013-09-17 13:29 ` Joel Brobecker
2013-09-17 14:06 ` [COMMITTED][RFC/TileGX " Jiong Wang
2013-09-17 12:30 ` [RFC/TileGX 1/2] fix gdbserver build failure Joel Brobecker
2013-09-17 12:33 ` Jiong Wang
2013-09-17 13:21 ` Jiong Wang
2013-09-17 13:30 ` Joel Brobecker
2013-09-17 13:36 ` Jiong Wang
2013-09-17 13:43 ` Joel Brobecker
2013-09-17 14:04 ` [COMMITTED][RFC/TileGX " Jiong Wang
2013-09-18 1:56 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50FE69DB.6090802@tilera.com \
--to=jiwang@tilera.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=walt@tilera.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox