public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/51436] New: [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603
@ 2011-12-06  9:36 burnus at gcc dot gnu.org
  2011-12-06 10:31 ` [Bug middle-end/51436] " markus at trippelsdorf dot de
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-12-06  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51436
           Summary: [4.7 Regression] ICE(segfault) in
                    gimplify_and_update_call_from_tree gimple-fold.c:603
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org
              Host: x86_64-unknown-linux-gnu


Created attachment 26003
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26003
Reduced test case (test.ii, 5 KiB)

The attached test case compiles with g++ 4.6 but with the current 4.7.0
20111206 it fails with:

$ g++ test52.ii
test52.ii: In static member function ‘static Dest
v8::internal::BitCastHelper<Dest, Source*>::cast(Source*) [with Dest =
v8::internal::String**; Source = v8::internal::String*]’:
test52.ii:116:16: internal compiler error: Segmentation fault


Program received signal SIGSEGV, Segmentation fault.
gimplify_and_update_call_from_tree (si_p=0x7fffffffd8b0, expr=<optimized out>)
    at gcc/gimple-fold.c:603
603               if (TREE_CODE (vdef) == SSA_NAME)
(gdb) p vdef
$1 = (tree_node *) 0x0


(gdb) bt
#0  gimplify_and_update_call_from_tree (si_p=0x7fffffffd8b0, expr=<optimized
out>)
    at gcc/gimple-fold.c:603
#1  0x00000000008e704d in gimple_fold_call (inplace=<optimized out>,
gsi=<optimized out>)
    at gcc/gimple-fold.c:1123
#2  fold_stmt_1 (gsi=0x7fffffffd8b0, inplace=false) at gcc/gimple-fold.c:1187
#3  0x0000000000a96b41 in fold_marked_statements (first=5,
statements=0x173bbc0)
    at gcc/tree-inline.c:4131
#4  0x0000000000a9f1f7 in optimize_inline_calls (fn=0x2aaaacf86b00)
    at gcc/tree-inline.c:4275
#5  0x0000000000f03223 in early_inliner () at gcc/ipa-inline.c:1968
#6  0x00000000009af115 in execute_one_pass (pass=0x15bf400) at
gcc/passes.c:2074
#7  0x00000000009af4b5 in execute_pass_list (pass=0x15bf400) at
gcc/passes.c:2129
#8  0x00000000009ae684 in do_per_function_toporder (callback=0x9af4a0
<execute_pass_list(opt_pass*)>, data=0x15bbbc0)
    at gcc/passes.c:1616


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

* [Bug middle-end/51436] [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603
  2011-12-06  9:36 [Bug middle-end/51436] New: [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603 burnus at gcc dot gnu.org
@ 2011-12-06 10:31 ` markus at trippelsdorf dot de
  2011-12-06 12:08 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: markus at trippelsdorf dot de @ 2011-12-06 10:31 UTC (permalink / raw)
  To: gcc-bugs

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

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> 2011-12-06 10:31:20 UTC ---
Slightly smaller testcase:

typedef long unsigned size_t;
extern "C" void *memcpy (void *, __const void *, size_t);
template < class Dest, class Source > struct BitCastHelper {
    static Dest cast (const Source & source) __attribute__ ((always_inline)) {
        Dest dest;
        memcpy (0, &source, sizeof dest);
    }
};
template < class Dest, class Source > Dest BitCast (Source)
{
    BitCastHelper < Dest, Source >::cast (0);
}

class MaybeObject
{
};
class Object:MaybeObject
{
public:
    static Object *cast (Object *) {
    }
};
class HeapObject:public Object
{
};
class String:public HeapObject
{
};
class ExternalString:public String
{
};
class ExternalTwoByteString:public ExternalString
{
};

template < typename T > class Handle
{
public:
    Handle () {
    }
    T *operator* () const;
    template < class S > static Handle < T > cast (Handle < S > that) {
        T::cast (*that);
    }
    T **location_;
};

template < typename T > T * Handle < T >::operator* () const
{
    *BitCast < T ** >(location_);
}

void
TestCharacterStream ()
{
    Handle < String > uc16_string;
    Handle < ExternalTwoByteString >::cast (uc16_string);
}


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

* [Bug middle-end/51436] [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603
  2011-12-06  9:36 [Bug middle-end/51436] New: [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603 burnus at gcc dot gnu.org
  2011-12-06 10:31 ` [Bug middle-end/51436] " markus at trippelsdorf dot de
@ 2011-12-06 12:08 ` rguenth at gcc dot gnu.org
  2011-12-06 12:18 ` rguenth at gcc dot gnu.org
  2011-12-06 12:18 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-12-06
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 12:07:53 UTC ---
Mine.


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

* [Bug middle-end/51436] [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603
  2011-12-06  9:36 [Bug middle-end/51436] New: [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603 burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-12-06 12:18 ` rguenth at gcc dot gnu.org
@ 2011-12-06 12:18 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 12:18:03 UTC ---
Fixed.


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

* [Bug middle-end/51436] [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603
  2011-12-06  9:36 [Bug middle-end/51436] New: [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603 burnus at gcc dot gnu.org
  2011-12-06 10:31 ` [Bug middle-end/51436] " markus at trippelsdorf dot de
  2011-12-06 12:08 ` rguenth at gcc dot gnu.org
@ 2011-12-06 12:18 ` rguenth at gcc dot gnu.org
  2011-12-06 12:18 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-06 12:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-06 12:17:42 UTC ---
Author: rguenth
Date: Tue Dec  6 12:17:31 2011
New Revision: 182045

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

    PR middle-end/51436
    * gimple-fold.c (gimplify_and_update_call_from_tree): Guard
    vdef check for the fact we do not have virtual operands when
    not optimizing.

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

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr51436.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimple-fold.c
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2011-12-06 12:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-06  9:36 [Bug middle-end/51436] New: [4.7 Regression] ICE(segfault) in gimplify_and_update_call_from_tree gimple-fold.c:603 burnus at gcc dot gnu.org
2011-12-06 10:31 ` [Bug middle-end/51436] " markus at trippelsdorf dot de
2011-12-06 12:08 ` rguenth at gcc dot gnu.org
2011-12-06 12:18 ` rguenth at gcc dot gnu.org
2011-12-06 12:18 ` 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).