+2016-02-06 Richard Henderson <rth@redhat.com>
+
+ PR c/69643
+ * tree.c (tree_nop_conversion_p): Do not strip casts into or
+ out of non-standard address spaces.
+
2016-02-05 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/69691
+2016-02-06 Richard HEnderson <rth@redhat.com>
+
+ PR c/69643
+ * gcc.target/i386/addr-space-4.c: New.
+ * gcc.target/i386/addr-space-5.c: New.
+
2016-02-05 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/66089
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler "gs:" } } */
+
+#define uintptr_t __SIZE_TYPE__
+
+struct S { int a, b, c; };
+
+extern struct S __seg_gs s;
+
+int foo (void)
+{
+ int r;
+ r = s.c;
+ return r;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+/* { dg-final { scan-assembler "gs:" } } */
+
+#define uintptr_t __SIZE_TYPE__
+
+struct S { int a, b, c; };
+
+extern struct S s;
+
+int ct_state3 (void)
+{
+ int r;
+ r = *((int __seg_gs *) (uintptr_t) &s.c);
+ return r;
+}
bool
tree_nop_conversion_p (const_tree outer_type, const_tree inner_type)
{
+ /* Do not strip casts into or out of differing address spaces. */
+ if (POINTER_TYPE_P (outer_type)
+ && TYPE_ADDR_SPACE (TREE_TYPE (outer_type)) != ADDR_SPACE_GENERIC)
+ {
+ if (!POINTER_TYPE_P (inner_type)
+ || (TYPE_ADDR_SPACE (TREE_TYPE (outer_type))
+ != TYPE_ADDR_SPACE (TREE_TYPE (inner_type))))
+ return false;
+ }
+ else if (POINTER_TYPE_P (inner_type)
+ && TYPE_ADDR_SPACE (TREE_TYPE (inner_type)) != ADDR_SPACE_GENERIC)
+ {
+ /* We already know that outer_type is not a pointer with
+ a non-generic address space. */
+ return false;
+ }
+
/* Use precision rather then machine mode when we can, which gives
the correct answer even for submode (bit-field) types. */
if ((INTEGRAL_TYPE_P (outer_type)