This is the mail archive of the gcc@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]

Re: 2.95.4 plans


On Friday 16 March 2001 17:18, Bernd Schmidt wrote:
> Now that 2.95.3 is out, I'll again accept suggestions what to include in
> 2.95.4, so please send candidate patches and bug reports.
>
> One major item that needs fixing is the sjlj eh problem; the fix for this
> had to be taken out of the 2.95.3 release since it introduced too many
> other problems.  Another obvious candidate is the weak symbol problem that
> affects glibc on some platforms.

Unfortunately the weak symbol patch turned out to be a bit more complicated 
than I first thought, cause sequences like

extern int dummy __attribute__((weak));
...
extern int dummy;

neither do the correct thing with the DECL_WEAK flag nor produce a warning. 
Similar issues are there for #pragma weak. I guess for gcc-2.95.4 I will head 
for the simplest solution, cause in any case we will start to _disable_ an 
optimization if the user does everything right.

Find appended the first bunch of patches I would like to commit.

- the rtx_equal_function_matters change fixes
  gcc.c-torture/execute/complex-5.c on PPC
- the c-common.c change fixes gcc.c-torture/execute/align-1.c
- the stor-layout.c change fixes gcc.c-torture/execute/991014-1.c
- the function.c change fixes gcc.c-torture/execute/20001017-1.c

We've already talked about the last one, this patch is more conservative than 
the one that went into the mainline and 3.0. I guess you still don't feel 
comfortable, that's why I want to get it in early in 2.95.4 for a long 
testing phase.

OK to commit?

Next will be a bunch of loop/strength reduction fixes, ideally with c/2100 
fixed too, if one of the loop gods dares to comment to my analysis ;-).

Franz.

Index: gcc/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.3667.4.340
diff -u -p -r1.3667.4.340 ChangeLog
--- gcc/ChangeLog	2001/03/20 19:51:49	1.3667.4.340
+++ gcc/ChangeLog	2001/03/20 22:03:13
@@ -1,3 +1,24 @@
+2001-03-20  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+	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.
+
+	2000-10-17  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+	* function.c (locate_and_pad_parm): Don't align stack unconditionally.
+
+	Thu Oct 14 03:59:57 1999  Stephane Carrez  <stcarrez@worldnet.fr>
+	* stor-layout.c (layout_union): Use HOST_WIDE_INT for const_size;
+	check for member bit-size overflow and use var_size if it occurs.
+	(layout_record): Use bitsize_int() to define the type size in bits.
+	Likewise for computation and assignment to DECL_FIELD_BITPOS.
+	(layout_decl): Likewise when assigning to DECL_SIZE. 
+
+	Thu Oct 28 10:20:02 1999  Geoffrey Keating  <geoffk@cygnus.com>
+	* config/rs6000/rs6000.md (movsf): Don't convert a SUBREG
+	of the function return register into a plain REG until
+	after function inlining is done.
+
 2001-03-20  David O'Brien  <obrien@FreeBSD.org>
 
 	from 2000-07-12  Zack Weinberg  <zack@wolery.cumb.org>
