diff mbox series

Add testcase to show kernel issue got fixed by pr95237 [PR96192]

Message ID 20200724210841.3499907-1-skpgkp2@gmail.com
State New
Headers show
Series Add testcase to show kernel issue got fixed by pr95237 [PR96192] | expand

Commit Message

Sunil Pandey July 24, 2020, 9:08 p.m. UTC
This test case, extracted from PR 95645, was failing because alignment
of local long long variable got lowered from 8 bytes to 4 bytes in
adjust alignment pass, which triggered assert failure.

This test case passes now because PR 95237 fix only allows lowering of
alignment of local variables in the front end.  As a result, alignment
of local long long variable no longer gets lowered in adjust alignment
pass.

gcc/testsuite/ChangeLog:

	PR target/96192
	* c-c++-common/pr96192-1.c: New test.
---
 gcc/testsuite/c-c++-common/pr96192-1.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 gcc/testsuite/c-c++-common/pr96192-1.c

Comments

H.J. Lu July 24, 2020, 9:16 p.m. UTC | #1
On Fri, Jul 24, 2020 at 2:08 PM Sunil K Pandey <skpgkp2@gmail.com> wrote:
>
> This test case, extracted from PR 95645, was failing because alignment
> of local long long variable got lowered from 8 bytes to 4 bytes in
> adjust alignment pass, which triggered assert failure.
>
> This test case passes now because PR 95237 fix only allows lowering of
> alignment of local variables in the front end.  As a result, alignment
> of local long long variable no longer gets lowered in adjust alignment
> pass.
>
> gcc/testsuite/ChangeLog:
>
>         PR target/96192
>         * c-c++-common/pr96192-1.c: New test.
> ---
>  gcc/testsuite/c-c++-common/pr96192-1.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>  create mode 100644 gcc/testsuite/c-c++-common/pr96192-1.c
>
> diff --git a/gcc/testsuite/c-c++-common/pr96192-1.c b/gcc/testsuite/c-c++-common/pr96192-1.c
> new file mode 100644
> index 00000000000..4d9be06a045
> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/pr96192-1.c
> @@ -0,0 +1,16 @@
> +/* { dg-do compile { target ia32 } } */
> +/* { dg-options "-mpreferred-stack-boundary=2 -Os -w" } */
> +
> +int a;
> +
> +long long
> +b (void)
> +{
> +}
> +
> +void
> +c (void)
> +{
> +  if (b())
> +    a = 1;
> +}
> --
> 2.25.4
>

I am checking in this patch for Sunil.
diff mbox series

Patch

diff --git a/gcc/testsuite/c-c++-common/pr96192-1.c b/gcc/testsuite/c-c++-common/pr96192-1.c
new file mode 100644
index 00000000000..4d9be06a045
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr96192-1.c
@@ -0,0 +1,16 @@ 
+/* { dg-do compile { target ia32 } } */
+/* { dg-options "-mpreferred-stack-boundary=2 -Os -w" } */
+
+int a;
+
+long long
+b (void)
+{
+}
+
+void
+c (void)
+{
+  if (b())
+    a = 1;
+}