[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-17 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

Ilya Enkovich  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #23 from Ilya Enkovich  ---
Fixed

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-17 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #22 from Ilya Enkovich  ---
Author: ienkovich
Date: Tue May 17 09:28:15 2016
New Revision: 236315

URL: https://gcc.gnu.org/viewcvs?rev=236315=gcc=rev
Log:
gcc/

PR target/71114
* config/i386/i386.c (dimode_scalar_chain::convert_op): Fix
insertion point for instructions generated by validize_mem.

gcc/testsuite/

PR target/71114
* gcc.target/i386/pr70799-1.c: Fix scan for Darwin.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/i386/pr70799-1.c

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-17 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-17 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #21 from Dominique d'Humieres  ---
> Probably just scan for movdqa then to get rid of addressing dependencies?  Or 
> use 
>
> movdqa[ t]+.?LC0
>
> pattern if it works fine on Darwin.

The failure is indeed fixed with the following patch

--- ../_clean/gcc/testsuite/gcc.target/i386/pr70799-1.c 2016-05-10
18:46:37.0 +0200
+++ gcc/testsuite/gcc.target/i386/pr70799-1.c   2016-05-17 10:25:19.0
+0200
@@ -3,7 +3,7 @@
 /* { dg-options "-O2 -march=slm" } */
 /* { dg-final { scan-assembler "pxor" } } */
 /* { dg-final { scan-assembler "pcmpeqd" } } */
-/* { dg-final { scan-assembler "movdqa\[ \\t\]+.LC0" } } */
+/* { dg-final { scan-assembler "movdqa\[ \\t\]+.?LC0" } } */

 long long a, b, c;

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-17 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #20 from Ilya Enkovich  ---
(In reply to Dominique d'Humieres from comment #18)
> > smoke test passes, I'll leave it to Dominique's full-run to confirm.
> 
> With the patch in comment 15 applied on top of revision r236286 the reported
> failures are gone.
> 
> From the fix, would it be possible to derive a test failing on linux?

On Linux local objects are accessed in another way and additional instructions
are not required.

> 
> Also the test gcc.target/i386/pr70799-1.c fails
> 
> FAIL: gcc.target/i386/pr70799-1.c scan-assembler movdqa[ t]+.LC0
> 
> In the assembly I see
> 
>   movdqa  LC0-L3$pb(%eax), %xmm0
> 
> with nothing between \t and L.

Probably just scan for movdqa then to get rid of addressing dependencies?  Or
use 

movdqa[ t]+.?LC0

pattern if it works fine on Darwin.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-17 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #19 from Dominique d'Humieres  ---
Results at https://gcc.gnu.org/ml/gcc-testresults/2016-05/msg01774.html.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #18 from Dominique d'Humieres  ---
> smoke test passes, I'll leave it to Dominique's full-run to confirm.

With the patch in comment 15 applied on top of revision r236286 the reported
failures are gone.

From the fix, would it be possible to derive a test failing on linux?

Also the test gcc.target/i386/pr70799-1.c fails

FAIL: gcc.target/i386/pr70799-1.c scan-assembler movdqa[ t]+.LC0

In the assembly I see

movdqa  LC0-L3$pb(%eax), %xmm0

with nothing between \t and L.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #17 from Iain Sandoe  ---
smoke test passes, I'll leave it to Dominique's full-run to confirm.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #16 from Ilya Enkovich  ---
(In reply to Iain Sandoe from comment #15)
> that code won't build - did you mean :
> 

Sure.  Thanks for noticing!

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #15 from Iain Sandoe  ---
(In reply to Dominique d'Humieres from comment #14)
> > Looks I found the problem.  validize_mem generates new instructions which
> > are placed wrongly.  This patch should help.  Unfortunately I can't test
> > it properly on Darwin.
> 
> Thanks for the feedback. I just started a clean regstrap, allow for ~6h+.

that code won't build - did you mean :

   if (!standard_sse_constant_p (vec_cst, V2DImode))
-   vec_cst = validize_mem (force_const_mem (V2DImode, vec_cst));
+   {
+ start_sequence ();
+ vec_cst = validize_mem (force_const_mem (V2DImode, vec_cst));
+ rtx_insn *seq = get_insns ();
+ end_sequence ();
+ emit_insn_before (seq, insn);
+   }

?

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #14 from Dominique d'Humieres  ---
> Looks I found the problem.  validize_mem generates new instructions which
> are placed wrongly.  This patch should help.  Unfortunately I can't test
> it properly on Darwin.

Thanks for the feedback. I just started a clean regstrap, allow for ~6h+.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #13 from Ilya Enkovich  ---
Looks I found the problem.  validize_mem generates new instructions which are
placed wrongly.  This patch should help.  Unfortunately I can't test it
properly on Darwin.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 046717b..5fdd12b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3688,7 +3688,13 @@ dimode_scalar_chain::convert_op (rtx *op, rtx_insn
*insn)
gen_rtvec (2, *op, const0_rtx));

   if (!standard_sse_constant_p (vec_cst, V2DImode))
-   vec_cst = validize_mem (force_const_mem (V2DImode, vec_cst));
+   {
+ start_sequence ();
+ vec_cst = validize_mem (force_const_mem (V2DImode, vec_cst));
+ rtx_insn *seq = get_insns ();
+ end_sequence ();
+ emit_insn_before (insns, insn)
+   }

   emit_insn_before (gen_move_insn (tmp, vec_cst), insn);
   *op = tmp;

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #12 from Iain Sandoe  ---
(In reply to Iain Sandoe from comment #11)
> I wonder if it's a stack/data alignment problem

maybe not;
comparing 6.1 and trunk with the function annotated to
__attribute__((noinline)) it seems that the problem is introduced before the
inlining; and it looks, as you say, to be related to the load of the constant
value equivalent to data[0].

For 6.1 since the function is static the constant load is moved into
variable_shift() and the value of i is passed in eax.

This all shows up in a Linux X x86_64-apple-darwin10 configured like:

../gcc-mainline/configure --prefix=/somewhere --target=x86_64-apple-darwin10
--host=x86_64-linux-gnu --build=x86_64-linux-gnu --enable-languages=c
--enable-targets=all

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #11 from Iain Sandoe  ---
I wonder if it's a stack/data alignment problem

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #10 from Iain Sandoe  ---
(In reply to Ilya Enkovich from comment #9)
> (In reply to Iain Sandoe from comment #8)
> > Created attachment 38495 [details]
> > assembly for linux case
> > 
> > Here's the asm for the case from my build, although I don't expect it'll
> > help much if you can't reproduce it.
> 
> But I can build and run this asm with no problem.  What's wrong with it then?

not sure, I'll see if I can analyse more.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #9 from Ilya Enkovich  ---
(In reply to Iain Sandoe from comment #8)
> Created attachment 38495 [details]
> assembly for linux case
> 
> Here's the asm for the case from my build, although I don't expect it'll
> help much if you can't reproduce it.

But I can build and run this asm with no problem.  What's wrong with it then?

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #8 from Iain Sandoe  ---
Created attachment 38495
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38495=edit
assembly for linux case

Here's the asm for the case from my build, although I don't expect it'll help
much if you can't reproduce it.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #7 from Ilya Enkovich  ---
(In reply to Dominique d'Humieres from comment #2)
> Created attachment 38486 [details]
> Assembly for gcc.c-torture/execute/ashldi-1.c compiled with r236090
> 
> Assembly for gcc.c-torture/execute/ashldi-1.c compiled with r236090 and -Os
> -m32.

This part looks wrong:

movd%xmm1, %edi
movaps  (%edi), %xmm0

Most probably it is an attempt to load a constant.  Unfortunately I still don't
have a way to reproduce it.  Will try more.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread ienkovich at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #6 from Ilya Enkovich  ---
(In reply to Iain Sandoe from comment #5)
> Also fails on Linux for the m32 multilib with -msse2avx :
>  make -k check-gcc-c
> RUNTESTFLAGS="--target_board=unix/-msse/-msse2avx\{-m32,-m64\}
> execute.exp=ashldi-1.c"

Can't reproduce the problem on Linux (using r236170)

=== gcc Summary for unix/-msse/-msse2avx/-m32 ===

# of expected passes16
Running target unix/-msse/-msse2avx/-m64

=== gcc Summary for unix/-msse/-msse2avx/-m64 ===

# of expected passes16

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-16 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

Iain Sandoe  changed:

   What|Removed |Added

 Target|x86_64-apple-darwin*|x86_64-apple-darwin*,x86_64
   ||-pc-linux-gnu
   Host|x86_64-apple-darwin*|x86_64-apple-darwin*,x86_64
   ||-pc-linux-gnu
  Build|x86_64-apple-darwin*|x86_64-apple-darwin*,x86_64
   ||-pc-linux-gnu

--- Comment #5 from Iain Sandoe  ---
Also fails on Linux for the m32 multilib with -msse2avx :
 make -k check-gcc-c
RUNTESTFLAGS="--target_board=unix/-msse/-msse2avx\{-m32,-m64\}
execute.exp=ashldi-1.c"

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #4 from Dominique d'Humieres  ---
Reduced test

#include 

extern void abort(void);
extern void exit(int);

#define BITS 8

static unsigned long long const data[8] = {
  0x123456789abcdefULL,
  0x2468acf13579bdeULL,
  0x48d159e26af37bcULL,
  0x91a2b3c4d5e6f78ULL,
  0x123456789abcdef0ULL,
  0x2468acf13579bde0ULL,
  0x48d159e26af37bc0ULL,
  0x91a2b3c4d5e6f780ULL
};

static unsigned long long
variable_shift(unsigned long long x, int i)
{
  return x << i;
}

int
main()
{
  int i;

  for (i = 0; i < BITS; ++i)
{
  unsigned long long y = variable_shift (data[0], i);
  if (y != data[i])
abort ();
}

  exit (0);
}

It succeeds if I replace '#define BITS 8' with '#define BITS 7'.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

Dominique d'Humieres  changed:

   What|Removed |Added

 CC||ienkovich at gcc dot gnu.org

--- Comment #3 from Dominique d'Humieres  ---
Also seen on x86_64-apple-darwin10 (see
https://gcc.gnu.org/ml/gcc-testresults/2016-05/msg01499.html).

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-14 Thread iains at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

Iain Sandoe  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2016-05-14
 CC||iains at gcc dot gnu.org
 Ever confirmed|0   |1

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #2 from Dominique d'Humieres  ---
Created attachment 38486
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38486=edit
Assembly for gcc.c-torture/execute/ashldi-1.c compiled with r236090

Assembly for gcc.c-torture/execute/ashldi-1.c compiled with r236090 and -Os
-m32.

[Bug target/71114] [7 Regression] Several test suite failures on x86_64-apple-darwin* after revision r236090

2016-05-14 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114

--- Comment #1 from Dominique d'Humieres  ---
Created attachment 38485
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38485=edit
Assembly for gcc.c-torture/execute/ashldi-1.c for r236089

Assembly for gcc.c-torture/execute/ashldi-1.c compiled with r236089 and -Os
-m32.