public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: Richard Henderson <rth@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: New flag: TREE_THIS_NOTRAP
Date: Fri, 11 Jun 2004 18:18:00 -0000	[thread overview]
Message-ID: <16585.57531.436288.548134@cuddles.cambridge.redhat.com> (raw)
In-Reply-To: <20040610164824.GB18122@redhat.com>

New, improved version.  I'm punting on the question of weak VAR_DECLS.

Andrew.


2004-06-11  Andrew Haley  <aph@redhat.com>

	* 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.  */

  reply	other threads:[~2004-06-11 16:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09 14:03 Andrew Haley
2004-06-09 21:45 ` Richard Henderson
2004-06-09 21:46 ` Richard Henderson
2004-06-10 12:45   ` Andrew Haley
2004-06-10 18:06     ` Richard Henderson
2004-06-11 18:18       ` Andrew Haley [this message]
2004-06-11 20:37         ` Richard Henderson
2004-06-11 20:44           ` Andrew Haley
2004-06-11 20:49             ` Richard Henderson
2004-06-14 22:26               ` Jason Merrill
2004-06-16 17:17               ` Andrew Haley
2004-06-16 17:17                 ` Andrew Haley
2004-06-16 17:35                   ` Frank Ch. Eigler
2004-06-16 17:35                     ` Andrew Haley
2004-06-16 18:30                 ` Richard Henderson
2004-06-15  2:39             ` Tom Tromey
2004-06-15 11:50               ` Andrew Haley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16585.57531.436288.548134@cuddles.cambridge.redhat.com \
    --to=aph@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).