]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/31072 ([4.2 Rgression] Wrong code for volatile var with initalization and...
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Fri, 9 Mar 2007 00:32:34 +0000 (00:32 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Fri, 9 Mar 2007 00:32:34 +0000 (16:32 -0800)
2007-03-08  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C/31072
        * c-decl.c (merge_decls): Don't call make_var_volatile.
        * varasm.c (make_var_volatile): Remove.
        * output.h (make_var_volatile): Remove.

2007-03-08  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C/31072
        * gcc.c-torture/execute/pr31072.c: New test.

From-SVN: r122736

gcc/ChangeLog
gcc/c-decl.c
gcc/output.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr31072.c [new file with mode: 0644]
gcc/varasm.c

index 0cfed4b26244931d6a2676b16984024b15dc1d73..91cb190996796524efc4a44398d13c876b498535 100644 (file)
@@ -1,3 +1,10 @@
+2007-03-08  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR C/31072
+       * c-decl.c (merge_decls): Don't call make_var_volatile.
+       * varasm.c (make_var_volatile): Remove.
+       * output.h (make_var_volatile): Remove.
+
 2007-03-08  Zdenek Dvorak  <dvorakz@suse.cz>
 
        PR tree-optimization/31085
index 0d9fce559e74bfbbae0007f90524b91a0b2ac59b..fd5b065c19358fd75a8711efb0d32297e05ef2a0 100644 (file)
@@ -1690,11 +1690,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
     TREE_READONLY (olddecl) = 1;
 
   if (TREE_THIS_VOLATILE (newdecl))
-    {
-      TREE_THIS_VOLATILE (olddecl) = 1;
-      if (TREE_CODE (newdecl) == VAR_DECL)
-       make_var_volatile (newdecl);
-    }
+    TREE_THIS_VOLATILE (olddecl) = 1;
 
   /* Merge deprecatedness.  */
   if (TREE_DEPRECATED (newdecl))
index 3c9bcc444f8bb4e4360a63e84b2997e8d1e3c6b3..a5c29f0d8e0bcca601dbb0d7993d8d281b07d189 100644 (file)
@@ -170,10 +170,6 @@ extern void emutls_finish (void);
    Prefixes such as % are optional.  */
 extern int decode_reg_name (const char *);
 
-/* Make the rtl for variable VAR be volatile.
-   Use this only for static variables.  */
-extern void make_var_volatile (tree);
-
 extern void assemble_alias (tree, tree);
 
 extern void default_assemble_visibility (tree, int);
index 30236594ce5dae88e893cb0f5691492f1c12e554..ba0392e8b331d36ae12dc2507c234c609025b49a 100644 (file)
@@ -1,3 +1,8 @@
+2007-03-08  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR C/31072
+       * gcc.c-torture/execute/pr31072.c: New test.
+
 2007-03-08  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gcc.dg/builtins-55.c: Test *lceil* and *lfloor*.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr31072.c b/gcc/testsuite/gcc.c-torture/execute/pr31072.c
new file mode 100644 (file)
index 0000000..beb4b55
--- /dev/null
@@ -0,0 +1,10 @@
+extern volatile int ReadyFlag_NotProperlyInitialized;
+
+volatile int ReadyFlag_NotProperlyInitialized=1;
+
+int main(void)
+{
+  if (ReadyFlag_NotProperlyInitialized != 1)
+    __builtin_abort ();
+  return 0;
+}
index c92a5a08f42ab9bc85fdd0eab989b978829ec100..7e482b3a34b13a47a0d9ea773a5cef9dd48caf45 100644 (file)
@@ -1403,17 +1403,6 @@ make_decl_rtl (tree decl)
   if (flag_mudflap && TREE_CODE (decl) == VAR_DECL)
     mudflap_enqueue_decl (decl);
 }
-
-/* Make the rtl for variable VAR be volatile.
-   Use this only for static variables.  */
-
-void
-make_var_volatile (tree var)
-{
-  gcc_assert (MEM_P (DECL_RTL (var)));
-
-  MEM_VOLATILE_P (DECL_RTL (var)) = 1;
-}
 \f
 /* Output a string of literal assembler code
    for an `asm' keyword used between functions.  */