Index: gcc/c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.56.4.3
diff -u -p -r1.56.4.3 c-common.c
--- gcc/c-common.c	2001/03/19 14:13:01	1.56.4.3
+++ gcc/c-common.c	2001/03/20 22:03:15
@@ -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: gcc/cse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cse.c,v
retrieving revision 1.72.4.6
diff -u -p -r1.72.4.6 cse.c
--- gcc/cse.c	2001/01/25 14:03:03	1.72.4.6
+++ gcc/cse.c	2001/03/20 22:03:21
@@ -695,8 +695,6 @@ static void check_fold_consts	PROTO((PTR
 static struct cse_reg_info* get_cse_reg_info PROTO((int));
 static void free_cse_reg_info   PROTO((splay_tree_value));
 static void flush_hash_table	PROTO((void));
-
-extern int rtx_equal_function_value_matters;
 
 /* Dump the expressions in the equivalence class indicated by CLASSP.
    This function is used only for debugging.  */
Index: gcc/function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.90.4.6
diff -u -p -r1.90.4.6 function.c
--- gcc/function.c	2001/01/25 14:03:15	1.90.4.6
+++ gcc/function.c	2001/03/20 22:03:26
@@ -5292,7 +5292,18 @@ locate_and_pad_parm (passed_mode, type, 
 				- offset_ptr->constant); 
     }
 #else /* !ARGS_GROW_DOWNWARD */
-  pad_to_arg_alignment (initial_offset_ptr, boundary);
+  if (!in_regs 
+#ifdef REG_PARM_STACK_SPACE
+      || REG_PARM_STACK_SPACE (fndecl) > 0
+#else
+      /* For the gcc-2_95-branch we want to make sure not to break something
+         on platforms which pass argument in registers but don't define
+         REG_PARM_STACK_SPACE. So we force the original behaviour here.  */
+      || 1
+#endif
+      )
+    pad_to_arg_alignment (initial_offset_ptr, boundary);
+
   *offset_ptr = *initial_offset_ptr;
 
 #ifdef PUSH_ROUNDING
Index: gcc/rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.105.4.3
diff -u -p -r1.105.4.3 rtl.h
--- gcc/rtl.h	2001/01/25 14:03:22	1.105.4.3
+++ gcc/rtl.h	2001/03/20 22:03:27
@@ -888,6 +888,12 @@ extern char *note_insn_name[];
 /* For a NOTE_INSN_LIVE note, the original basic block number.  */
 #define RANGE_LIVE_ORIG_BLOCK(INSN) (XINT (INSN, 1))
 
+/* Nonzero if we need to distinguish between the return value of this function
+   and the return value of a function called by this function.  This helps
+   integrate.c.
+   This is 1 until after the rtl generation pass.  */
+extern int rtx_equal_function_value_matters;
+
 /* Generally useful functions.  */
 
 /* The following functions accept a wide integer argument.  Rather than
Index: gcc/stor-layout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stor-layout.c,v
retrieving revision 1.25
diff -u -p -r1.25 stor-layout.c
--- gcc/stor-layout.c	1999/03/11 13:56:20	1.25
+++ gcc/stor-layout.c	2001/03/20 22:03:28
@@ -264,8 +264,8 @@ layout_decl (decl, known_align)
       if (spec_size == 0 && DECL_NAME (decl) != 0)
 	abort ();
 
-      /* Size is specified number of bits.  */
-      DECL_SIZE (decl) = size_int (spec_size);
+      /* Size is specified in number of bits.  */
+      DECL_SIZE (decl) = bitsize_int (spec_size, 0);
     }
   /* Force alignment required for the data type.
      But if the decl itself wants greater alignment, don't override that.
@@ -301,7 +301,7 @@ layout_decl (decl, known_align)
 	  DECL_ALIGN (decl) = MAX ((unsigned) GET_MODE_ALIGNMENT (xmode),
 				   DECL_ALIGN (decl));
 	  DECL_MODE (decl) = xmode;
-	  DECL_SIZE (decl) = size_int (GET_MODE_BITSIZE (xmode));
+	  DECL_SIZE (decl) = bitsize_int (GET_MODE_BITSIZE (xmode), 0);
 	  /* This no longer needs to be accessed as a bit field.  */
 	  DECL_BIT_FIELD (decl) = 0;
 	}
