OSDN Git Service

* varasm.c (make_decl_rtl): Fix typo in last change.
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Jan 2001 04:15:04 +0000 (04:15 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Jan 2001 04:15:04 +0000 (04:15 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39026 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20010112-1.c [new file with mode: 0644]
gcc/varasm.c

index 12d67fe..45e1d59 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-12  Mark Mitchell  <mark@codesourcery.com>
+
+       * varasm.c (make_decl_rtl): Fix typo in last change.
+
 2001-01-14  Jeffrey Oldham  <oldham@codesourcery.com>
 
        * defaults.h (SUPPORTS_INIT_PRIORITY): New macro to indicate the
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010112-1.c b/gcc/testsuite/gcc.c-torture/compile/20010112-1.c
new file mode 100644 (file)
index 0000000..69bbe16
--- /dev/null
@@ -0,0 +1,14 @@
+/* Test that putting an initialized variable in a register works. */
+
+#ifdef __i386__
+#define REGISTER asm ("eax")
+#elif defined (__arm__)
+#define REGISTER asm ("r0")
+#else
+/* Put examples for other architectures here. */
+#define REGISTER
+#endif
+
+void f() {
+  register int i REGISTER = 3;
+}
index 928cd14..0cdf138 100644 (file)
@@ -663,7 +663,7 @@ make_decl_rtl (decl, asmspec)
        {
          int nregs;
 
-         if (DECL_INITIAL (decl) != 0 && !TREE_STATIC (decl))
+         if (DECL_INITIAL (decl) != 0 && TREE_STATIC (decl))
            {
              DECL_INITIAL (decl) = 0;
              error ("global register variable has initial value");