public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2
@ 2012-09-20 22:13 dcb314 at hotmail dot com
  2012-09-20 23:40 ` [Bug c++/54647] " markus at trippelsdorf dot de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: dcb314 at hotmail dot com @ 2012-09-20 22:13 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54647
           Summary: Segmentation fault in get_expr_value_id with -O2
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dcb314@hotmail.com


Created attachment 28240
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28240
C++ source code

I just tried to compile the package kdelibs3-3.5.10-39
on gcc-4.8 trunk dated 20120919 on an AMD x86_64 box.

The compiler said

render_table.cpp: In member function 'void khtml::RenderTable::splitColumn(int,
int)':
render_table.cpp:563:6: internal compiler error: Segmentation fault
 void RenderTable::splitColumn( int pos, int firstSpan )
      ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Here is valgrind helping out with a stack backtrace

==27576== Invalid read of size 4
==27576==    at 0xB5BAC8: get_expr_value_id(pre_expr_d*) (tree-ssa-pre.c:615)
==27576==    by 0xB6346A: find_or_generate_expression(basic_block_def*,
pre_expr_d*, gimple_statement_d**, gimple_statement_d*) [clone .constprop.104]
(tree-ssa-pre.c:2894)
==27576==    by 0xB60282: create_expression_by_pieces(basic_block_def*,
pre_expr_d*, gimple_statement_d**, gimple_statement_d*, tree_node*) [clone
.constprop.103] (tree-ssa-pre.c:2995)
==27576==    by 0xB606FD: insert_into_preds_of_block(basic_block_def*, unsigned
int, vec_t<pre_expr_d*>*) (tree-ssa-pre.c:3234)
==27576==    by 0xB61743: insert_aux(basic_block_def*) (tree-ssa-pre.c:3524)
==27576==    by 0xB61127: insert_aux(basic_block_def*) (tree-ssa-pre.c:3749)
==27576==    by 0xB61127: insert_aux(basic_block_def*) (tree-ssa-pre.c:3749)
==27576==    by 0xB61127: insert_aux(basic_block_def*) (tree-ssa-pre.c:3749)
==27576==    by 0xB61127: insert_aux(basic_block_def*) (tree-ssa-pre.c:3749)
==27576==    by 0xB61127: insert_aux(basic_block_def*) (tree-ssa-pre.c:3749)
==27576==    by 0xB61127: insert_aux(basic_block_def*) (tree-ssa-pre.c:3749)
==27576==    by 0xB61127: insert_aux(basic_block_def*) (tree-ssa-pre.c:3749)
==27576==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==27576==

Preprocessed source code attached. Flag -O2 required.


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

* [Bug c++/54647] Segmentation fault in get_expr_value_id with -O2
  2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
@ 2012-09-20 23:40 ` markus at trippelsdorf dot de
  2012-09-20 23:56 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: markus at trippelsdorf dot de @ 2012-09-20 23:40 UTC (permalink / raw)
  To: gcc-bugs


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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #1 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-09-20 23:39:33 UTC ---
class A
{
};
template <class type> struct D:A
{
    type & operator[](int);
};
struct B
{
    typedef D <int *>Row;
    struct C
    {
        Row *row;
    };
};
B::C a;
B::Row & b = *a.row;
void
fn1 ()
{
    while (1)
        b[0] = b[0] ? (int *) -1 : 0;
}


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

* [Bug c++/54647] Segmentation fault in get_expr_value_id with -O2
  2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
  2012-09-20 23:40 ` [Bug c++/54647] " markus at trippelsdorf dot de
  2012-09-20 23:56 ` paolo.carlini at oracle dot com
@ 2012-09-20 23:56 ` paolo.carlini at oracle dot com
  2012-09-21  8:55 ` [Bug tree-optimization/54647] [4.8 Regression] " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-09-20 23:56 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-09-20 23:55:35 UTC ---
Thanks!


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

* [Bug c++/54647] Segmentation fault in get_expr_value_id with -O2
  2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
  2012-09-20 23:40 ` [Bug c++/54647] " markus at trippelsdorf dot de
@ 2012-09-20 23:56 ` paolo.carlini at oracle dot com
  2012-09-20 23:56 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-09-20 23:56 UTC (permalink / raw)
  To: gcc-bugs


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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-09-20
     Ever Confirmed|0                           |1

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-09-20 23:56:19 UTC ---
Confirmed.


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

* [Bug tree-optimization/54647] [4.8 Regression] Segmentation fault in get_expr_value_id with -O2
  2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
                   ` (2 preceding siblings ...)
  2012-09-20 23:56 ` paolo.carlini at oracle dot com
@ 2012-09-21  8:55 ` rguenth at gcc dot gnu.org
  2012-09-21  9:46 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-21  8:55 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
          Component|c++                         |tree-optimization
      Known to work|                            |4.7.2
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0
            Summary|Segmentation fault in       |[4.8 Regression]
                   |get_expr_value_id with -O2  |Segmentation fault in
                   |                            |get_expr_value_id with -O2

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-21 08:54:23 UTC ---
Mine.


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

* [Bug tree-optimization/54647] [4.8 Regression] Segmentation fault in get_expr_value_id with -O2
  2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
                   ` (3 preceding siblings ...)
  2012-09-21  8:55 ` [Bug tree-optimization/54647] [4.8 Regression] " rguenth at gcc dot gnu.org
@ 2012-09-21  9:46 ` rguenth at gcc dot gnu.org
  2012-09-21 12:44 ` rguenth at gcc dot gnu.org
  2012-09-21 12:46 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-21  9:46 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-21 09:45:27 UTC ---
Hm.  We are now facing COND_EXPRs in VN / PRE.  But COND_EXPRs have an
embedded tree expression for the condition which we have no way of
(easily) generating.

Let me try to fix this without simply giving up on optimizing those
COND_EXPRs.


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

* [Bug tree-optimization/54647] [4.8 Regression] Segmentation fault in get_expr_value_id with -O2
  2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
                   ` (4 preceding siblings ...)
  2012-09-21  9:46 ` rguenth at gcc dot gnu.org
@ 2012-09-21 12:44 ` rguenth at gcc dot gnu.org
  2012-09-21 12:46 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-21 12:44 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-21 12:44:12 UTC ---
Author: rguenth
Date: Fri Sep 21 12:44:07 2012
New Revision: 191613

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

    PR tree-optimization/54647
    * tree-ssa-pre.c (compute_avail): Do not put COND_EXPR
    or VEC_COND_EXPR into EXP_GEN again.

    * g++.dg/torture/pr54647.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr54647.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-pre.c


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

* [Bug tree-optimization/54647] [4.8 Regression] Segmentation fault in get_expr_value_id with -O2
  2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
                   ` (5 preceding siblings ...)
  2012-09-21 12:44 ` rguenth at gcc dot gnu.org
@ 2012-09-21 12:46 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-21 12:46 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-21 12:45:49 UTC ---
Fixed.


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

end of thread, other threads:[~2012-09-21 12:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-20 22:13 [Bug c++/54647] New: Segmentation fault in get_expr_value_id with -O2 dcb314 at hotmail dot com
2012-09-20 23:40 ` [Bug c++/54647] " markus at trippelsdorf dot de
2012-09-20 23:56 ` paolo.carlini at oracle dot com
2012-09-20 23:56 ` paolo.carlini at oracle dot com
2012-09-21  8:55 ` [Bug tree-optimization/54647] [4.8 Regression] " rguenth at gcc dot gnu.org
2012-09-21  9:46 ` rguenth at gcc dot gnu.org
2012-09-21 12:44 ` rguenth at gcc dot gnu.org
2012-09-21 12: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).