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]

[PATCH] Backport of execute/align-1.c fix for gcc-2.95.3


Hi,

this closes my work on execution fail fixes on powerpc-linux-gnu , the 
remaining ones (with the rest of patchset included) are now:

- execute/20000412-2.c: fixed in the mainline by:
   2000-08-12  Richard Henderson  <rth@cygnus.com>
        * sibcall.c (uses_addressof): Accept both addressof and
        current_function_internal_arg_pointer inside a mem.
        (optimize_sibling_and_tail_recursive_call): Fail tail recursion
        if current_function_uses_addressof.
        * stmt.c (expand_return): Kill tail recursion and HAVE_return
        optimizations.
  Looks a bit invasive...

- execute/20000917-1.c: Fixed by C function-at-a-time processing, certainly 
to invasive

- execute/991202-3.c: I tracked down the fix once, but can't find it right 
now. But AFAIR it was pretty invasive and/or relying on other patches.

Align-1 patch bootstrapped & tested OK on powerpc-linux-gnu.

Franz.

2000-08-24  Jim Wilson  <wilson@cygnus.com>
 
        * c-common.c (decl_attributes, case A_ALIGN): Revert last change.
        Copy type in a TYPE_DECL, just like pushdecl does.

Index: gcc/c-common.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/c-common.c,v
retrieving revision 1.56.4.2
diff -u -p -r1.56.4.2 c-common.c
--- gcc/c-common.c	1999/09/07 08:11:16	1.56.4.2
+++ gcc/c-common.c	2000/12/01 00:44:51
@@ -697,7 +697,23 @@ decl_attributes (node, attributes, prefi
 	    if (exact_log2 (align) == -1)
 	      error ("requested alignment is not a power of 2");
 	    else if (is_type)
-	      TYPE_ALIGN (type) = align;
+	      {
+		/* If we have a TYPE_DECL, then copy the type, so that we
+		   don't accidentally modify a builtin type.  See pushdecl.  */
+		if (decl && TREE_TYPE (decl) != error_mark_node
+		    && DECL_ORIGINAL_TYPE (decl) == NULL_TREE)
+		  {
+		    tree tt = TREE_TYPE (decl);
+		    DECL_ORIGINAL_TYPE (decl) = tt;
+		    tt = build_type_copy (tt);
+		    TYPE_NAME (tt) = decl;
+		    TREE_USED (tt) = TREE_USED (decl);
+		    TREE_TYPE (decl) = tt;
+		    type = tt;
+		  }
+
+		TYPE_ALIGN (type) = align;
+	      }
 	    else if (TREE_CODE (decl) != VAR_DECL
 		     && TREE_CODE (decl) != FIELD_DECL)
 	      error_with_decl (decl,

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