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]
Other format: [Raw text]

Re: volatile semantics


On Sat, 2005-07-16 at 21:36 -0400, D. Hugh Redelmeier wrote:
> | From: Gabriel Dos Reis <gdr@integrable-solutions.net>
> 
> |  After many exchanges via private mails and
> | looking at the various reports related to this issue, it has become
> | clear to me that the interpretations offered to justify why GCC is
> | behaving the way it does seem to go beyond what can be inferred.
> 
> OK.
> 
> Is there a consensus on this?  If not, how can a consensus be reached?
> 
I'll pass on this, since I've said my piece, and i don't care about
volatile much.  However, if you come after const or restrict I'll bite
back.
Personally, I think a DR should be filed to clarify this, instead of all
this argument and opinion. 

> If so, how can we get a fix?
Usually by asking nicely and pressuring people. 
Or waiting long enough for someone to get around to it.
Or paying someone to fix it :)

> 
> I think that is urgent. 
No offense, but everyone thinks the problems that affect them are the
most urgent.

>  This bug is causing X to misbehave and the
> current workarounds might be harmful.  Who knows what other
> manifestations might be lurking?

Whoever is testing distributions compiled with mainline :)

> 
> As I said, I'm not a GCC hacker.  Who is the likely maintainer to fix
> this?
Anyone can fix it, however, who can review the fix depends on what it
touches.

>  Does he or she agree that this needs to be done? 
> Urgently?

This is actually probably pretty unlikely.  There are few bugs most
people consider urgent, and i'd venture this is not one of them.  It
would probably be fixed by release time.

In that spirit, here is a patch against mainline that fixes your bug (a
similar patch to the same function should work on 4.0)

Someone else can go through the process of testing and getting this
reviewed, i'm currently swamped (IE i have no plans to try to submit
this to gcc-patches).

Have a nice weekend,
Dan

Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.95
diff -u -p -r2.95 tree-ssa-operands.c
--- tree-ssa-operands.c	13 Jul 2005 15:34:16 -0000	2.95
+++ tree-ssa-operands.c	17 Jul 2005 02:26:21 -0000
@@ -1224,6 +1224,9 @@ get_expr_operands (tree stmt, tree *expr
   code = TREE_CODE (expr);
   class = TREE_CODE_CLASS (code);
 
+  if (TREE_THIS_VOLATILE (expr))
+    s_ann->has_volatile_ops = true;
+
   switch (code)
     {
     case ADDR_EXPR:

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