public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olga at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/34483] wo_prof_two_strs.c:56: internal compiler error: in find_new_var_of_type, at ipa-struct-reorg.c:605
Date: Tue, 15 Jan 2008 14:55:00 -0000	[thread overview]
Message-ID: <20080115141125.11366.qmail@sourceware.org> (raw)
In-Reply-To: <bug-34483-276@http.gcc.gnu.org/bugzilla/>



------- Comment #31 from olga at gcc dot gnu dot org  2008-01-15 14:11 -------
I gave it another push. The following is a patch solving inconsistency of the
data structures in struct reorg, and releasing comparison with 0. Please try it
together with the Richard's patch. It should give extra XPASS. If it's ok for
you, I submit it for gcc-patches. 

Thank you,
Olga

Index: ipa-struct-reorg.c
===================================================================
--- ipa-struct-reorg.c  (revision 130927)
+++ ipa-struct-reorg.c  (working copy)
@@ -187,7 +187,7 @@
 typedef const struct func_alloc_sites *const_fallocs_t;

 /* All allocation sites in the program.  */
-htab_t alloc_sites;
+htab_t alloc_sites = NULL;

 /* New global variables. Generated once for whole program.  */
 htab_t new_global_vars;
@@ -1246,12 +1248,14 @@
   s0 = (str0 != length) ? true : false;
   s1 = (str1 != length) ? true : false;

-  gcc_assert ((!s0 && s1) || (!s1 && s0));
+  gcc_assert (s0 || s1);
+  /* For now we allow only comparison with 0 or NULL.  */
+  gcc_assert (integer_zerop (arg0) || integer_zerop (arg1));

-  str = s0 ? VEC_index (structure, structures, str0): 
-    VEC_index (structure, structures, str1);
-  arg = s0 ? arg0 : arg1;
-  pos = s0 ? 0 : 1;
+  str = integer_zerop (arg0) ? VEC_index (structure, structures, str1): 
+    VEC_index (structure, structures, str0);
+  arg = integer_zerop (arg0) ? arg1 : arg0;
+  pos = integer_zerop (arg0) ? 1 : 0;

   for (i = 0; VEC_iterate (tree, str->new_types, i, type); i++)
     {
@@ -2339,6 +2343,41 @@
     htab_traverse (accs, dump_acc, NULL);
 }

+/* This function is a callback for alloc_sites hashtable 
+   traversal. SLOT is a pointer to fallocs_t. This function
+   removes all allocations of the structure defined by DATA.  */
+
+static int
+remove_str_allocs_in_func (void **slot, void *data)
+{
+  fallocs_t fallocs = *(fallocs_t *) slot;
+  unsigned i = 0;
+  alloc_site_t *call;
+
+  while (VEC_iterate (alloc_site_t, fallocs->allocs, i, call))
+    {
+      if (call->str == (d_str) data)
+       VEC_ordered_remove (alloc_site_t, fallocs->allocs, i);
+      else
+       i++;
+    }
+
+  return 1;
+}
+
+/* This function remove all entries corresponding to the STR structure
+   from alloc_sites hashtable.   */
+
+static void
+remove_str_allocs (d_str str)
+{
+  if (!str)
+    return;
+
+  if (alloc_sites)
+    htab_traverse (alloc_sites, remove_str_allocs_in_func, str);
+}
+
 /* This function removes the structure with index I from structures vector. 
*/

 static void 
@@ -2349,7 +2388,11 @@
   if (i >= VEC_length (structure, structures))
     return;

-  str = VEC_index (structure, structures, i);  
+  str = VEC_index (structure, structures, i);
+  
+  /* Before removing the structure str, we have to remove its
+     allocations from alloc_sites hashtable.  */
+  remove_str_allocs (str);
   free_data_struct (str);
   VEC_ordered_remove (structure, structures, i);
 }
@@ -2383,8 +2426,12 @@

   s0 = (str0 != length) ? true : false;
   s1 = (str1 != length) ? true : false;
+  
+  if (!s0 && !s1)
+    return false;

