[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-03-10 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #13 from Bernd Schmidt  ---
Author: bernds
Date: Fri Mar 10 21:17:13 2017
New Revision: 246059

URL: https://gcc.gnu.org/viewcvs?rev=246059=gcc=rev
Log:
PR rtl-optimization/78911
* lra-assigns.c (must_not_spill_p): New function.
(spill_for): Use it.

PR rtl-optimization/78911
* gcc.target/i386/pr78911-1.c: New test.
* gcc.target/i386/pr78911-2.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr78911-1.c
trunk/gcc/testsuite/gcc.target/i386/pr78911-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/lra-assigns.c
trunk/gcc/testsuite/ChangeLog

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-03-01 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #12 from Jakub Jelinek  ---
Testcase for likely the same bug, at least hang starts at r221983.

-fPIC -O2 -m32 -march=i686 -fno-omit-frame-pointer rh1406093.i

long long *a, *b, c;
int d, e;
int baz (void);

static inline long long
foo (long long *x)
{
  return __sync_val_compare_and_swap (x, 0, 0);
}

void
bar ()
{
  int f = baz ();
  c = foo ([f]);
  if (c)
e = d;
  a = b;
}

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-03-01 Thread bernds at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

Bernd Schmidt  changed:

   What|Removed |Added

 CC||bernds at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |bernds at gcc dot 
gnu.org

--- Comment #11 from Bernd Schmidt  ---
Investigating (but not entirely sure yet I'm getting somewhere).

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-01-07 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #10 from Uroš Bizjak  ---
(In reply to Jakub Jelinek from comment #9)
> At least for me it hangs already in that r216281:

I don't have PR at hand, but pLease note that there were some problems with
this pattern in the past, fixed in the RA in the meantime. With pseudo-PIC,
there is enough registers available for RA, even with allocated frame-pointer.

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-01-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #9 from Jakub Jelinek  ---
At least for me it hangs already in that r216281:
timeout 20 /opt/notnfs/gcc-bisect/obj/gcc/cc1.216281 -quiet -O3
-march=pentium-m -m32 -fPIC -fno-strict-aliasing -fno-omit-frame-pointer
pr78911.c; echo $?
124
-bash-4.3$ timeout 20 /opt/notnfs/gcc-bisect/obj/gcc/cc1.216280 -quiet -O3
-march=pentium-m -m32 -fPIC -fno-strict-aliasing -fno-omit-frame-pointer
pr78911.c; echo $?
0
(the latter is instant, fraction of a second).

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-01-06 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #8 from Uroš Bizjak  ---
(In reply to Martin Liška from comment #6)
> Created attachment 40409 [details]
> head -n70 tc.i.274r.reload
> 
> So the problem is older than r221983.

Why do you think so? Reverting r221983 one-liner, introduced in PR65710 as a
performance fix for earlier patch, allows me to compile the testcase.

(In reply to Jakub Jelinek from comment #7)

> Started hanging with r216281.

Referred commit allowed atomic_compare_and_swapdi_doubleword pattern to
directly use %ebx, which was not allowed before pseudo PIC reg was introduced.
Mentioned pattern pushes i686 register pressure to the limit, it is somehow
problematic for RA to handle, but RA managed to do correct reg allocation up to
r221983.

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-01-06 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||uros at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
Slightly cleaned up testcase:

/* PR rtl-optimization/78911 */
/* { dg-do compile } */
/* { dg-options "-O3 -fPIC -fno-strict-aliasing -fno-omit-frame-pointer" } */
/* { dg-additional-options "-fPIC" { target fpic } } */
/* { dg-additional-options "-march=pentium-m" { target ia32 } } */

int a, b, d, e;
long long *c;

static int
foo (long long *x)
{
  return __sync_val_compare_and_swap (x, b, a);
}

void
bar (void)
{
  if (!c)
return;
  e = foo ([d]);
}

Started hanging with r216281.

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2017-01-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

Richard Biener  changed:

   What|Removed |Added

   Keywords||ra
   Priority|P3  |P2
   Target Milestone|--- |5.5

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2016-12-23 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #6 from Martin Liška  ---
Created attachment 40409
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40409=edit
head -n70 tc.i.274r.reload

So the problem is older than r221983.

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2016-12-23 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #5 from Markus Trippelsdorf  ---
(In reply to Martin Liška from comment #4)
> Can you see it also on trunk?

Yes, but only with -O3.

[Bug rtl-optimization/78911] [5/6/7 Regression] Infinite loop at -O2/O3 optimization levels while trying to compile server.c from Wine-2.0-rc2

2016-12-23 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78911

--- Comment #4 from Martin Liška  ---
The mentioned revision is probably not probably the culprit.
Reduced test-case:

$ cat tc.i
a, b, d, e;
*c;
static interlocked_cmpxchg64 (long long *p1)
{
  __sync_val_compare_and_swap (p1, b, a);
}
get_cached_fd ()
{
  if (!c)
return;
  e = interlocked_cmpxchg64 ([d]);
}

$ timeout 10 gcc -O3 -march=pentium-m -m32 -c  -fPIC -Wall  
-fno-strict-aliasing -fno-omit-frame-pointer tc.i
[triggers time-out]

Can you see it also on trunk?