* tree-vrp.c (infer_value_range): Ignore asm statements when
looking for memory accesses for -fdelete-null-pointer-checks.
testsuite/:
* gcc.target/i386/
20080723-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138107
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-07-23 Ian Lance Taylor <iant@google.com>
+
+ * tree-vrp.c (infer_value_range): Ignore asm statements when
+ looking for memory accesses for -fdelete-null-pointer-checks.
+
2008-07-24 Ben Elliston <bje@au.ibm.com>
* config/spu/spu-c.c (__vector_keyword): New variable.
+2008-07-23 Ian Lance Taylor <iant@google.com>
+
+ * gcc.target/i386/20080723-1.c: New test.
+
2008-07-24 Ben Elliston <bje@au.ibm.com>
* gcc.target/spu/vector.c: New test.
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+extern void exit (int);
+
+static inline __attribute__((always_inline))
+void
+prefetch (void *x)
+{
+ asm volatile("prefetcht0 %0" : : "m" (*(unsigned long *)x));
+}
+
+struct hlist_head
+{
+ struct hlist_node *first;
+};
+
+struct hlist_node
+{
+ struct hlist_node *next;
+ unsigned long i_ino;
+};
+
+struct hlist_node * find_inode_fast(struct hlist_head *head, unsigned long ino)
+{
+ struct hlist_node *node;
+
+ for (node = head->first;
+ node && (prefetch (node->next), 1);
+ node = node->next)
+ {
+ if (node->i_ino == ino)
+ break;
+ }
+ return node ? node : 0;
+}
+
+struct hlist_node g2;
+struct hlist_node g1 = { &g2 };
+struct hlist_head h = { &g1 };
+
+int
+main()
+{
+ if (find_inode_fast (&h, 1) != 0)
+ abort ();
+ exit (0);
+}
/* We can only assume that a pointer dereference will yield
non-NULL if -fdelete-null-pointer-checks is enabled. */
- if (flag_delete_null_pointer_checks && POINTER_TYPE_P (TREE_TYPE (op)))
+ if (flag_delete_null_pointer_checks
+ && POINTER_TYPE_P (TREE_TYPE (op))
+ && TREE_CODE (stmt) != ASM_EXPR)
{
unsigned num_uses, num_loads, num_stores;