public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Questions before submitting a bug report
@ 2012-01-03 15:02 Markus Henschel
  2012-01-03 15:06 ` Andrew Haley
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Markus Henschel @ 2012-01-03 15:02 UTC (permalink / raw)
  To: gcc-help

Hello,

I think I found a bug in gcc but before I submit it I'd like to have someone look at least briefly on the code to make sure I did not make some silly mistake.

*********************************************schnipp***************
struct Foo
{
	long long _foobar;
};

struct Foo * foo_instance()
{
	static struct Foo foo;
	return &foo;
}

void bar(struct Foo * foo)
{
	__sync_add_and_fetch(&foo->_foobar, 1LL);
}


int main(int argc, char * argv[])
{
	struct Foo * foo=foo_instance();
	foo->_foobar=argc;
	bar(foo);
	return (int)foo->_foobar;
}
*********************************************schnapp***************

Is there some obvious flaw in my code? 

My second question is if it makes any sense to submit this bug if it's against gcc version 4.2.4. I still have to use this compiler version but the bug seems to have vanished in version 4.3.3. Is 4.2.4 still maintained?

Thanks for your time.

Markus

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-01-05 23:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03 15:02 Questions before submitting a bug report Markus Henschel
2012-01-03 15:06 ` Andrew Haley
2012-01-03 15:23   ` Markus Henschel
2012-01-03 15:25     ` Andrew Haley
2012-01-03 15:26 ` Andrew Haley
2012-01-03 15:39   ` Markus Henschel
2012-01-03 15:52     ` Andrew Haley
2012-01-04 10:08       ` Markus Henschel
2012-01-05 23:00         ` Kalle Olavi Niemitalo
2012-01-03 16:55 ` Jonathan Wakely

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).