This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/55749] gcc 4.7.1 removes labels mistakenly


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]