public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56150] New: ICE segfault in do_pre / tail_merge_optimize
@ 2013-01-30 14:44 francesco.zappa.nardelli at gmail dot com
  2013-01-30 14:45 ` [Bug tree-optimization/56150] " francesco.zappa.nardelli at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: francesco.zappa.nardelli at gmail dot com @ 2013-01-30 14:44 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56150
           Summary: ICE segfault in do_pre / tail_merge_optimize
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: francesco.zappa.nardelli@gmail.com


The program below makes 

  gcc version 4.8.0 20130130 (experimental) (GCC)

crash (ICE) at optimisation level -O2 and -O3:

$ gcc -O2 5-min.c
5-min.c: In function ‘func_1’:
5-min.c:9:6: internal compiler error: Segmentation fault
 void func_1 () {
      ^
0x8e59af crash_signal
    ../../gcc-svn-src/gcc/toplev.c:332
0xa434a7 vn_valueize
    ../../gcc-svn-src/gcc/tree-ssa-sccvn.h:226
0xa434a7 gimple_equal_p
    ../../gcc-svn-src/gcc/tree-ssa-tail-merge.c:1124
0xa434a7 find_duplicate
    ../../gcc-svn-src/gcc/tree-ssa-tail-merge.c:1214
0xa434a7 find_clusters_1
    ../../gcc-svn-src/gcc/tree-ssa-tail-merge.c:1409
0xa434a7 find_clusters
    ../../gcc-svn-src/gcc/tree-ssa-tail-merge.c:1430
0xa455ec tail_merge_optimize(unsigned int)
    ../../gcc-svn-src/gcc/tree-ssa-tail-merge.c:1634
0xa0b69c do_pre
    ../../gcc-svn-src/gcc/tree-ssa-pre.c:4754

Here is the program 5-min.c:

struct {
  int f4;
} g1;

long g2;

volatile long g3;

void func_1 () {
    if (g2)
        g1 = g1;
    else
        g3;
}

void main () {
}


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

* [Bug tree-optimization/56150] ICE segfault in do_pre / tail_merge_optimize
  2013-01-30 14:44 [Bug tree-optimization/56150] New: ICE segfault in do_pre / tail_merge_optimize francesco.zappa.nardelli at gmail dot com
@ 2013-01-30 14:45 ` francesco.zappa.nardelli at gmail dot com
  2013-01-30 15:57 ` [Bug tree-optimization/56150] [4.8 Regression] " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: francesco.zappa.nardelli at gmail dot com @ 2013-01-30 14:45 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Francesco Zappa Nardelli <francesco.zappa.nardelli at gmail dot com> 2013-01-30 14:44:45 UTC ---
Sorry, forgot to specify: 

  Target: x86_64-unknown-linux-gnu


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

* [Bug tree-optimization/56150] [4.8 Regression] ICE segfault in do_pre / tail_merge_optimize
  2013-01-30 14:44 [Bug tree-optimization/56150] New: ICE segfault in do_pre / tail_merge_optimize francesco.zappa.nardelli at gmail dot com
  2013-01-30 14:45 ` [Bug tree-optimization/56150] " francesco.zappa.nardelli at gmail dot com
@ 2013-01-30 15:57 ` rguenth at gcc dot gnu.org
  2013-01-31  8:53 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-30 15:57 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-01-30
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0
            Summary|ICE segfault in do_pre /    |[4.8 Regression] ICE
                   |tail_merge_optimize         |segfault in do_pre /
                   |                            |tail_merge_optimize
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-30 15:56:27 UTC ---
Confirmed.

1119        case GIMPLE_ASSIGN:
1120          lhs1 = gimple_get_lhs (s1);
1121          lhs2 = gimple_get_lhs (s2);
1122          if (gimple_vdef (s1))
1123            {
1124              if (vn_valueize (gimple_vdef (s1)) != vn_valueize
(gimple_vdef (s2)))

s2 isn't a store.

Index: gcc/tree-ssa-tail-merge.c
===================================================================
--- gcc/tree-ssa-tail-merge.c   (revision 195574)
+++ gcc/tree-ssa-tail-merge.c   (working copy)
@@ -1121,6 +1121,8 @@ gimple_equal_p (same_succ same_succ, gim
       lhs2 = gimple_get_lhs (s2);
       if (gimple_vdef (s1))
        {
+         if (!gimple_vdef (s2))
+           return false;
          if (vn_valueize (gimple_vdef (s1)) != vn_valueize (gimple_vdef (s2)))
            return false;
          if (TREE_CODE (lhs1) != SSA_NAME

fixes it.


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

* [Bug tree-optimization/56150] [4.8 Regression] ICE segfault in do_pre / tail_merge_optimize
  2013-01-30 14:44 [Bug tree-optimization/56150] New: ICE segfault in do_pre / tail_merge_optimize francesco.zappa.nardelli at gmail dot com
  2013-01-30 14:45 ` [Bug tree-optimization/56150] " francesco.zappa.nardelli at gmail dot com
  2013-01-30 15:57 ` [Bug tree-optimization/56150] [4.8 Regression] " rguenth at gcc dot gnu.org
@ 2013-01-31  8:53 ` rguenth at gcc dot gnu.org
  2013-01-31  8:54 ` rguenth at gcc dot gnu.org
  2013-01-31  9:17 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-31  8:53 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-31 08:53:03 UTC ---
Author: rguenth
Date: Thu Jan 31 08:52:56 2013
New Revision: 195608

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195608
Log:
2013-01-31  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56150
    * tree-ssa-tail-merge.c (gimple_equal_p): Properly handle
    mixed store non-store stmts.

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

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr56150.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-tail-merge.c


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

* [Bug tree-optimization/56150] [4.8 Regression] ICE segfault in do_pre / tail_merge_optimize
  2013-01-30 14:44 [Bug tree-optimization/56150] New: ICE segfault in do_pre / tail_merge_optimize francesco.zappa.nardelli at gmail dot com
                   ` (2 preceding siblings ...)
  2013-01-31  8:53 ` rguenth at gcc dot gnu.org
@ 2013-01-31  8:54 ` rguenth at gcc dot gnu.org
  2013-01-31  9:17 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-31  8:54 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-31 08:53:47 UTC ---
Author: rguenth
Date: Thu Jan 31 08:53:43 2013
New Revision: 195609

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195609
Log:
2013-01-31  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56150
    * tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Do not
    visit virtual operands.
    (find_uses_to_rename_bb): Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-loop-manip.c


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

* [Bug tree-optimization/56150] [4.8 Regression] ICE segfault in do_pre / tail_merge_optimize
  2013-01-30 14:44 [Bug tree-optimization/56150] New: ICE segfault in do_pre / tail_merge_optimize francesco.zappa.nardelli at gmail dot com
                   ` (3 preceding siblings ...)
  2013-01-31  8:54 ` rguenth at gcc dot gnu.org
@ 2013-01-31  9:17 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-01-31  9:17 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-31 09:16:47 UTC ---
Fixed.


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

end of thread, other threads:[~2013-01-31  9:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-30 14:44 [Bug tree-optimization/56150] New: ICE segfault in do_pre / tail_merge_optimize francesco.zappa.nardelli at gmail dot com
2013-01-30 14:45 ` [Bug tree-optimization/56150] " francesco.zappa.nardelli at gmail dot com
2013-01-30 15:57 ` [Bug tree-optimization/56150] [4.8 Regression] " rguenth at gcc dot gnu.org
2013-01-31  8:53 ` rguenth at gcc dot gnu.org
2013-01-31  8:54 ` rguenth at gcc dot gnu.org
2013-01-31  9:17 ` 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).