@@ -520,7 +520,7 @@ layout_record (rec)
 	DECL_FIELD_BITPOS (field) = var_size;
       else
 	{
-	  DECL_FIELD_BITPOS (field) = size_int (const_size);
+	  DECL_FIELD_BITPOS (field) = bitsize_int (const_size, 0L);
 
 	  /* If this field ended up more aligned than we thought it
 	     would be (we approximate this by seeing if its position
@@ -562,7 +562,7 @@ layout_record (rec)
 
   if (var_size == 0)
     {
-      TYPE_SIZE (rec) = size_int (const_size);
+      TYPE_SIZE (rec) = bitsize_int (const_size, 0L);
     }
   else
     {
@@ -610,7 +610,7 @@ layout_union (rec)
   /* The size of the union, based on the fields scanned so far,
      is max (CONST_SIZE, VAR_SIZE).
      VAR_SIZE may be null; then CONST_SIZE by itself is the size.  */
-  register int const_size = 0;
+  register HOST_WIDE_INT const_size = 0;
   register tree var_size = 0;
 
 #ifdef STRUCTURE_SIZE_BOUNDARY
@@ -627,6 +627,8 @@ layout_union (rec)
 
   for (field = TYPE_FIELDS (rec); field; field = TREE_CHAIN (field))
     {
+      tree dsize;
+      
       /* Enums which are local to this class need not be laid out.  */
       if (TREE_CODE (field) == CONST_DECL || TREE_CODE (field) == TYPE_DECL)
 	continue;
@@ -645,19 +647,22 @@ layout_union (rec)
 	union_align = MAX (union_align, TYPE_ALIGN (TREE_TYPE (field)));
 #endif
 
+      dsize = DECL_SIZE (field);
       if (TREE_CODE (rec) == UNION_TYPE)
 	{
 	  /* Set union_size to max (decl_size, union_size).
 	     There are more and less general ways to do this.
 	     Use only CONST_SIZE unless forced to use VAR_SIZE.  */
 
-	  if (TREE_CODE (DECL_SIZE (field)) == INTEGER_CST)
+	  if (TREE_CODE (dsize) == INTEGER_CST
+              && ! TREE_CONSTANT_OVERFLOW (dsize)
+              && TREE_INT_CST_HIGH (dsize) == 0)
 	    const_size
-	      = MAX (const_size, TREE_INT_CST_LOW (DECL_SIZE (field)));
+	      = MAX (const_size, TREE_INT_CST_LOW (dsize));
 	  else if (var_size == 0)
-	    var_size = DECL_SIZE (field);
+	    var_size = dsize;
 	  else
-	    var_size = size_binop (MAX_EXPR, var_size, DECL_SIZE (field));
+	    var_size = size_binop (MAX_EXPR, var_size, dsize);
 	}
       else if (TREE_CODE (rec) == QUAL_UNION_TYPE)
 	var_size = fold (build (COND_EXPR, sizetype, DECL_QUALIFIER (field),
Index: gcc/toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.185.4.7
diff -u -p -r1.185.4.7 toplev.c
--- gcc/toplev.c	2001/01/25 14:03:23	1.185.4.7
+++ gcc/toplev.c	2001/03/20 22:03:31
@@ -137,8 +137,6 @@ You Lose!  You must define PREFERRED_DEB
 #define DIR_SEPARATOR '/'
 #endif
 
-extern int rtx_equal_function_value_matters;
-
 #if ! (defined (VMS) || defined (OS2))
 extern char **environ;
 #endif
Index: gcc/config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.55.4.17
diff -u -p -r1.55.4.17 rs6000.md
--- gcc/config/rs6000/rs6000.md	2001/01/25 14:03:35	1.55.4.17
+++ gcc/config/rs6000/rs6000.md	2001/03/20 22:03:35
@@ -6184,7 +6184,9 @@
      reg.  So expand it.  */
   if (GET_CODE (operands[0]) == SUBREG
       && GET_CODE (SUBREG_REG (operands[0])) == REG
-      && REGNO (SUBREG_REG (operands[0])) < FIRST_PSEUDO_REGISTER)
+      && REGNO (SUBREG_REG (operands[0])) < FIRST_PSEUDO_REGISTER
+      && (! REG_FUNCTION_VALUE_P (SUBREG_REG (operands[0]))
+	  || ! rtx_equal_function_value_matters))
     operands[0] = alter_subreg (operands[0]);
   if (GET_CODE (operands[1]) == SUBREG
       && GET_CODE (SUBREG_REG (operands[1])) == REG

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