gcc/
2008-02-18 Joey Ye <joey.ye@intel.com>
PR middle-end/34921
* tree-nested.c (insert_field_into_struct): Set type alignment
to field alignment if the former is less than the latter.
gcc/testsuite/
2008-02-18 Joey Ye <joey.ye@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/34921
* gcc.c-torture/execute/nest-align-1.c: New test case.
Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com>
From-SVN: r132396
+2008-02-18 Joey Ye <joey.ye@intel.com>
+
+ PR middle-end/34921
+ * tree-nested.c (insert_field_into_struct): Set type alignment
+ to field alignment if the former is less than the latter.
+
2008-02-18 Jakub Jelinek <jakub@redhat.com>
* BASE-VER: Set to 4.4.0.
+2008-02-18 Joey Ye <joey.ye@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/34921
+ * gcc.c-torture/execute/nest-align-1.c: New test case.
+
2008-02-17 Richard Guenther <rguenther@suse.de>
PR middle-end/35227
--- /dev/null
+/* Test for alignment handling when a variable is accessed by nested
+ function. */
+/* Origin: Joey Ye <joey.ye@intel.com> */
+
+#include <stddef.h>
+
+typedef int aligned __attribute__((aligned(16)));
+extern void abort (void);
+
+void
+check (int *i)
+{
+ *i = 20;
+ if ((((ptrdiff_t) i) & (__alignof__(aligned) - 1)) != 0)
+ abort ();
+}
+
+void
+foo (void)
+{
+ aligned jj;
+ void bar ()
+ {
+ jj = -20;
+ }
+ jj = 0;
+ bar ();
+ if (jj != -20)
+ abort ();
+ check (&jj);
+ if (jj != 20)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
TREE_CHAIN (field) = *p;
*p = field;
+
+ /* Set correct alignment for frame struct type. */
+ if (TYPE_ALIGN (type) < DECL_ALIGN (field))
+ TYPE_ALIGN (type) = DECL_ALIGN (field);
}
/* Build or return the RECORD_TYPE that describes the frame state that is