This is the mail archive of the gcc-patches@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: [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
--


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