+2006-02-09 Andrew Pinski <pinskia@physics.uc.edu> + + * tree-flow-inline.h...
authorAndrew Pinski <pinskia@physics.uc.edu>
Thu, 9 Feb 2006 13:53:40 +0000 (13:53 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 9 Feb 2006 13:53:40 +0000 (05:53 -0800)
+2006-02-09  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * tree-flow-inline.h (var_can_have_subvars):
+       Volatile variables should not have subvariables.
+

+2006-02-09  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * gcc.c-torture/compile/volatile-1.c: New test.
+

From-SVN: r110796

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/volatile-1.c [new file with mode: 0644]
gcc/tree-flow-inline.h

index ee54252a2a4e19200bff98a1e91a94d3b9b30431..478de23428904ff22994476d7baffd2fb4df28ca 100644 (file)
@@ -1,3 +1,8 @@
+2006-02-09  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * tree-flow-inline.h (var_can_have_subvars): 
+       Volatile variables should not have subvariables.
+
 2006-02-09  Diego Novillo  <dnovillo@redhat.com>
 
        PR 26180
index e13068379a9d9305ef975b59f40764fab77b5499..a73cf09490e98828a0621e97c0d4ef36ec6d6521 100644 (file)
@@ -1,3 +1,7 @@
+2006-02-09  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * gcc.c-torture/compile/volatile-1.c: New test.
+
 2006-02-09  Diego Novillo  <dnovillo@redhat.com>
 
        PR 26180
diff --git a/gcc/testsuite/gcc.c-torture/compile/volatile-1.c b/gcc/testsuite/gcc.c-torture/compile/volatile-1.c
new file mode 100644 (file)
index 0000000..cb81274
--- /dev/null
@@ -0,0 +1,18 @@
+/* The problem here was that the statements that
+   loaded from exception.reason where not being
+   marked as having volatile behaviour which
+   caused load PRE on the tree level to go
+   into an infinite loop. */
+
+struct gdb_exception
+{
+  int reason;
+};
+int catch_exceptions_with_msg (int *gdberrmsg)
+{
+  volatile struct gdb_exception exception;
+  exceptions_state_mc_init (&(exception));
+  if (exception.reason != 0)
+    foo ();
+  return exception.reason;
+}
index 0ae99b9f0d421b25781407670ff1c9e60f5ae3b8..1abf556fccfc121b213809ce3a630df49db2e90f 100644 (file)
@@ -1463,6 +1463,10 @@ get_subvar_at (tree var, unsigned HOST_WIDE_INT offset)
 static inline bool
 var_can_have_subvars (tree v)
 {
+  /* Volatile variables should never have subvars.  */
+  if (TREE_THIS_VOLATILE (v))
+    return false;
+
   /* Non decls or memory tags can never have subvars.  */
   if (!DECL_P (v) || MTAG_P (v))
     return false;