gcc/testsuite/ChangeLog:
* gcc.target/i386/attr-aligned-2.c: New test.
* gcc.target/i386/falign-functions-3.c: New test.
From-SVN: r266795
+2018-12-04 Martin Sebor <msebor@redhat.com>
+
+ * gcc.target/i386/attr-aligned-2.c: New test.
+ * gcc.target/i386/falign-functions-3.c: New test.
+
2018-12-04 Jakub Jelinek <jakub@redhat.com>
PR target/88188
--- /dev/null
+/* Verify that valid alignment on either a function declaration
+ or a definition has the expected effect and overrides -Os.
+ { dg-do compile }
+ { dg-options "-Os" } */
+
+#define ALIGN(n) __attribute__ ((aligned (n)))
+
+/* No alignment specified (to cause the subsequent instruction
+ to be at an odd boundary due to -Os). */
+void f (void) { }
+
+void f4 (void);
+
+ALIGN (4)
+void f4 (void) { }
+
+/* { dg-final { scan-assembler ".align 4\n\t.globl\tf4" } } */
+
+
+void g (void) { }
+
+
+ALIGN (4)
+void g4 (void);
+
+void g4 (void) { }
--- /dev/null
+/* Verify that attribute aligned overrides the effect of -falign-functions.
+ (But see PR 88345 showing that -Os overrides -falign-functions.)
+ The test may need to be adjusted if/when GCC implements PR 88231.
+ { dg-do compile }
+ { dg-options "-O2 -falign-functions=32" } */
+
+#define ALIGN(n) __attribute__ ((aligned (n)))
+
+ALIGN (4)
+void f4 (void) { }
+
+/* { dg-final { scan-assembler ".align 4\n\t.globl\tf4" } } */
+
+
+void f32 (void) { }
+
+/* { dg-final { scan-assembler ".p2align 5\n\t.globl\tf32" } } */
+
+
+ALIGN (64)
+void f64 (void) { }
+
+/* { dg-final { scan-assembler ".align 64\n\t.globl\tf64" } } */