From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1710 invoked by alias); 20 Dec 2012 16:18:45 -0000 Received: (qmail 1301 invoked by uid 48); 20 Dec 2012 16:18:24 -0000 From: "blue_3too at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/55749] gcc 4.7.1 removes labels mistakenly Date: Thu, 20 Dec 2012 16:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: blue_3too at hotmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: 2012-12/txt/msg02009.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55749 --- Comment #3 from blue_3too at hotmail dot com 2012-12-20 16:18:23 UTC --- Thanks for the comments. I checked the document @ gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html . But find no description hat label-as-a-value should be used with computed goto. Can you be more specific about where is the description from? But back to my problem: my_labe is a resuming point for a thread to acquire a lock after being blocked on the lock and slept. When it is waken, it should resume execution from my_label. So I guess it contradicts with following description in the doc: "You may not use this mechanism to jump to code in a different function. If you do that, totally unpredictable things happen. The best way to avoid this is to store the label address only in automatic variables and never pass it as an argument. " Because the label is passed out of the function, it is used to jump back the function when the sleeping thread is awaken. Not sure how to implement this properly.