Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » serious mingw bug?
serious mingw bug? [message #16195] Sun, 01 June 2008 17:48 Go to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
I am using U++ 2008.1beta2 with the embedded MinGW 4.3.0 on WinXp sp2.
I think I have found a code generation bug in MinGW for this code:
#include <Core/Core.h>

struct Test
{
	Test() { Upp::Cout() << "Test::Test()\n"; }
	~Test() { Upp::Cout() << "Test::~Test()\n"; }
};

struct Worker
{
	Worker * Fn1()
	{
		bool throwException = false;
		bool enterLoop = true;
		for(Test t; enterLoop;)
		{
			if(throwException) throw int(3);
			Upp::Cout() << "returning this = " << (void *) this << "\n";
			return this;
		}
	}

	int i;
};

CONSOLE_APP_MAIN
{
	Worker w;
	Upp::Cout() << "&w = " << (const void *) &w << "\n";
	Worker *w2 = w.Fn1();
	Upp::Cout() << "received = " << (const void *) w2 << "\n";
}

output is below. Notice that Fn1 incorrectly returns the null pointer. Both the non-invoked throw and the loop is important: if I remove any of them, the bug doesn't occur. Am I missing something? Wouldn't is be good idea to revert the included MinGW to a stable version?
&w = 0x12FF40
Test::Test()
returning this = 0x12FF40
Test::~Test()
received = 0x0


- hojtsy

[Updated on: Sun, 01 June 2008 18:00]

Report message to a moderator

Re: serious mingw bug? [message #16198 is a reply to message #16195] Sun, 01 June 2008 22:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Have you filed it in GCC's bugzilla? (remove U++ dependency before doing so Smile

Have you tested in Linux?

Mirek
Re: serious mingw bug? [message #16216 is a reply to message #16198] Mon, 02 June 2008 21:26 Go to previous messageGo to next message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
I downloaded latest mingw, c++ version reported is
"c++ (GCC) 4.3.0 20080305 (alpha-testing) mingw-20080502"

Whereas c++ version reported from mingw inside U++ is
"c++ (GCC TDM-2 for MinGW) 4.3.0"

The "4.3.0 20080305" version I have downloaded does not reproduce the bug, only the one in U++. It is not clear which version is newer, I suppose the "4.3.0 20080305" version is newer. Is it? Did you take c++ 4.3.0 from the mingw page earier?
It may be that this bug has been corrected in the meantime so that is why "4.3.0 20080305" does not reproduce it.

This bug breaks inline functions which have a throw inside INTERLOCKED_. That is how I noticed it.

I don't have a Linux box where I can test it, sorry.

-hojtsy
Re: serious mingw bug? [message #16218 is a reply to message #16216] Mon, 02 June 2008 22:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I guess this means we should update mingw from official mingw, correct?

Mirek
Re: serious mingw bug? [message #16282 is a reply to message #16218] Thu, 05 June 2008 23:12 Go to previous message
hojtsy is currently offline  hojtsy
Messages: 241
Registered: January 2006
Location: Budapest, Hungary
Experienced Member
luzr wrote on Mon, 02 June 2008 16:26

I guess this means we should update mingw from official mingw, correct?

Yes, if you have an older mingw version in U++. I don't know that from the version strings. How and when did you acquire the mingw that is part of latest U++ package?

- hojtsy
Previous Topic: Ideas for an SVN addition to theide
Next Topic: Task: How to read GTK/Gnome settings
Goto Forum:
  


Current Time: Thu Mar 28 11:29:35 CET 2024

Total time taken to generate the page: 0.01173 seconds