stabilize_reference question

Per Bothner bothner@cygnus.com
Mon Mar 8 18:12:00 GMT 1999


Can somebody explain the comment in the code below?  The first
expression is not supposed to be "ignored" if volatile;  it is
supposed to be expanded once if it appears once in the source.
At least, that is my understanding.

In other words:  What is wrong about this patch?

(In Java, things woudl be a little simpler and cleaner
if we could make this fix.)

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner

Index: tree.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/tree.c,v
retrieving revision 1.171
diff -u -p -r1.171 tree.c
--- tree.c	1999/02/25 20:22:40	1.171
+++ tree.c	1999/03/09 02:08:04
@@ -2919,10 +2919,10 @@ stabilize_reference (ref)
       break;
 
     case COMPOUND_EXPR:
-      /* We cannot wrap the first expression in a SAVE_EXPR, as then
-	 it wouldn't be ignored.  This matters when dealing with
-	 volatiles.  */
-      return stabilize_reference_1 (ref);
+      result = build_nt (COMPOUND_EXPR,
+			 save_expr (TREE_OPERAND (ref, 0)),
+			 stabilize_reference (TREE_OPERAND (ref, 1)));
+      break;
 
     case RTL_EXPR:
       result = build1 (INDIRECT_REF, TREE_TYPE (ref),


More information about the Gcc mailing list