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

What's the exact meaning of "volatile_ok" ?


I refer to my message posted to gcc-bugs on Dec-30 on
subject "Re: non-optimal code with volatile vars".

As I stated then, I cannot determine the exact meaning
of the boolean variable "volatile_ok". The one and only
use is in general_operand() to decline volatile mem refs
in certain compiler passes. But I can't imagine why a
volatile would need any special treatment in this case.

The comments strayed into the sources around the use
of volatile_var show that the implementation is provisional
and incomplete.
In addition, volatile_ok and the wrapper functions
init_recog() and init_recog_no_volatile() are not used
consistently. In some cases, volatile_ok is manipulated
directly, in some the wrappers are used. And, as
Mike Stump stated, the usage of volatile_ok appears to be
buggy! For example in store_bit_field() (file expmed.c)
there is a return statement just before the expression to 
restore volatile_ok (from locally being set to 1).


My questions:

What exactly is volatile_ok for?
Why has it been introduced? For a special target? To make
new optimizations safe? Just in case?
Is the code around volatile_ok currently subject to
  further development? Who is doing it?


regards,

Ralf


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