re PR tree-optimization/19337 (ada does not compile at -O3 (nested functions related))
authorJan Hubicka <jh@suse.cz>
Tue, 25 Jan 2005 19:32:53 +0000 (20:32 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 25 Jan 2005 19:32:53 +0000 (19:32 +0000)
PR tree-optimize/19337
* gcc.c-torture/compile/20050119-1.c: New test.

PR tree-optimize/19337
* tree-inline.c (initialize_inlined_parameters): Copy
saved_static_chain_decl only.

From-SVN: r94226

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20050119-1.c [new file with mode: 0644]
gcc/tree-inline.c

index d659cdb..f7cf25d 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-18  Jan Hubicka  <jh@suse.cz>
+
+       PR tree-optimize/19337
+       * tree-inline.c (initialize_inlined_parameters): Copy
+       saved_static_chain_decl only.
+
 2005-01-25  Richard Henderson  <rth@redhat.com>
 
        PR target/19556
index cd0415a..bc2bc83 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-18  Jan Hubicka  <jh@suse.cz>
+
+       PR tree-optimize/19337
+       * gcc.c-torture/compile/20050119-1.c: New test.
+
 2005-01-24  James E Wilson  <wilson@specifixinc.com>
 
        * gcc.c-torture/execute/builtins/lib/strstr.c (strstr): Correct exit
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050119-1.c b/gcc/testsuite/gcc.c-torture/compile/20050119-1.c
new file mode 100644 (file)
index 0000000..4f14ea4
--- /dev/null
@@ -0,0 +1,25 @@
+void write_char(char);
+int len(char*);
+void f(char *a)
+{
+  int col = 0;
+  int i;
+  void wchar(char c)
+  {
+    if (c == '\t')
+     {
+      do {
+       wchar(' ');
+      } while ((col%8)!=0);
+     }
+    else
+     {
+       write_char (c);
+       col++;
+     }
+  }
+  for(i =0;i<len(a);i++)
+  {
+   wchar(*a);
+  }
+}
index b46276a..eca80c3 100644 (file)
@@ -809,6 +809,8 @@ initialize_inlined_parameters (inline_data *id, tree args, tree static_chain,
 
   /* Initialize the static chain.  */
   p = DECL_STRUCT_FUNCTION (fn)->static_chain_decl;
+  if (fn == current_function_decl)
+    p = DECL_STRUCT_FUNCTION (fn)->saved_static_chain_decl;
   if (p)
     {
       /* No static chain?  Seems like a bug in tree-nested.c.  */