* tree-ssa-ccp.c (maybe_fold_offset_to_address): Don't check if
COMPONENT_REF t has ARRAY_TYPE.
* gcc.dg/pr39343.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144571
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-03-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/39343
+ * tree-ssa-ccp.c (maybe_fold_offset_to_address): Don't check if
+ COMPONENT_REF t has ARRAY_TYPE.
+
2009-03-02 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/39335
+2009-03-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/39343
+ * gcc.dg/pr39343.c: New test.
+
2009-03-03 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/39248
--- /dev/null
+/* PR tree-optimization/39343 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern void abort (void);
+
+extern inline __attribute__ ((__always_inline__)) int
+foo (char *dest)
+{
+ return __builtin_object_size (dest, 1);
+}
+
+struct S
+{
+ union
+ {
+ struct { int a, b; char c, d; } f;
+ struct { struct { int a, b; char c, d[255]; } e; } g;
+ } u;
+};
+
+int
+main (void)
+{
+ struct S s;
+ if (foo (s.u.g.e.d) != 255)
+ abort ();
+ return 0;
+}
|| (TREE_CODE (orig) == COMPONENT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (orig, 1))) == ARRAY_TYPE))
&& (TREE_CODE (t) == ARRAY_REF
- || (TREE_CODE (t) == COMPONENT_REF
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 1))) == ARRAY_TYPE))
+ || TREE_CODE (t) == COMPONENT_REF)
&& !operand_equal_p (TREE_CODE (orig) == ARRAY_REF
? TREE_OPERAND (orig, 0) : orig,
TREE_CODE (t) == ARRAY_REF