From: dnovillo@google.com (Diego Novillo)
To: reply@codereview.appspotmail.com, crowl@google.com,
gchare@google.com, gcc-patches@gcc.gnu.org
Subject: [pph] Fix GC ICE in g++.dg/pph/c1eabi.cc (issue4607047)
Date: Mon, 13 Jun 2011 19:54:00 -0000 [thread overview]
Message-ID: <20110613190859.4B66E1DA1CC@topo.tor.corp.google.com> (raw)
We were running into a GC ICE because when reading a sorted_fields_type
field we were never setting the lenght of the vector.
This patch moves the setting of the vector length to the actual
allocation function (sorted_fields_type_new). It was being done in
finish_struct_1 before, so vectors read from the streamer were getting
garbage in the len field.
This fixes g++.dg/pph/c1eabi.{cc,h}. Tested on x86_64. Committed to
branch.
Diego.
cp/ChangeLog.pph
* class.c (sorted_fields_type_new): Set field LEN in the
newly allocated vector.
(finish_struct_1): Remove setting of FIELD_VEC->LEN.
testsuite/ChangeLog.pph
* g++.dg/pph/c1eabi1.h: Remove XFAIL markers.
* g++.dg/pph/c1eabi1.cc: Likewise.
Add assembly mis-comparison expectation.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 86ec04b..70a3668 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -5579,8 +5579,12 @@ determine_key_method (tree type)
struct sorted_fields_type *
sorted_fields_type_new (int n)
{
- return ggc_alloc_sorted_fields_type (sizeof (struct sorted_fields_type)
- + n * sizeof (tree));
+ struct sorted_fields_type *sft;
+ sft = ggc_alloc_sorted_fields_type (sizeof (struct sorted_fields_type)
+ + n * sizeof (tree));
+ sft->len = n;
+
+ return sft;
}
@@ -5714,7 +5718,6 @@ finish_struct_1 (tree t)
if (n_fields > 7)
{
struct sorted_fields_type *field_vec = sorted_fields_type_new (n_fields);
- field_vec->len = n_fields;
add_fields_to_record_type (TYPE_FIELDS (t), field_vec, 0);
qsort (field_vec->elts, n_fields, sizeof (tree),
field_decl_cmp);
diff --git a/gcc/testsuite/g++.dg/pph/c1eabi1.cc b/gcc/testsuite/g++.dg/pph/c1eabi1.cc
index 6271501..b2e9b11 100644
--- a/gcc/testsuite/g++.dg/pph/c1eabi1.cc
+++ b/gcc/testsuite/g++.dg/pph/c1eabi1.cc
@@ -1,7 +1,4 @@
-// { dg-xfail-if "ICE" { "*-*-*" } { "-fpph-map=pph.map" } }
-// { dg-bogus "mathcalls.h:365:1: internal compiler error: Segmentation fault" "" { xfail *-*-* } 0 }
-// { dg-prune-output "In file included from " }
-// { dg-prune-output " from " }
// { dg-options "-w -fpermissive" }
+// pph asm xdiff
#include "c1eabi1.h"
diff --git a/gcc/testsuite/g++.dg/pph/c1eabi1.h b/gcc/testsuite/g++.dg/pph/c1eabi1.h
index 151b768..5f5b593 100644
--- a/gcc/testsuite/g++.dg/pph/c1eabi1.h
+++ b/gcc/testsuite/g++.dg/pph/c1eabi1.h
@@ -1,7 +1,3 @@
-// { dg-xfail-if "ICE" { "*-*-*" } { "-fpph-map=pph.map" } }
-// { dg-bogus "mathcalls.h:365:1: internal compiler error: Segmentation fault" "" { xfail *-*-* } 0 }
-// { dg-prune-output "In file included " }
-// { dg-prune-output " from " }
// { dg-options "-w -fpermissive" }
#ifndef __PPH_GUARD_H
--
This patch is available for review at http://codereview.appspot.com/4607047
reply other threads:[~2011-06-13 19:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110613190859.4B66E1DA1CC@topo.tor.corp.google.com \
--to=dnovillo@google.com \
--cc=crowl@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gchare@google.com \
--cc=reply@codereview.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).