+2008-07-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * fold-const.c (fold_convert_const): Treat OFFSET_TYPE the same as
+ integral and pointer types.
+
2008-07-04 Roger Sayle <roger@eyesopen.com>
* config/rs6000/host-darwin.c (darwin_rs6000_extra_siganls): Cast
if (TREE_TYPE (arg1) == type)
return arg1;
- if (POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type))
+ if (POINTER_TYPE_P (type) || INTEGRAL_TYPE_P (type)
+ || TREE_CODE (type) == OFFSET_TYPE)
{
if (TREE_CODE (arg1) == INTEGER_CST)
return fold_convert_const_int_from_int (type, arg1);
+2008-07-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * g++.dg/tree-ssa/ptrmemfield.C: New testcase.
+
2008-07-05 Joseph Myers <joseph@codesourcery.com>
* lib/gcc-dg.exp (remove-build-file): Remove files on remote host
--- /dev/null
+/* { dg-do compile } */
+// { dg-options "-O2 -fdump-tree-final_cleanup" }
+
+
+struct f
+{
+ char m;
+ char m1;
+};
+
+static inline char f:: *g(int a)
+{
+ return a?0:&f::m;
+}
+
+int h(void)
+{
+ char f:: *a = g(0);
+ return a == 0;
+}
+
+/* We should have no cast to offset_type. */
+/* { dg-final { scan-tree-dump-times "offset_type" 0 "final_cleanup"} } */
+// And we should optimized this code to just return 0
+/* { dg-final { scan-tree-dump-times "return 0" 1 "final_cleanup"} } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
+