From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13876 invoked by alias); 19 Jan 2004 19:13:39 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 13838 invoked from network); 19 Jan 2004 19:13:38 -0000 Received: from unknown (HELO vlsi1.ultra.nyu.edu) (128.122.140.213) by sources.redhat.com with SMTP; 19 Jan 2004 19:13:38 -0000 Received: by vlsi1.ultra.nyu.edu (4.1/1.34) id AA01080; Mon, 19 Jan 04 14:15:51 EST Date: Mon, 19 Jan 2004 19:13:00 -0000 From: kenner@vlsi1.ultra.nyu.edu (Richard Kenner) Message-Id: <10401191915.AA01080@vlsi1.ultra.nyu.edu> To: dnovillo@redhat.com Subject: Re: [RFC] Contributing tree-ssa to mainline Cc: gcc@gcc.gnu.org X-SW-Source: 2004-01/txt/msg01353.txt.bz2 Well, I know nothing about Ada so I'm not sure what you mean by that remark. That's why I was asking for specific examples. Annotated, if possible. OK. Here's a test program: procedure Tparray (X: Integer) is type Barr is array (Integer range <>) of Boolean; pragma Pack (Barr); -- So we have a packed array of 1 bit Y: constant Integer := 31; -- Here's a variable whose value we know. subtype Barr1 is Barr(1..X); -- This type has variable size. subtype Barr2 is Barr(1..Y); -- ... and this one has a fixed size (31 bits). -- Now we have two identical functions, one on each type. function F1 (A, B : Barr1) return Barr1 is Arr: Barr1 := A; begin Arr (2) := False; return Arr xor B; end F1; function F2 (A, B : Barr2) return Barr2 is Arr: Barr2 := A; begin Arr (2) := False; return Arr xor B; end F2; begin null; end Tparray; Now here's the Ada expanded code for this. Note the very different forms of tparray__f1 and tparray__f2: Source recreated from tree for Tparray (body) --------------------------------------------- with system.system__unsigned_types; with system.system__bit_ops; with system; with system.system__secondary_stack; procedure tparray (x : integer) is type tparray__barr is array (-16#8000_0000# .. 16#7FFF_FFFF# range <>) of boolean; pragma pack (tparray__barr); y : constant integer := 31; subtype tparray__barr1 is tparray__barr (1 .. x); subtype tparray__barr2 is tparray__barr (1 .. 31); freeze tparray__barr [] freeze tparray__barr1 [] freeze tparray__barr2 [] function tparray__f1 (a : tparray__barr1; b : tparray__barr1) return tparray__barr1 is arr : tparray__barr1 := a; begin arr (0) := system__unsigned_types__packed_byte!(arr (0) and 16#FD#); null; T3b : tparray__barr1; system__bit_ops__bit_xor (arr'address, tparray__Tbarr1P1' range_length, b'address, tparray__Tbarr1P1'range_length, T3b' address); return T3b; end tparray__f1; function tparray__f2 (a : tparray__barr2; b : tparray__barr2) return tparray__barr2 is arr : tparray__barr2 := a; begin arr := tparray__barr2___XP1!(arr and 16#FFFF_FFFD#); null; return tparray__barr2!(arr xor b); end tparray__f2; begin null; return; end tparray;