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]
Other format: [Raw text]

belated improvement patches


Hi,
I've installed these patches, which I'd forgotten about. the tree.c patch
had been approved some time ago, and the documentation patch went through
a number of iterations, and now reflects the tru portability goals (I believe)

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org

2002-12-22  Nathan Sidwell  <nathan@codesourcery.com>

	* tree.c (save_expr): Allow either side of a dyadic operand to be
	constant.

	* doc/portability.texi (portability): Update portability goals.
gcc/gcc/Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.285
diff -c -3 -p -r1.285 tree.c
*** tree.c	19 Dec 2002 07:29:28 -0000	1.285
--- tree.c	23 Dec 2002 13:36:49 -0000
*************** save_expr (expr)
*** 1363,1374 ****
       a constant, it will be more efficient to not make another SAVE_EXPR since
       it will allow better simplification and GCSE will be able to merge the
       computations if they actualy occur.  */
!   for (inner = t;
!        (TREE_CODE_CLASS (TREE_CODE (inner)) == '1'
! 	|| (TREE_CODE_CLASS (TREE_CODE (inner)) == '2'
! 	    && TREE_CONSTANT (TREE_OPERAND (inner, 1))));
!        inner = TREE_OPERAND (inner, 0))
!     ;
  
    /* If the tree evaluates to a constant, then we don't want to hide that
       fact (i.e. this allows further folding, and direct checks for constants).
--- 1363,1385 ----
       a constant, it will be more efficient to not make another SAVE_EXPR since
       it will allow better simplification and GCSE will be able to merge the
       computations if they actualy occur.  */
!   inner = t;
!   while (1)
!     {
!       if (TREE_CODE_CLASS (TREE_CODE (inner)) == '1')
! 	inner = TREE_OPERAND (inner, 0);
!       else if (TREE_CODE_CLASS (TREE_CODE (inner)) == '2')
! 	{
! 	  if (TREE_CONSTANT (TREE_OPERAND (inner, 1)))
! 	    inner = TREE_OPERAND (inner, 0);
! 	  else if (TREE_CONSTANT (TREE_OPERAND (inner, 0)))
! 	    inner = TREE_OPERAND (inner, 1);
! 	  else
! 	    break;
! 	}
!       else
! 	break;
!     }
  
    /* If the tree evaluates to a constant, then we don't want to hide that
       fact (i.e. this allows further folding, and direct checks for constants).
*************** save_expr (expr)
*** 1377,1383 ****
       literal node.  */
    if (TREE_CONSTANT (inner)
        || (TREE_READONLY (inner) && ! TREE_SIDE_EFFECTS (inner))
!       || TREE_CODE (inner) == SAVE_EXPR || TREE_CODE (inner) == ERROR_MARK)
      return t;
  
    /* If T contains a PLACEHOLDER_EXPR, we must evaluate it each time, since
--- 1388,1395 ----
       literal node.  */
    if (TREE_CONSTANT (inner)
        || (TREE_READONLY (inner) && ! TREE_SIDE_EFFECTS (inner))
!       || TREE_CODE (inner) == SAVE_EXPR
!       || TREE_CODE (inner) == ERROR_MARK)
      return t;
  
    /* If T contains a PLACEHOLDER_EXPR, we must evaluate it each time, since
Index: doc/portability.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/portability.texi,v
retrieving revision 1.1
diff -c -3 -p -r1.1 portability.texi
*** doc/portability.texi	12 Nov 2001 15:46:47 -0000	1.1
--- doc/portability.texi	23 Dec 2002 13:36:49 -0000
***************
*** 1,5 ****
  @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
! @c 1999, 2000, 2001 Free Software Foundation, Inc.
  @c This is part of the GCC manual.
  @c For copying conditions, see the file gcc.texi.
  
--- 1,5 ----
  @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
! @c 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
  @c This is part of the GCC manual.
  @c For copying conditions, see the file gcc.texi.
  
***************
*** 8,17 ****
  @cindex portability
  @cindex GCC and portability
  
! The main goal of GCC was to make a good, fast compiler for machines in
! the class that the GNU system aims to run on: 32-bit machines that address
! 8-bit bytes and have several general registers.  Elegance, theoretical
! power and simplicity are only secondary.
  
  GCC gets most of the information about the target machine from a machine
  description which gives an algebraic formula for each of the machine's
--- 8,18 ----
  @cindex portability
  @cindex GCC and portability
  
! GCC itself aims to be portable to any machine where @code{int} is at least
! a 32-bit type.  It aims to target machines with a flat (non-segmented) byte
! addressed data address space (the code address space can be separate).
! Target ABIs may have 8, 16, 32 or 64-bit @code{int} type. @code{char}
! can be wider than 8 bits.
  
  GCC gets most of the information about the target machine from a machine
  description which gives an algebraic formula for each of the machine's

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