public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu
@ 2014-06-09  0:50 su at cs dot ucdavis.edu
  2014-06-10 11:15 ` [Bug tree-optimization/61452] [4.8/4.9/4.10 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: su at cs dot ucdavis.edu @ 2014-06-09  0:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61452

            Bug ID: 61452
           Summary: hang at -O1 and -Os on x86_64-linux-gnu
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The following (valid) code causes gcc trunk (as well gcc 4.8 and 4.9) to hang
at -O1 and -Os (but not at -O0, -O2, and -O3). 

This is a regression from 4.7.x. 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 4.10.0 20140608 (experimental) [trunk revision 211353] (GCC) 
$ 
$ gcc-trunk -O0 small.c; a.out
$ gcc-trunk -O2 small.c; a.out
$ gcc-4.7.3 -O1 small.c; a.out
$ gcc-4.7.3 -Os small.c; a.out
$ 
$ timeout -s 9 30 gcc-trunk -O1 small.c
Killed
$ 


----------------------------


int a, b;
short c, d;
char e, f;

int
fn1 (int p1, char p2)
{
  return p1 || p2 ? 0 : p2;
}

void
fn2 ()
{
  for (; a;)
    {
      int g;
      g = c = e;
      for (; a;)
    b = fn1 (g = d = e, g);
      f = g; 
    }
}

int
main ()
{
  fn2 (); 
  return 0;
}


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61452] [4.8/4.9/4.10 Regression] hang at -O1 and -Os on x86_64-linux-gnu
  2014-06-09  0:50 [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2014-06-10 11:15 ` rguenth at gcc dot gnu.org
  2014-06-11 11:17 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-10 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61452

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Setting value number of f.7_12 to f.7_21 (changed)
Setting value number of g_18 to g_10 (changed)
Setting value number of f.7_12 to e.1_6 (changed)
Setting value number of g_18 to _13 (changed)
Setting value number of f.7_12 to f.7_21 (changed)
Setting value number of g_18 to g_10 (changed)
Setting value number of f.7_12 to e.1_6 (changed)
Setting value number of g_18 to _13 (changed)
Setting value number of f.7_12 to f.7_21 (changed)
Setting value number of g_18 to g_10 (changed)
Setting value number of f.7_12 to e.1_6 (changed)
Setting value number of g_18 to _13 (changed)
Setting value number of f.7_12 to f.7_21 (changed)
Setting value number of g_18 to g_10 (changed)
Setting value number of f.7_12 to e.1_6 (changed)
Setting value number of g_18 to _13 (changed)
...

e.1_6 is a "better" leader for f.7_12.

Ok, one reason is that even though we don't change the lattice value
of the PHI g_1 = PHI <g_10, g_18> from g_1 (varying) to g_10 in the
7th (for example) iteration we _do_ adjust its ->expr and thus simplify
expressions differently.  That's of course a no-no, if the lattice
value doesn't change it may really not change.

