public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51042] New: segfault
@ 2011-11-08 23:01 regehr at cs dot utah.edu
  2011-11-09  9:15 ` [Bug tree-optimization/51042] [4.7 Regression] endless recursion in phi_translate jakub at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: regehr at cs dot utah.edu @ 2011-11-08 23:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

             Bug #: 51042
           Summary: segfault
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: regehr@cs.utah.edu


Valgrind wasn't too helpful in narrowing this down, just says something generic
about a stack overflow.

[regehr@gamow tmp052]$ current-gcc -Ofast -w small.c

current-gcc: internal compiler error: Segmentation fault (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

[regehr@gamow tmp052]$ current-gcc -v

Using built-in specs.
COLLECT_GCC=current-gcc
COLLECT_LTO_WRAPPER=/uusoc/exports/scratch/regehr/z/compiler-install/gcc-r181147-install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --with-libelf=/usr/local --enable-lto
--prefix=/home/regehr/z/compiler-install/gcc-r181147-install
--program-prefix=r181147- --enable-languages=c,c++
Thread model: posix
gcc version 4.7.0 20111108 (experimental) (GCC) 

[regehr@gamow tmp052]$ cat small.c 


int g_10;
int g_97;
int g_144;
int g_237;
int g_264[2][2];

int func_22 (p_25)
{
  for (; p_25;)
    {
      for (g_237 = 0; g_237 <= 1; g_237 = 1)
    if (g_264[g_144][g_10])
      break;
      for (g_97 = 0; g_97 <= 0; g_97 = 1)
    {
      g_264[g_144][g_10] = g_10;
      if (g_10)
        break;
    }
    }
  return 0;
}


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

* [Bug tree-optimization/51042] [4.7 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
@ 2011-11-09  9:15 ` jakub at gcc dot gnu.org
  2011-11-09  9:39 ` [Bug tree-optimization/51042] [4.5/4.6/4.7 " rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-11-09  9:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-09
                 CC|                            |jakub at gcc dot gnu.org
          Component|c                           |tree-optimization
   Target Milestone|---                         |4.7.0
            Summary|segfault                    |[4.7 Regression] endless
                   |                            |recursion in phi_translate
     Ever Confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-09 08:59:47 UTC ---
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155360

int a, b, c, d, e[2][2];

void
foo (int x)
{
  while (x)
    {
      for (d = 0; d <= 1; d = 1)
        if (e[c][a])
          break;
      for (b = 0; b <= 0; b = 1)
        {
          e[c][a] = a;
          if (a)
            break;
        }
    }
}


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

* [Bug tree-optimization/51042] [4.5/4.6/4.7 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
  2011-11-09  9:15 ` [Bug tree-optimization/51042] [4.7 Regression] endless recursion in phi_translate jakub at gcc dot gnu.org
@ 2011-11-09  9:39 ` rguenth at gcc dot gnu.org
  2011-11-09 13:26 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-09  9:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
      Known to work|                            |4.4.6
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|4.7.0                       |4.5.4
            Summary|[4.7 Regression] endless    |[4.5/4.6/4.7 Regression]
                   |recursion in phi_translate  |endless recursion in
                   |                            |phi_translate

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-09 09:22:04 UTC ---
Mine.


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

* [Bug tree-optimization/51042] [4.5/4.6/4.7 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
  2011-11-09  9:15 ` [Bug tree-optimization/51042] [4.7 Regression] endless recursion in phi_translate jakub at gcc dot gnu.org
  2011-11-09  9:39 ` [Bug tree-optimization/51042] [4.5/4.6/4.7 " rguenth at gcc dot gnu.org
@ 2011-11-09 13:26 ` rguenth at gcc dot gnu.org
  2011-11-09 14:43 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-09 13:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-09 13:23:00 UTC ---
Even shorter testcase:

int a, b;

void
foo (int x)
{
  int e[2];
  int d; 
  while (x)
    {
      for (d = 0; d <= 1; d = 1)
        if (e[a])
          break;
      for (b = 0; b <= 0; b = 1)
        {
          e[a] = a;
          if (a)
            break;
        }
    }
}


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