-  if (!((!s0 && s1) || (!s1 && s0)))
+  /* For now we allow only comparison with 0 or NULL.  */
+  if (!integer_zerop (arg0) && !integer_zerop (arg1))
     return false;

   return true;



-- 


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


  parent reply	other threads:[~2008-01-15 14:12 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-15 17:21 [Bug middle-end/34483] New: " danglin at gcc dot gnu dot org
2007-12-17 15:15 ` [Bug middle-end/34483] " olga at gcc dot gnu dot org
2007-12-24  2:08 ` dave at hiauly1 dot hia dot nrc dot ca
2007-12-28 14:58 ` rsandifo at gcc dot gnu dot org
2007-12-28 19:28 ` olga at gcc dot gnu dot org
2007-12-28 19:38 ` rsandifo at nildram dot co dot uk
2007-12-28 19:54 ` dave at hiauly1 dot hia dot nrc dot ca
2007-12-29  1:25 ` dave at hiauly1 dot hia dot nrc dot ca
2007-12-29 16:20 ` hjl at lucon dot org
2007-12-30 12:19 ` olga at gcc dot gnu dot org
2007-12-30 14:54 ` pinskia at gcc dot gnu dot org
2007-12-31 19:44 ` dominiq at lps dot ens dot fr
2008-01-02 13:24 ` rsandifo at nildram dot co dot uk
2008-01-02 15:16 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-02 17:26 ` dominiq at lps dot ens dot fr
2008-01-03  2:40 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-07 14:10 ` olga at gcc dot gnu dot org
2008-01-07 20:19 ` dominiq at lps dot ens dot fr
2008-01-08 16:11 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-15 14:55 ` olga at gcc dot gnu dot org [this message]
2008-01-15 20:50 ` dominiq at lps dot ens dot fr
2008-01-16  7:13 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-20 14:35 ` olga at gcc dot gnu dot org
2008-01-20 15:29 ` dominiq at lps dot ens dot fr
2008-01-20 18:10 ` olga at gcc dot gnu dot org
2008-01-20 19:27 ` dominiq at lps dot ens dot fr
2008-01-20 21:33 ` dominiq at lps dot ens dot fr
2008-01-21 14:10 ` olga at gcc dot gnu dot org
2008-01-21 14:27 ` dominiq at lps dot ens dot fr
2008-01-21 15:18 ` dominiq at lps dot ens dot fr
2008-01-21 19:10 ` olga at il dot ibm dot com
2008-01-21 19:56 ` dominiq at lps dot ens dot fr
2008-01-21 20:41 ` olga at il dot ibm dot com
2008-01-21 20:42 ` dominiq at lps dot ens dot fr
2008-01-21 20:55 ` olga at il dot ibm dot com
2008-01-21 21:43 ` dominiq at lps dot ens dot fr
2008-01-22 21:02 ` olga at il dot ibm dot com
2008-01-22 22:12 ` olga at il dot ibm dot com
2008-01-22 23:26 ` dominiq at lps dot ens dot fr
2008-01-22 23:42 ` olga at il dot ibm dot com
2008-01-22 23:50 ` dominiq at lps dot ens dot fr
2008-01-24 13:53 ` dominiq at lps dot ens dot fr
2008-01-24 16:43 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-25  0:34 ` danglin at gcc dot gnu dot org
2008-01-25  9:14 ` olga at il dot ibm dot com
2008-01-25 19:30 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-26 22:46 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-29 10:15 ` alond at il dot ibm dot com
2008-01-30 20:14 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-31 18:53 ` alond at il dot ibm dot com
2008-01-31 22:24 ` dave at hiauly1 dot hia dot nrc dot ca
2008-01-31 22:30 ` dave at hiauly1 dot hia dot nrc dot ca
2008-02-03 14:49 ` olga at gcc dot gnu dot org
2008-02-05  2:43 ` dave at hiauly1 dot hia dot nrc dot ca
2008-02-07 10:26 ` olga at gcc dot gnu dot org
2008-02-07 15:34 ` dave at hiauly1 dot hia dot nrc dot ca
2008-11-01 20:16 ` danglin at gcc dot gnu dot org

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=20080115141125.11366.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).