re PR rtl-optimization/18084 (setfill coupled with inline function: incorrect results...
authorRoger Sayle <roger@eyesopen.com>
Sat, 30 Oct 2004 22:58:49 +0000 (22:58 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 30 Oct 2004 22:58:49 +0000 (22:58 +0000)
PR rtl-optimization/18084
* g++.dg/opt/pr18084-1.C: New testcase.

From-SVN: r89900

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr18084-1.C [new file with mode: 0644]

index 3255d473b82d864b7122b0d32681ff59a9fdcf1b..aa3247ef5fd673158064fe190df2e2da32bb0a9c 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-30  Roger Sayle  <roger@eyesopen.com>
+
+       PR rtl-optimization/18084
+       * g++.dg/opt/pr18084-1.C: New testcase.
+
 2004-10-30  Matt Austern  <austern@apple.com>
 
        PR c++/17542
diff --git a/gcc/testsuite/g++.dg/opt/pr18084-1.C b/gcc/testsuite/g++.dg/opt/pr18084-1.C
new file mode 100644 (file)
index 0000000..bf62a7b
--- /dev/null
@@ -0,0 +1,32 @@
+// { dg-do run }
+// { dg-options "-O3" }
+
+extern "C" void abort (void);
+
+struct X {
+    bool init;
+    void foo() { if (!init) init = true; }
+    void bar() { foo();                  }
+
+};
+
+typedef unsigned long long int uint64_t;
+uint64_t mask1, mask2;
+
+uint64_t calc() {
+  return mask1 & mask2;
+}
+
+int main()
+{
+  mask1 = 0x00000000FFFFFFFFull;
+  mask2 = 0x000000000000FFFFull;
+  uint64_t value = calc();
+
+  X().bar();
+
+  if(value != calc())
+    abort ();
+  return 0;
+}
+