From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17055 invoked by alias); 11 Jun 2004 16:42:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16947 invoked from network); 11 Jun 2004 16:42:12 -0000 Received: from unknown (HELO mta09-svc.ntlworld.com) (62.253.162.49) by sourceware.org with SMTP; 11 Jun 2004 16:42:12 -0000 Received: from cuddles.cambridge.redhat.com ([81.96.64.123]) by mta09-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20040611164244.NLPG20971.mta09-svc.ntlworld.com@cuddles.cambridge.redhat.com> for ; Fri, 11 Jun 2004 17:42:44 +0100 Received: from redhat.com (localhost.localdomain [127.0.0.1]) by cuddles.cambridge.redhat.com (8.12.8/8.12.8) with ESMTP id i5BGfVVL029036; Fri, 11 Jun 2004 17:41:41 +0100 Received: (from aph@localhost) by redhat.com (8.12.8/8.12.8/Submit) id i5BGfVqi029032; Fri, 11 Jun 2004 17:41:31 +0100 From: Andrew Haley MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16585.57531.436288.548134@cuddles.cambridge.redhat.com> Date: Fri, 11 Jun 2004 18:18:00 -0000 To: Richard Henderson Cc: gcc-patches@gcc.gnu.org Subject: Re: New flag: TREE_THIS_NOTRAP In-Reply-To: <20040610164824.GB18122@redhat.com> References: <16583.1557.289552.644295@cuddles.cambridge.redhat.com> <20040609201201.GC13131@redhat.com> <16584.10321.968782.357069@cuddles.cambridge.redhat.com> <20040610164824.GB18122@redhat.com> X-SW-Source: 2004-06/txt/msg00769.txt.bz2 New, improved version. I'm punting on the question of weak VAR_DECLS. Andrew. 2004-06-11 Andrew Haley * emit-rtl.c (set_mem_attributes_minus_bitpos): Check TREE_THIS_NOTRAP when setting MEM_NOTRAP_P. * tree-eh.c (tree_could_trap_p): Check TREE_THIS_NOTRAP. * tree.h (TREE_THIS_NOTRAP): New. Index: emit-rtl.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/emit-rtl.c,v retrieving revision 1.393 diff -p -2 -c -r1.393 emit-rtl.c *** emit-rtl.c 28 May 2004 06:27:31 -0000 1.393 --- emit-rtl.c 11 Jun 2004 16:25:20 -0000 *************** set_mem_attributes_minus_bitpos (rtx ref *** 1544,1547 **** --- 1544,1548 ---- || (! TYPE_P (t) && TREE_CONSTANT (t))); MEM_POINTER (ref) = POINTER_TYPE_P (type); + MEM_NOTRAP_P (ref) = TREE_THIS_NOTRAP (t); /* If we are making an object of this type, or if this is a DECL, we know Index: tree-eh.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/tree-eh.c,v retrieving revision 2.3 diff -p -2 -c -r2.3 tree-eh.c *** tree-eh.c 30 May 2004 18:32:29 -0000 2.3 --- tree-eh.c 11 Jun 2004 16:25:20 -0000 *************** tree_could_trap_p (tree expr) *** 1688,1694 **** case BIT_FIELD_REF: t = get_base_address (expr); ! return !t || TREE_CODE (t) == INDIRECT_REF; case INDIRECT_REF: case TRUNC_DIV_EXPR: case CEIL_DIV_EXPR: --- 1688,1699 ---- case BIT_FIELD_REF: t = get_base_address (expr); ! return !t || tree_could_trap_p (t); case INDIRECT_REF: + { + tree t = TREE_OPERAND (expr, 0); + return (TREE_THIS_NOTRAP (t) == false); + } + case TRUNC_DIV_EXPR: case CEIL_DIV_EXPR: Index: tree.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/tree.h,v retrieving revision 1.506 diff -p -2 -c -r1.506 tree.h *** tree.h 7 Jun 2004 02:10:48 -0000 1.506 --- tree.h 11 Jun 2004 16:25:22 -0000 *************** struct tree_common GTY(()) *** 306,309 **** --- 306,312 ---- ..._TYPE + TREE_THIS_NOTRAP in + arithmetic expressions + deprecated_flag: *************** extern void tree_operand_check_failed (i *** 789,792 **** --- 792,801 ---- #define TREE_THIS_VOLATILE(NODE) ((NODE)->common.volatile_flag) + /* Nonzero means this node will not trap. In an operand of pointer + type, means accessing the memory pointed to won't generate a trap. + However, this only applies to an object when used appropriately: it + doesn't mean that writing a READONLY mem won't trap. */ + #define TREE_THIS_NOTRAP(NODE) ((NODE)->common.nothrow_flag) + /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node, nonzero means it may not be the lhs of an assignment. */