[3.4 PATCH] Backport same_translation_unit_p pasto fix from mainline

Jakub Jelinek jakub@redhat.com
Tue Jan 4 23:23:00 GMT 2005


Hi!

The testcase below causes ICE on gcc-3_4-branch, a regression
from 3.3 and fixed again on mainline.
Ok to commit?

2005-01-05  Jakub Jelinek  <jakub@redhat.com>

	Backport from mainline:
	2004-03-22  Diego Novillo  <dnovillo@redhat.com>

	* c-typeck.c (same_translation_unit_p): Fix pasto.

	* gcc.c-torture/compile/20050105-1.c: New test.

--- gcc/c-typeck.c	20 Mar 2004 20:46:56 -0000	1.291
+++ gcc/c-typeck.c	23 Mar 2004 20:43:38 -0000	1.292
@@ -633,7 +633,7 @@ same_translation_unit_p (tree t1, tree t
   while (t2 && TREE_CODE (t2) != TRANSLATION_UNIT_DECL)
     switch (TREE_CODE_CLASS (TREE_CODE (t2)))
       {
-      case 'd': t2 = DECL_CONTEXT (t1); break;
+      case 'd': t2 = DECL_CONTEXT (t2); break;
       case 't': t2 = TYPE_CONTEXT (t2); break;
       case 'b': t2 = BLOCK_SUPERCONTEXT (t2); break;
       default: abort ();
--- gcc/testsuite/gcc.c-torture/compile/20050105-1.c.jj	2005-01-05 00:20:08.597786280 +0100
+++ gcc/testsuite/gcc.c-torture/compile/20050105-1.c	2005-01-05 00:19:57.399779996 +0100
@@ -0,0 +1,5 @@
+void bar (struct S *);
+void foo (void *x)
+{
+  bar ((struct S *) x);
+}

	Jakub



More information about the Gcc-patches mailing list