Bug 65747 - [5 Regression] ICE (in compare_ssa_name, at ipa-icf-gimple.c:134) on x86_64-linux-gnu
Summary: [5 Regression] ICE (in compare_ssa_name, at ipa-icf-gimple.c:134) on x86_64-l...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 5.0
: P1 normal
Target Milestone: 5.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2015-04-12 12:56 UTC by Matthias Klose
Modified: 2015-04-12 19:32 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Known to work: 4.9.2
Known to fail: 5.0
Last reconfirmed: 2015-04-12 00:00:00


Attachments
preprocessed source (360.08 KB, application/x-xz)
2015-04-12 12:56 UTC, Matthias Klose
Details
gcc5-pr65747.patch (749 bytes, patch)
2015-04-12 15:15 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2015-04-12 12:56:39 UTC
Created attachment 35303 [details]
preprocessed source

seen building the DCE VM for OpenJDK 7 (openjdk-7-dcevm package)

$ g++ -c -g -O2 assembler_x86.ii 
assembler_x86.ii:53:1: internal compiler error: in compare_ssa_name, at ipa-icf-gimple.c:134
 }
 ^
0x12fc510 ipa_icf_gimple::func_checker::compare_ssa_name(tree_node*, tree_node*)
        ../../src/gcc/ipa-icf-gimple.c:134
0x12fd53c ipa_icf_gimple::func_checker::compare_operand(tree_node*, tree_node*)
        ../../src/gcc/ipa-icf-gimple.c:524
0x12fe6fb ipa_icf_gimple::func_checker::compare_gimple_call(gcall*, gcall*)
        ../../src/gcc/ipa-icf-gimple.c:766
0x12ff6ee ipa_icf_gimple::func_checker::compare_bb(ipa_icf_gimple::sem_bb*, ipa_icf_gimple::sem_bb*)
        ../../src/gcc/ipa-icf-gimple.c:691
0x12ecd62 ipa_icf::sem_function::equals_private(ipa_icf::sem_item*, hash_map<symtab_node*, ipa_icf::sem_item*, default_hashmap_traits>&)
        ../../src/gcc/ipa-icf.c:757
0x12ed1f3 ipa_icf::sem_function::equals_private(ipa_icf::sem_item*, hash_map<symtab_node*, ipa_icf::sem_item*, default_hashmap_traits>&)
        ../../src/gcc/ipa-icf.c:653
0x12ed1f3 ipa_icf::sem_function::equals(ipa_icf::sem_item*, hash_map<symtab_node*, ipa_icf::sem_item*, default_hashmap_traits>&)
        ../../src/gcc/ipa-icf.c:654
0x12eddf2 ipa_icf::sem_item_optimizer::subdivide_classes_by_equality(bool)
        ../../src/gcc/ipa-icf.c:2657
0x12f8eec ipa_icf::sem_item_optimizer::execute()
        ../../src/gcc/ipa-icf.c:2421
0x12fa8e6 ipa_icf_driver
        ../../src/gcc/ipa-icf.c:3306
0x12fa8e6 ipa_icf::pass_ipa_icf::execute(function*)
        ../../src/gcc/ipa-icf.c:3353
Please submit a full bug report,
with preprocessed source if appropriate.

$ cat assembler_x86.ii
class A {
public:
  enum relocType {};
};
class B {
  enum {} _relocbuf[];
public:
  A::relocType m_fn1() const;
};
class Relocation {
public:
  virtual A m_fn2();
} *a;
class C {
  B _rspec;
  void m_fn3() { _rspec.m_fn1(); }
  friend class D;
};
class D {
  int m_fn4(C);
  void m_fn5();
  void m_fn6(int, C);
  void m_fn7(int, C);
  void m_fn8();
  bool m_fn9();
  void m_fn10(int);
  void m_fn11(int);
};
A::relocType B::m_fn1() const {
  a = (Relocation *)_relocbuf;
  a->m_fn2();
}
void D::m_fn10(int) { m_fn8(); }
void D::m_fn11(int) { m_fn8(); }
int D::m_fn4(C p1) { p1.m_fn3(); }
void D::m_fn6(int, C p2) {
  int b;
  if (m_fn9()) {
    m_fn4(p2);
    m_fn10(b);
  } else
    m_fn5();
  m_fn10(int());
}
void D::m_fn7(int, C p2) {
  int c;
  if (m_fn9()) {
    m_fn4(p2);
    m_fn11(c);
  } else
    m_fn5();
  m_fn11(int());
}


$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5-20150410-0ubuntu11' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=c++98 --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.0.0 20150410 (experimental) [trunk revision 221996] (Ubuntu 5-20150410-0ubuntu11)
Comment 1 Jakub Jelinek 2015-04-12 14:57:19 UTC
Started with r221086.
Comment 2 Jakub Jelinek 2015-04-12 15:15:17 UTC
Created attachment 35304 [details]
gcc5-pr65747.patch

Untested fix.  Honza, does this make sense?
Comment 3 Jakub Jelinek 2015-04-12 19:31:22 UTC
Author: jakub
Date: Sun Apr 12 19:30:51 2015
New Revision: 222024

URL: https://gcc.gnu.org/viewcvs?rev=222024&root=gcc&view=rev
Log:
	PR tree-optimization/65747
	* ipa-icf-gimple.c (func_checker::compare_operand): Use compare_operand
	rather than compare_ssa_name for OBJ_TYPE_REF_OBJECT.

	* g++.dg/torture/pr65747.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr65747.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-icf-gimple.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 Jakub Jelinek 2015-04-12 19:32:39 UTC
Fixed.