This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Some middle-end improvements for bitfield handling(followup)
- From: Roger Sayle <roger at eyesopen dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 1 Jul 2004 07:35:21 -0600 (MDT)
- Subject: Re: [PATCH] Some middle-end improvements for bitfield handling(followup)
On Thu, 1 Jul 2004, Jakub Jelinek wrote:
> > See the section in http://gcc.gnu.org/projects/optimize.html#volatile
> > "Deficiencies of GCC's Optimizer: Volatile inhibits too many
> > optimizations".
>
> GCC normally generates 2 reads and 1 write for say:
> volatile struct { unsigned int i : 3, j : 29; } b;
> void test (unsigned int x)
> {
> b.j += x;
> }
> movl b(%rip), %eax
> movl b(%rip), %edx
> ...
>
> Without the TREE_THIS_VOLATILE check suddenly there would be just one
> read and one write. I was not sure if that behaviour change would be ok.
Hmm. Ok I agree with your erring on the side of caution. But the
above looks like a bug in our RTL handling somewhere. My guess is
that for some volatile MEMs, we're either not calling force_reg
somewhere during RTL expansion, or one of the RTL optimizers is
duplicating a reference to a volatile memory.
Roger
--