* [Bug tree-optimization/51042] [4.5/4.6/4.7 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (2 preceding siblings ...)
  2011-11-09 13:26 ` rguenth at gcc dot gnu.org
@ 2011-11-09 14:43 ` rguenth at gcc dot gnu.org
  2011-11-10 13:10 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-09 14:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-09 14:33:14 UTC ---
The clean () code does not work properly for memory references it seems.  We
fail to prune expressions that are not available (the tricks we play with
dominance tests for virtual operands are not effective once we translate
them).


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

* [Bug tree-optimization/51042] [4.5/4.6/4.7 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (3 preceding siblings ...)
  2011-11-09 14:43 ` rguenth at gcc dot gnu.org
@ 2011-11-10 13:10 ` rguenth at gcc dot gnu.org
  2011-11-10 15:37 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-10 13:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-10 12:50:51 UTC ---
Of course in principle the issue is that an SSA name can have an expression
leader that references the SSA name itself.


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

* [Bug tree-optimization/51042] [4.5/4.6/4.7 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (4 preceding siblings ...)
  2011-11-10 13:10 ` rguenth at gcc dot gnu.org
@ 2011-11-10 15:37 ` rguenth at gcc dot gnu.org
  2011-11-10 15:54 ` [Bug tree-optimization/51042] [4.5/4.6 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-10 15:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-10 15:29:01 UTC ---
Author: rguenth
Date: Thu Nov 10 15:28:57 2011
New Revision: 181256

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=181256
Log:
2011-11-10  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/51042
    * tree-ssa-pre.c (phi_translate_1): Avoid recursing on
    self-referential expressions.  Refactor code to avoid duplication.

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

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr51042.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-pre.c


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

* [Bug tree-optimization/51042] [4.5/4.6 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (5 preceding siblings ...)
  2011-11-10 15:37 ` rguenth at gcc dot gnu.org
@ 2011-11-10 15:54 ` rguenth at gcc dot gnu.org
  2012-01-03 14:47 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-10 15:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.7.0
            Summary|[4.5/4.6/4.7 Regression]    |[4.5/4.6 Regression]
                   |endless recursion in        |endless recursion in
                   |phi_translate               |phi_translate

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-10 15:29:39 UTC ---
Fixed on trunk sofar.


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

* [Bug tree-optimization/51042] [4.5/4.6 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (6 preceding siblings ...)
  2011-11-10 15:54 ` [Bug tree-optimization/51042] [4.5/4.6 " rguenth at gcc dot gnu.org
@ 2012-01-03 14:47 ` rguenth at gcc dot gnu.org
  2012-06-12  9:54 ` [Bug tree-optimization/51042] [4.5 " liujiangning at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-03 14:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-03 14:46:08 UTC ---
Author: rguenth
Date: Tue Jan  3 14:46:03 2012
New Revision: 182848

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182848
Log:
2012-01-03  Richard Guenther  <rguenther@suse.de>

    Backport from mainline
    2011-11-10  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/51042
    * tree-ssa-pre.c (phi_translate_1): Avoid recursing on
    self-referential expressions.  Refactor code to avoid duplication.

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

Added:
    branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/torture/pr51042.c
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_6-branch/gcc/tree-ssa-pre.c


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

* [Bug tree-optimization/51042] [4.5 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (7 preceding siblings ...)
  2012-01-03 14:47 ` rguenth at gcc dot gnu.org
@ 2012-06-12  9:54 ` liujiangning at gcc dot gnu.org
  2012-06-20 13:08 ` rguenth at gcc dot gnu.org
  2012-07-02 10:16 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: liujiangning at gcc dot gnu.org @ 2012-06-12  9:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

--- Comment #9 from Jiangning Liu <liujiangning at gcc dot gnu.org> 2012-06-12 09:53:57 UTC ---
Author: liujiangning
Date: Tue Jun 12 09:53:53 2012
New Revision: 188433

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188433
Log:
2011-06-12  Jiangning Liu  <jiangning.liu@arm.com>                              

    Backport r181256 from mainline
    2011-11-10  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/51042
    * tree-ssa-pre.c (phi_translate_1): Avoid recursing on
    self-referential expressions.  Refactor code to avoid duplication.

2011-06-12  Jiangning Liu  <jiangning.liu@arm.com>                              

    Backport r181256 from mainline
    2011-11-10  Richard Guenther  <rguenther@suse.de>


Added:
    branches/ARM/embedded-4_6-branch/gcc/testsuite/gcc.dg/torture/pr51042.c
Modified:
    branches/ARM/embedded-4_6-branch/gcc/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/testsuite/ChangeLog.arm
    branches/ARM/embedded-4_6-branch/gcc/tree-ssa-pre.c


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

* [Bug tree-optimization/51042] [4.5 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (8 preceding siblings ...)
  2012-06-12  9:54 ` [Bug tree-optimization/51042] [4.5 " liujiangning at gcc dot gnu.org
@ 2012-06-20 13:08 ` rguenth at gcc dot gnu.org
  2012-07-02 10:16 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-20 13:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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

* [Bug tree-optimization/51042] [4.5 Regression] endless recursion in phi_translate
  2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
                   ` (9 preceding siblings ...)
  2012-06-20 13:08 ` rguenth at gcc dot gnu.org
@ 2012-07-02 10:16 ` rguenth at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 10:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51042

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.5.4                       |4.6.3

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 10:16:20 UTC ---
Fixed in 4.6.3.


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

end of thread, other threads:[~2012-07-02 10:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08 23:01 [Bug c/51042] New: segfault regehr at cs dot utah.edu
2011-11-09  9:15 ` [Bug tree-optimization/51042] [4.7 Regression] endless recursion in phi_translate jakub at gcc dot gnu.org
2011-11-09  9:39 ` [Bug tree-optimization/51042] [4.5/4.6/4.7 " rguenth at gcc dot gnu.org
2011-11-09 13:26 ` rguenth at gcc dot gnu.org
2011-11-09 14:43 ` rguenth at gcc dot gnu.org
2011-11-10 13:10 ` rguenth at gcc dot gnu.org
2011-11-10 15:37 ` rguenth at gcc dot gnu.org
2011-11-10 15:54 ` [Bug tree-optimization/51042] [4.5/4.6 " rguenth at gcc dot gnu.org
2012-01-03 14:47 ` rguenth at gcc dot gnu.org
2012-06-12  9:54 ` [Bug tree-optimization/51042] [4.5 " liujiangning at gcc dot gnu.org
2012-06-20 13:08 ` rguenth at gcc dot gnu.org
2012-07-02 10:16 ` 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).