public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/60058] New: [4.9 Regression] internal compiler error: Segmentation fault
@ 2014-02-04 13:00 trippels at gcc dot gnu.org
  2014-02-04 13:19 ` [Bug ipa/60058] " trippels at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-02-04 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60058
           Summary: [4.9 Regression] internal compiler error: Segmentation
                    fault
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org

markus@x4 common % cat test.ii
typedef enum {} UErrorCode;
class A {
public:
  virtual A &m_fn1(A &, const A &, UErrorCode &) const;
  void m_fn2();
  A();
  A(int);
};
class __attribute__((visibility("default"))) B : public A {
public:
  B(A &p1) : norm2(p1), set(0) {}
  A &m_fn1(A &, const A &, UErrorCode &) const;
  A &norm2;
  const int &set;
};

UErrorCode a;
A c;
void fn1(A *p1) {
  A b;
  p1->m_fn1(b, 0, a).m_fn2();
}

void fn2() {
  B d(c);
  fn1(&d);
}

markus@x4 common % g++ -c -O2 test.ii
test.ii:27:1: internal compiler error: Segmentation fault
 }
 ^
0xb4d18f crash_signal
        ../../gcc/gcc/toplev.c:337
0x103ef73 contains_struct_check
        ../../gcc/gcc/tree.h:2822
0x103ef73 ipa_get_indirect_edge_target_1
        ../../gcc/gcc/ipa-cp.c:1576
0x9d1360 estimate_edge_devirt_benefit
        ../../gcc/gcc/ipa-inline-analysis.c:2945
0x9d1360 estimate_edge_size_and_time
        ../../gcc/gcc/ipa-inline-analysis.c:2977
0x9d1360 estimate_calls_size_and_time
        ../../gcc/gcc/ipa-inline-analysis.c:3030
0x9d1872 estimate_node_size_and_time
        ../../gcc/gcc/ipa-inline-analysis.c:3117
0x9d4cb7 do_estimate_edge_size(cgraph_edge*)
        ../../gcc/gcc/ipa-inline-analysis.c:3660
0x9d4e62 estimate_edge_size
        ../../gcc/gcc/ipa-inline.h:277
0x9d4e62 estimate_edge_growth
        ../../gcc/gcc/ipa-inline.h:289
0x9d4e62 do_estimate_growth_1
        ../../gcc/gcc/ipa-inline-analysis.c:3771
0x82a4de cgraph_for_node_and_aliases(cgraph_node*, bool (*)(cgraph_node*,
void*), void*, bool)
        ../../gcc/gcc/cgraph.c:2209
0x9d537a do_estimate_growth(cgraph_node*)
        ../../gcc/gcc/ipa-inline-analysis.c:3785
0x105073b estimate_growth
        ../../gcc/gcc/ipa-inline.h:264
0x105073b inline_small_functions
        ../../gcc/gcc/ipa-inline.c:1565
0x105073b ipa_inline
        ../../gcc/gcc/ipa-inline.c:2025
0x105073b execute
        ../../gcc/gcc/ipa-inline.c:2381
Please submit a full bug report,
with preprocessed source if appropriate.

Started with r207447.


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

* [Bug ipa/60058] [4.9 Regression] internal compiler error: Segmentation fault
  2014-02-04 13:00 [Bug ipa/60058] New: [4.9 Regression] internal compiler error: Segmentation fault trippels at gcc dot gnu.org
@ 2014-02-04 13:19 ` trippels at gcc dot gnu.org
  2014-02-04 14:22 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-02-04 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Looks like an "if (target)" wrapper like in the other hunk of r207447 is
necessary.

diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 68afeb0d89e4..dab9e8a0f80d 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1573,20 +1573,23 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
        {
          target = gimple_get_virt_method_for_vtable
(ie->indirect_info->otr_token,
                                                      vtable, offset);
-         if ((TREE_CODE (TREE_TYPE (target)) == FUNCTION_TYPE
-              && DECL_FUNCTION_CODE (target) == BUILT_IN_UNREACHABLE)
-             || !possible_polymorphic_call_target_p
-                  (ie, cgraph_get_node (target)))
+         if (target)
            {
-             if (dump_file)
-               fprintf (dump_file,
-                        "Type inconsident devirtualization: %s/%i->%s\n",
-                        ie->caller->name (), ie->caller->order,
-                        IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target)));
-             target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
-             cgraph_get_create_node (target);
+             if ((TREE_CODE (TREE_TYPE (target)) == FUNCTION_TYPE
+                  && DECL_FUNCTION_CODE (target) == BUILT_IN_UNREACHABLE)
+                 || !possible_polymorphic_call_target_p
+                      (ie, cgraph_get_node (target)))
+               {
+                 if (dump_file)
+                   fprintf (dump_file,
+                            "Type inconsident devirtualization: %s/%i->%s\n",
+                            ie->caller->name (), ie->caller->order,
+                            IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME
(target)));
+                 target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
+                 cgraph_get_create_node (target);
+               }
+             return target;
            }
-         return target;
        }
     }


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

* [Bug ipa/60058] [4.9 Regression] internal compiler error: Segmentation fault
  2014-02-04 13:00 [Bug ipa/60058] New: [4.9 Regression] internal compiler error: Segmentation fault trippels at gcc dot gnu.org
  2014-02-04 13:19 ` [Bug ipa/60058] " trippels at gcc dot gnu.org
@ 2014-02-04 14:22 ` rguenth at gcc dot gnu.org
  2014-02-04 17:25 ` hubicka at gcc dot gnu.org
  2014-02-04 17:26 ` hubicka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-04 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |4.9.0


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

* [Bug ipa/60058] [4.9 Regression] internal compiler error: Segmentation fault
  2014-02-04 13:00 [Bug ipa/60058] New: [4.9 Regression] internal compiler error: Segmentation fault trippels at gcc dot gnu.org
  2014-02-04 13:19 ` [Bug ipa/60058] " trippels at gcc dot gnu.org
  2014-02-04 14:22 ` rguenth at gcc dot gnu.org
@ 2014-02-04 17:25 ` hubicka at gcc dot gnu.org
  2014-02-04 17:26 ` hubicka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-02-04 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |hubicka at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed, thanks!


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

* [Bug ipa/60058] [4.9 Regression] internal compiler error: Segmentation fault
  2014-02-04 13:00 [Bug ipa/60058] New: [4.9 Regression] internal compiler error: Segmentation fault trippels at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-02-04 17:25 ` hubicka at gcc dot gnu.org
@ 2014-02-04 17:26 ` hubicka at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-02-04 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Tue Feb  4 17:25:38 2014
New Revision: 207478

URL: http://gcc.gnu.org/viewcvs?rev=207478&root=gcc&view=rev
Log:

    PR ipa/60058
    * ipa-cp.c (ipa_get_indirect_edge_target_1): Check that target
    is non-null.
    * g++.dg/torture/pr60058.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr60058.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-cp.c
    trunk/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2014-02-04 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-04 13:00 [Bug ipa/60058] New: [4.9 Regression] internal compiler error: Segmentation fault trippels at gcc dot gnu.org
2014-02-04 13:19 ` [Bug ipa/60058] " trippels at gcc dot gnu.org
2014-02-04 14:22 ` rguenth at gcc dot gnu.org
2014-02-04 17:25 ` hubicka at gcc dot gnu.org
2014-02-04 17:26 ` hubicka 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).