This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch to turn off analysis of static variables


On Wed, 2004-09-15 at 15:19, Kenneth Zadeck wrote:

> I have written and have enclosed a test case and diego will add this to 
> the test suite since this is part of the development process I have not 
> yet figured out.
>
Done.  I changed the test to use integers and verified that it fails
with your analysis enabled.


Diego.

2004-09-17  Kenneth Zadeck  <Kenneth.Zadeck@NaturalBridge.com>

	* gcc.c-torture/execute/20040917-1.c: New test.

Index: gcc.c-torture/execute/20040917-1.c
===================================================================
RCS file: gcc.c-torture/execute/20040917-1.c
diff -N gcc.c-torture/execute/20040917-1.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gcc.c-torture/execute/20040917-1.c	17 Sep 2004 21:47:09 -0000
@@ -0,0 +1,32 @@
+/* submitted by kenneth zadeck */
+
+static int test_var;
+
+/* the idea here is that not only is inlinable, inlinable but since it
+   is static, the cgraph node will not be marked as output.  The
+   current version of the code ignores these cgraph nodes.  */
+
+void not_inlinable()  __attribute__((noinline));
+
+static void  
+inlinable ()
+{
+  test_var = -10;
+}
+
+void 
+not_inlinable ()
+{
+  inlinable();
+}
+
+main ()
+{
+  test_var = 10;
+  /* Variable test_var should be considered call-clobbered by the call
+     to not_inlinable().  */
+  not_inlinable ();
+  if (test_var == 10)
+    abort ();
+  return 0;
+}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]