The whole dance visit_phi does with trying to set ->expr and ->has_constants
when it figured out a leader is pointless anyway - those are only relevant
for VARYINGs (in which case they are bogus).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61452] [4.8/4.9/4.10 Regression] hang at -O1 and -Os on x86_64-linux-gnu
  2014-06-09  0:50 [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-06-10 11:15 ` [Bug tree-optimization/61452] [4.8/4.9/4.10 Regression] " rguenth at gcc dot gnu.org
@ 2014-06-11 11:17 ` rguenth at gcc dot gnu.org
  2014-06-11 11:18 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-11 11:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61452

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Jun 11 11:17:21 2014
New Revision: 211450

URL: http://gcc.gnu.org/viewcvs?rev=211450&root=gcc&view=rev
Log:
2014-06-11  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/61452
    * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
    expr and has_constants in case we found a leader.
    (simplify_binary_expression): Always valueize operands first.
    (simplify_unary_expression): Likewise.

    * gcc.dg/torture/pr61452.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr61452.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-sccvn.c


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61452] [4.8/4.9/4.10 Regression] hang at -O1 and -Os on x86_64-linux-gnu
  2014-06-09  0:50 [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu su at cs dot ucdavis.edu
  2014-06-10 11:15 ` [Bug tree-optimization/61452] [4.8/4.9/4.10 Regression] " rguenth at gcc dot gnu.org
  2014-06-11 11:17 ` rguenth at gcc dot gnu.org
@ 2014-06-11 11:18 ` rguenth at gcc dot gnu.org
  2014-06-11 11:19 ` [Bug tree-optimization/61452] [4.8 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-11 11:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61452

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Jun 11 11:18:14 2014
New Revision: 211451

URL: http://gcc.gnu.org/viewcvs?rev=211451&root=gcc&view=rev
Log:
2014-06-11  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/61452
    * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
    expr and has_constants in case we found a leader.
    (simplify_binary_expression): Always valueize operands first.
    (simplify_unary_expression): Likewise.

    * gcc.dg/torture/pr61452.c: New testcase.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr61452.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/tree-ssa-sccvn.c


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61452] [4.8 Regression] hang at -O1 and -Os on x86_64-linux-gnu
  2014-06-09  0:50 [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2014-06-11 11:18 ` rguenth at gcc dot gnu.org
@ 2014-06-11 11:19 ` rguenth at gcc dot gnu.org
  2014-09-09 14:46 ` rguenth at gcc dot gnu.org
  2014-09-09 14:46 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-11 11:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61452

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.10.0, 4.9.1
            Summary|[4.8/4.9/4.10 Regression]   |[4.8 Regression] hang at
                   |hang at -O1 and -Os on      |-O1 and -Os on
                   |x86_64-linux-gnu            |x86_64-linux-gnu
      Known to fail|                            |4.8.3, 4.9.0

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk/4.9 sofar.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61452] [4.8 Regression] hang at -O1 and -Os on x86_64-linux-gnu
  2014-06-09  0:50 [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (3 preceding siblings ...)
  2014-06-11 11:19 ` [Bug tree-optimization/61452] [4.8 " rguenth at gcc dot gnu.org
@ 2014-09-09 14:46 ` rguenth at gcc dot gnu.org
  2014-09-09 14:46 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-09-09 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61452

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Sep  9 14:45:57 2014
New Revision: 215081

URL: https://gcc.gnu.org/viewcvs?rev=215081&root=gcc&view=rev
Log:
2014-09-09  Richard Biener  <rguenther@suse.de>

    Backport from mainline
    2014-06-11  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/61452
    * tree-ssa-sccvn.c (visit_phi): Remove pointless setting of
    expr and has_constants in case we found a leader.
    (simplify_binary_expression): Always valueize operands first.
    (simplify_unary_expression): Likewise.

    * gcc.dg/torture/pr61452.c: New testcase.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/torture/pr61452.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_8-branch/gcc/tree-ssa-sccvn.c


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/61452] [4.8 Regression] hang at -O1 and -Os on x86_64-linux-gnu
  2014-06-09  0:50 [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (4 preceding siblings ...)
  2014-09-09 14:46 ` rguenth at gcc dot gnu.org
@ 2014-09-09 14:46 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-09-09 14:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61452

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|4.10.0                      |4.8.4, 5.0
         Resolution|---                         |FIXED

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-09 14:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09  0:50 [Bug tree-optimization/61452] New: hang at -O1 and -Os on x86_64-linux-gnu su at cs dot ucdavis.edu
2014-06-10 11:15 ` [Bug tree-optimization/61452] [4.8/4.9/4.10 Regression] " rguenth at gcc dot gnu.org
2014-06-11 11:17 ` rguenth at gcc dot gnu.org
2014-06-11 11:18 ` rguenth at gcc dot gnu.org
2014-06-11 11:19 ` [Bug tree-optimization/61452] [4.8 " rguenth at gcc dot gnu.org
2014-09-09 14:46 ` rguenth at gcc dot gnu.org
2014-09-09 14:46 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).