This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/33949] gcc-4.2.2 generates bad code on ARM
- From: "zero at colonel-panic dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Oct 2007 16:45:45 -0000
- Subject: [Bug c/33949] gcc-4.2.2 generates bad code on ARM
- References: <bug-33949-15284@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from zero at colonel-panic dot org 2007-10-30 16:45 -------
Subject: Re: gcc-4.2.2 generates bad code on ARM
rguenth at gcc dot gnu dot org wrote:
> ------- Comment #3 from rguenth at gcc dot gnu dot org 2007-10-30 15:54 -------
> It doesn't matter that you store the address of param to a volatile variable
> (this store is not removed), but that
>
> DMA_ADDR_REG = (unsigned long) data;
>
> does not make the stack local live longer than the frame of outer_func and
> *data is not used after the assignment. Probably your code kicking off
> the DMA engine lacks a memory barrier and a use of DMA_ADDR_REG.
>
>
Thanks for the explanation. Seems like an optimisation too far. I can't
see that using the address of a variable and not it's contents is a
particularly common practice, and having to use a GCC specific barrier
to get simple embedded code to work sucks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33949