diff mbox

Patch related to PR objc/41108

Message ID 1290455978.824313331@192.168.2.227
State New
Headers show

Commit Message

Nicola Pero Nov. 22, 2010, 7:59 p.m. UTC
PR objc/41108 was caused by a NeXT-only gc-only routine being called when compiling for 
the GNU runtime.

It's already fixed in trunk; before closing it, I'd like to apply this patch which adds 
an assert in objc_generate_write_barrier() to make sure it is only called with the next-runtime.

The assert is mostly to clarify what is happening to someone reading the code, but hopefully 
it could also help detect a similar problem early if things get confused during some future code
reorganization.

Ok to commit ?

Thanks

Comments

Mike Stump Nov. 22, 2010, 9:15 p.m. UTC | #1
On Nov 22, 2010, at 11:59 AM, "Nicola Pero" <nicola.pero@meta-innovation.com> wrote:
> PR objc/41108 was caused by a NeXT-only gc-only routine being called when compiling for 
> the GNU runtime.

> Ok to commit ?

Ok.
diff mbox

Patch

Index: objc-act.c
===================================================================
--- objc-act.c  (revision 167048)
+++ objc-act.c  (working copy)
@@ -4655,6 +4655,10 @@  objc_generate_write_barrier (tree lhs, enum tree_c
   tree result = NULL_TREE, outer;
   int strong_cast_p = 0, outer_gc_p = 0, indirect_p = 0;
 
+  /* This function is currently only used with the next runtime with
+     garbage collection enabled (-fobjc-gc).  */
+  gcc_assert (flag_next_runtime);
+
   /* See if we have any lhs casts, and strip them out.  NB: The lvalue casts
      will have been transformed to the form '*(type *)&expr'.  */
   if (TREE_CODE (lhs) == INDIRECT_REF)
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 167048)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@ 
+2010-11-22  Nicola Pero  <nicola.pero@meta-innovation.com>
+
+       PR objc/41108
+       * objc-act.c (objc_generate_write_barrier): Added assert to make sure
+       this function is only called with the next runtime.
+
 2010-11-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/46547