public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C patch]: Remove some needless copying
@ 2004-07-29  8:35 Nathan Sidwell
  2004-07-29  8:44 ` Joseph S. Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Sidwell @ 2004-07-29  8:35 UTC (permalink / raw)
  To: GCC Patches; +Cc: Joseph S. Myers

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

Hi,
it appears that complete_array_type was doing some needless things. If
wanted I could remove the abort entirely.

booted & tested on i686-pc-linux-gnu, ok?

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


[-- Attachment #2: comp_ary_type.diff --]
[-- Type: text/plain, Size: 1188 bytes --]

2004-07-28  Nathan Sidwell  <nathan@codesourcery.com>

	* c-decl.c (complete_array_type): Don't gratuitously copy
	maxindex.  Check it always has a type.

Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.547
diff -c -3 -p -r1.547 c-decl.c
*** c-decl.c	26 Jul 2004 00:38:04 -0000	1.547
--- c-decl.c	28 Jul 2004 12:04:22 -0000
*************** complete_array_type (tree type, tree ini
*** 3250,3256 ****
  		maxindex = fold (build (PLUS_EXPR, integer_type_node,
  					maxindex, integer_one_node));
  	    }
- 	  maxindex = copy_node (maxindex);
  	}
        else
  	{
--- 3251,3256 ----
*************** complete_array_type (tree type, tree ini
*** 3274,3280 ****
      {
        TYPE_DOMAIN (type) = build_index_type (maxindex);
        if (!TREE_TYPE (maxindex))
! 	TREE_TYPE (maxindex) = TYPE_DOMAIN (type);
      }
  
    /* Lay out the type now that we can get the real answer.  */
--- 3274,3280 ----
      {
        TYPE_DOMAIN (type) = build_index_type (maxindex);
        if (!TREE_TYPE (maxindex))
! 	abort ();
      }
  
    /* Lay out the type now that we can get the real answer.  */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [C patch]: Remove some needless copying
  2004-07-29  8:35 [C patch]: Remove some needless copying Nathan Sidwell
@ 2004-07-29  8:44 ` Joseph S. Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph S. Myers @ 2004-07-29  8:44 UTC (permalink / raw)
  To: Nathan Sidwell; +Cc: GCC Patches

On Wed, 28 Jul 2004, Nathan Sidwell wrote:

> it appears that complete_array_type was doing some needless things. If
> wanted I could remove the abort entirely.
> 
> booted & tested on i686-pc-linux-gnu, ok?

This is OK.  I can't think the rest of the code there is being
particularly efficient either.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-28 19:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-29  8:35 [C patch]: Remove some needless copying Nathan Sidwell
2004-07-29  8:44 ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).