From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16158 invoked by alias); 7 Jan 2013 17:55:04 -0000 Received: (qmail 15180 invoked by uid 48); 7 Jan 2013 17:54:15 -0000 From: "dnovillo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/55792] [4.8 Regression] Bad memory access with profiledbootstrap and LTO Date: Mon, 07 Jan 2013 17:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dnovillo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00550.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55792 --- Comment #11 from Diego Novillo 2013-01-07 17:54:14 UTC --- (In reply to comment #9) > Eh. Diego, how does GTY((user)) work here? It smells like a bug in vec.h > to me. > > /* Garbage collection support for vec. */ > > template > void > gt_ggc_mx (vec *v) > { > extern void gt_ggc_mx (T &); > for (unsigned i = 0; i < v->length (); i++) > gt_ggc_mx ((*v)[i]); > } > > doesn't it need to mark the vec itself? Maybe automatic registration of > roots (this is a GC root) does not work with GTY((user))? No. The root is/should be marked by the code calling gt_ggc_mx. gengtype will generate code like: if (ggc_test_and_set_mark (x)) { gt_ggc_mx (x); } ggc_test_and_set_mark() is the one that marks the root. Has gengtype generated a function for this global? It should be something like this void gt_ggc_mx_vec_ (void *x_p) { vec * const x = (vec *)x_p; if (ggc_test_and_set_mark (x)) { gt_ggc_mx (x); } }