From: Jeff Law <law@redhat.com>
To: Kito Cheng <kito.cheng@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Jan Hubicka <hubicka@ucw.cz>,
Richard Sandiford <rsandifo@linux.vnet.ibm.com>,
Eric Botcazou <ebotcazou@adacore.com>,
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Subject: Re: [PATCH] Pass correct memory attributes for build constant
Date: Fri, 27 Jun 2014 22:35:00 -0000 [thread overview]
Message-ID: <53ADF18E.9090404@redhat.com> (raw)
In-Reply-To: <CA+yXCZBRyi5FMeStC5-mo619rK+eNGZjxL+UNU=MtE+Gzo2vQA@mail.gmail.com>
On 06/25/14 21:38, Kito Cheng wrote:
> For example in arm-elf-eabi, movmem need word align, otherwise it will
> expand a libcall:
>
> And gcc configure with "--target=arm-elf-eabi --disable-nls
> --disable-shared --enable-languages=c,c++ --enable-threads=single
> --enable-lto --with-newlib"
>
> test.c:
> extern bar(unsigned char p[3][2]);
> void foo(int i)
> {
> unsigned char data[3][2] = {{1,1}, {1,0}, {1,1}};
>
> bar(data);
> }
First, note, I'm not an ARM expert. However, the first question I have
is are we sure the initializer is always going to be suitably aligned?
What guarantees this initializer is going to have 32 bit alignment
like you want? I can see how that *section* gets its alignment, but I
don't offhand see what in the ARM backend ensures that a CONSTRUCTOR
tree has larger than normal known alignment.
I think that needs to be settled first, then we need to verify that the
trees are correctly carrying that alignment requirement around and that
the code uses it appropriately (and I have my doubts because EXP is a
CONSTRUCTOR element and those seem to be largely ignored in the code
we're looking to change).
I would also strongly recommend turning your testcase into something we
can add to the testsuite.
If you look in gcc/testsuite/gcc.target/arm you'll see several examples.
I think you just want to compile this down to assembly code with the
optimizer enabled, then verify there is no call to memcpy in the
resulting output. 20030909-1.c would seem to be a reasonable example of
a test that does something similar.
Jeff
next prev parent reply other threads:[~2014-06-27 22:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-25 15:35 Kito Cheng
2014-06-25 21:01 ` Jeff Law
2014-06-26 3:38 ` Kito Cheng
2014-06-27 22:35 ` Jeff Law [this message]
2014-06-28 0:14 ` Jan Hubicka
2014-06-30 6:17 ` Kito Cheng
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=53ADF18E.9090404@redhat.com \
--to=law@redhat.com \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=kito.cheng@gmail.com \
--cc=ramana.radhakrishnan@arm.com \
--cc=rsandifo@linux.vnet.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).