This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch to turn off analysis of static variables
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Ken Zadeck <zadeck at naturalbridge dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Mark Mitchell <mark at codesourcery dot com>, Jan Hubicka <jh at suse dot cz>
- Date: Fri, 17 Sep 2004 17:51:57 -0400
- Subject: Re: patch to turn off analysis of static variables
- Organization: Red Hat Canada
- References: <414895BB.9010909@naturalbridge.com>
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;
+}