[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 --- Comment #7 from Markus Trippelsdorf --- The issue seems to be fixed. Not sure what revision fixed it.
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 --- Comment #8 from Martin Jambor --- Author: jamborm Date: Fri Dec 11 11:27:11 2015 New Revision: 231559 URL: https://gcc.gnu.org/viewcvs?rev=231559=gcc=rev Log: Add an asssert and testcase for PR 68064 2015-12-11 Martin JamborPR ipa/68064 * ipa-prop.c (ipa_compute_jump_functions_for_edge): Add checking assert that align is nonzero. testsuite/ * g++.dg/torture/pr68064.C: New test. Added: trunk/gcc/testsuite/g++.dg/torture/pr68064.C Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-prop.c trunk/gcc/testsuite/ChangeLog
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 Martin Jambor changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #9 from Martin Jambor --- Yes, it has been fixed by Richi's r231246 which is a fix of PR68636 (of which this is basically a duplicate, only manifesting elsewhere). I am have just committed a testcase and an assert for detecting this earlier should it happen again, see https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01246.html *** This bug has been marked as a duplicate of bug 68636 ***
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 --- Comment #5 from Markus Trippelsdorf --- Any update on this issue?
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 --- Comment #6 from Jan Hubicka --- Hmm, I can't make much sense of get_pointer_alignment_1 returning 0. I suppose this happens because here: else if (TREE_CODE (exp) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (exp))) { unsigned int ptr_align, ptr_misalign; struct ptr_info_def *pi = SSA_NAME_PTR_INFO (exp); if (pi && get_ptr_info_alignment (pi, _align, _misalign)) { *bitposp = ptr_misalign * BITS_PER_UNIT; *alignp = ptr_align * BITS_PER_UNIT; /* We cannot really tell whether this result is an approximation. */ return true; } else { *bitposp = 0; *alignp = BITS_PER_UNIT; return false; } } because we get overflow when computing ptr_misalign * BITS_PER_UNIT. I think get_pointer_alignment should prevent that. It knows how to deal with constant: else if (TREE_CODE (exp) == INTEGER_CST) { *alignp = BIGGEST_ALIGNMENT; *bitposp = ((TREE_INT_CST_LOW (exp) * BITS_PER_UNIT) & (BIGGEST_ALIGNMENT - 1)); return true; } so I guess the code handling SSA_NAME should also cap to BIGGEST_ALIGNMENT.
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 --- Comment #4 from Martin Jambor --- I have proposed committing the fix on the mailing list https://gcc.gnu.org/ml/gcc-patches/2015-10/msg03383.html
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 Martin Jambor changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |jamborm at gcc dot gnu.org --- Comment #2 from Martin Jambor --- Mine.
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 --- Comment #3 from Martin Jambor --- The problem is that IPA-CP does not handle zero-aligned pointers (what would they be?) but get_pointer_alignment_1 actually returns zero for one and itself returns true, meaning it claims it knows the alignment is what it says. The reason for that is that the pointer is actually either zero or an integer constant, selected by a ternary operator. Given the circumstances, the behavior of get_pointer_alignment_1 is actually OK, I suppose, so wee need to check for it like this: --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -1651,6 +1651,7 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, unsigned align; if (get_pointer_alignment_1 (arg, , _bitpos) + && align != 0 && align % BITS_PER_UNIT == 0 && hwi_bitpos % BITS_PER_UNIT == 0) {
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 Richard Biener changed: What|Removed |Added Target Milestone|--- |6.0
[Bug ipa/68064] [6 Regression] ICE: in meet_with, at ipa-cp.c:874
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68064 Markus Trippelsdorf changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2015-10-23 CC||hubicka at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Markus Trippelsdorf --- markus@x4 Release % cat typer.ii template class A { public: class B; typedef typename Config::template D::type TypeHandle; static A *Tagged() { return B::New(B::kTagged); } static TypeHandle Union(TypeHandle); static TypeHandle Representation(TypeHandle, typename Config::Region *); bool Is(); }; template class A::B { friend A; enum { kTaggedPointer = 1 << 31, kTagged = kTaggedPointer }; static A *New(int p1) { return Config::from_bitset(p1); } }; struct C { typedef int Region; template struct D { typedef A *type; }; static A *from_bitset(unsigned); }; A *C::from_bitset(unsigned p1) { return reinterpret_cast(p1); } namespace { int *a; void fn1(A *p1) { A::Union(A::Representation(p1, a)); } } void fn2() { A b; A *c = b.Is() ? 0 : A::Tagged(); fn1(c); } markus@x4 Release % g++ -c -O2 typer.ii typer.ii:33:1: internal compiler error: in meet_with, at ipa-cp.c:874