2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/39315
* cfgexpand.c (expand_one_stack_var_at): Change alignment
limit to MAX_SUPPORTED_STACK_ALIGNMENT.
gcc/testsuite/
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/39315
* gcc.target/i386/pr39315-1.c: New.
* gcc.target/i386/pr39315-2.c: Likewise.
* gcc.target/i386/pr39315-3.c: Likewise.
* gcc.target/i386/pr39315-4.c: Likewise.
* gcc.target/i386/pr39315-check.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145138
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/39315
+ * cfgexpand.c (expand_one_stack_var_at): Change alignment
+ limit to MAX_SUPPORTED_STACK_ALIGNMENT.
+
2009-03-27 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39120
static void
expand_one_stack_var_at (tree decl, HOST_WIDE_INT offset)
{
- HOST_WIDE_INT align;
+ /* Alignment is unsigned. */
+ unsigned HOST_WIDE_INT align;
rtx x;
/* If this fails, we've overflowed the stack frame. Error nicely? */
offset -= frame_phase;
align = offset & -offset;
align *= BITS_PER_UNIT;
- if (align > STACK_BOUNDARY || align == 0)
+ if (align == 0)
align = STACK_BOUNDARY;
+ else if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
+ align = MAX_SUPPORTED_STACK_ALIGNMENT;
DECL_ALIGN (decl) = align;
DECL_USER_ALIGN (decl) = 0;
2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
+ PR middle-end/39315
+ * gcc.target/i386/pr39315-1.c: New.
+ * gcc.target/i386/pr39315-2.c: Likewise.
+ * gcc.target/i386/pr39315-3.c: Likewise.
+ * gcc.target/i386/pr39315-4.c: Likewise.
+ * gcc.target/i386/pr39315-check.c: Likewise.
+
+2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
+
PR c/39323
* gcc.dg/pr39323-1.c: New.
* gcc.dg/pr39323-2.c: Likewise.
--- /dev/null
+/* PR middle-end/39315 */
+/* { dg-do compile } */
+/* { dg-options "-O -msse2 -mtune=generic" } */
+/* { dg-final { scan-assembler-not "movups" } } */
+/* { dg-final { scan-assembler-not "movlps" } } */
+/* { dg-final { scan-assembler-not "movhps" } } */
+/* { dg-final { scan-assembler "movaps" } } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16)));
+
+extern void bar (__m128 *);
+
+void
+foo (__m128 *x)
+{
+ __m128 b = *x;
+ bar (&b);
+}
--- /dev/null
+/* PR middle-end/39315 */
+/* { dg-do run } */
+/* { dg-options "-O -msse2 -mtune=generic" } */
+/* { dg-additional-sources pr39315-check.c } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16)));
+
+extern void bar (__m128 *, int);
+
+void
+foo (__m128 *x)
+{
+ __m128 b = *x;
+ bar (&b, __alignof__ (x));
+}
--- /dev/null
+/* PR middle-end/39315 */
+/* { dg-do compile } */
+/* { dg-options "-O -msse2 -mtune=generic" } */
+/* { dg-final { scan-assembler-not "movups" } } */
+/* { dg-final { scan-assembler-not "movlps" } } */
+/* { dg-final { scan-assembler-not "movhps" } } */
+/* { dg-final { scan-assembler "and\[lq\]?\[\\t \]*\\$-128,\[\\t \]*%\[re\]?sp" } } */
+/* { dg-final { scan-assembler "movaps" } } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16)));
+
+extern void bar (__m128 *);
+
+void
+foo (__m128 *x)
+{
+ __m128 b __attribute__ ((aligned(128))) = *x;
+ bar (&b);
+}
--- /dev/null
+/* PR middle-end/39315 */
+/* { dg-do run } */
+/* { dg-options "-O -msse2 -mtune=generic" } */
+/* { dg-additional-sources pr39315-check.c } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16)));
+
+extern void bar (__m128 *, int);
+
+void
+foo (__m128 *x)
+{
+ __m128 b __attribute__ ((aligned(128))) = *x;
+ bar (&b, __alignof__ (x));
+}
--- /dev/null
+typedef float __m128 __attribute__ ((__vector_size__ (16)));
+
+extern void foo (__m128 *);
+extern void abort (void);
+
+__m128 y = { 0.0, 1.0, 2.0, 3.0 };
+
+void
+bar (__m128 *x, int align)
+{
+ if ((((__PTRDIFF_TYPE__) x) & (align - 1)) != 0)
+ abort ();
+ if (__builtin_memcmp (x, &y, sizeof (y)) != 0)
+ abort ();
+}
+
+int
+main ()
+{
+ foo (&y);
+ return 0;
+}