Skip to content

Commit bf0aa9d

Browse files
committed
x86: Add tests for PR tree-optimization/82142
Verify that PR tree-optimization/82142 testcase is properly optimized. PR tree-optimization/82142 * gcc.target/i386/pr82142a.c: New file. * gcc.target/i386/pr82142b.c: Likewise. Signed-off-by: H.J. Lu <[email protected]>
1 parent 4cc54ed commit bf0aa9d

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* { dg-do compile { target { ! ia32 } } } */
2+
/* { dg-options "-O2 -mno-avx -msse2" } */
3+
/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
4+
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
5+
6+
/*
7+
**assignzero:
8+
**.LFB0:
9+
** .cfi_startproc
10+
** pxor %xmm0, %xmm0
11+
** movups %xmm0, 32\(%(?:r|e)di\)
12+
** movups %xmm0, \(%(?:r|e)di\)
13+
** movups %xmm0, 16\(%(?:r|e)di\)
14+
** movups %xmm0, 44\(%(?:r|e)di\)
15+
** ret
16+
**...
17+
*/
18+
19+
typedef struct
20+
{
21+
int a, b, c;
22+
char j, k, k1;
23+
int l, m, n[8];
24+
char c1, c2;
25+
} foo;
26+
27+
void
28+
assignzero (foo *p)
29+
{
30+
foo tmp = {};
31+
*p = tmp;
32+
}
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* { dg-do compile { target ia32 } } */
2+
/* { dg-options "-O2 -mno-avx -msse2" } */
3+
/* Keep labels and directives ('.cfi_startproc', '.cfi_endproc'). */
4+
/* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } } */
5+
6+
/*
7+
**assignzero:
8+
**.LFB0:
9+
** .cfi_startproc
10+
** movl 4\(%esp\), %eax
11+
** pxor %xmm0, %xmm0
12+
** movups %xmm0, 32\(%eax\)
13+
** movups %xmm0, \(%eax\)
14+
** movups %xmm0, 16\(%eax\)
15+
** movups %xmm0, 44\(%eax\)
16+
** ret
17+
**...
18+
*/
19+
20+
#include "pr82142a.c"

0 commit comments

Comments
 (0)