472,958 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

[MC++] Internal Compiler Error with /Ox

I am not sure if this is related to my previous thread
("NullReferenceException with value struct") so I am starting a new
thread.

I saw in
http://msdn.microsoft.com/library/de...nagedtypes.asp

they mention that value types cannot contain pointers to other managed
types. In my __value struct, I had an array of other __value objects,
so I changed it to an unmanaged array. Now, when I compile using /Ox
for full optimization, I get an Internal Compiler Error.

Can anybody propose a workaround? Upgrading to VS 2005 is not an option
at the time.
// Test.h
#pragma once

#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>

namespace ICE
{
public __gc class Test : public System::Windows::Forms::Form
{
public:
Test(void) { }

static const int max_contours = 5;

__value struct Contours {
int num_contours;

__value struct ContourInfo {
double lower_bound;
int r;
int g;
int b;
} contours __nogc[max_contours];

//ContourInfo contours[];

//Contours()
// : contours(new ContourInfo[max_contours])
//{ }
};

protected:
void Dispose(System::Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}

private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container* components;

private:
bool is_blank(const Contours& contours)
{
Contours::ContourInfo empty = {0, 0, 0, 0};
bool blank = true;
for (int i = 0; i < contours.num_contours; ++i) {
if (!__box(contours.contours[i])->Equals(__box(empty))) {
blank = false;
}
}

return blank;
}
};
}
// Test.cpp
#include "Test.h"
#include <windows.h>

#using <mscorlib.dll>

int main()
{
ICE::Test* t = new ICE::Test;
}
Compile command:
cl /clr /Ox Test.cpp
Output:
Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET Framework
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

Test.cpp
c:\documents and settings\kwokmb1\my documents\work\code\test.h(61) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'f:\vs70builds\3077\vc\Compiler\Utc\src\p2\wvm\mdm iscw.c', line 754)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Note: The compiler file they list above does not exist on my system.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
May 15 '06 #1
1 1578
Marcus Kwok <ri******@gehennom.invalid> wrote:
I saw in
http://msdn.microsoft.com/library/de...nagedtypes.asp

they mention that value types cannot contain pointers to other managed
types. In my __value struct, I had an array of other __value objects,
so I changed it to an unmanaged array. Now, when I compile using /Ox
for full optimization, I get an Internal Compiler Error.
It turns out that any of the optimization switches I tried resulted in
the ICE.
Can anybody propose a workaround? Upgrading to VS 2005 is not an option
at the time.

bool is_blank(const Contours& contours)
{
Contours::ContourInfo empty = {0, 0, 0, 0};
bool blank = true;
for (int i = 0; i < contours.num_contours; ++i) {
if (!__box(contours.contours[i])->Equals(__box(empty))) {
blank = false;
}
}

return blank;
}


I changed this to

bool is_blank(const Contours& contours)
{
bool blank = true;
for (int i = 0; i < contours.num_contours; ++i) {
if ((contours.contours[i].lower_bound != 0.0) ||
(contours.contours[i].r != 0) ||
(contours.contours[i].g != 0) ||
(contours.contours[i].b != 0)) {
blank = false;
}
}

return blank;
}

and I no longer get the ICE.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
May 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: paul calvert | last post by:
I hope somewhere here has encountered and solved a similar problem in the past. 1) on a new Win2000 PC: installed Visual C++ 6.0 download & install single file Service Pack 5.0 2) try to...
16
by: pj | last post by:
(Was originally, probably wrongly, posted to the vc subgroup.) (This doesn't appear to be a c# problem, but a problem with a bug in the Visual Studio c# compiler, but, any help will be welcome...)...
1
by: Ayende Rahien | last post by:
reparing resources... Updating references... Performing main compilation... error CS0583: Internal Compiler Error (0xc0000005 at address 53168B12): likely culprit is 'BIND'. An internal...
4
by: David Sworder | last post by:
Consider the following line of code (it's not important what it does): resp.DocItem=Relations.SelectDocItems_BySearchString(req.SearchPhrase); It turns out that this line is in error. The...
8
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock...
2
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a...
1
by: mahesh | last post by:
I am trying to pass C# object to MC++ as one of the method Parameter. I am getting following Fatal error. fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 2701) Please...
0
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is...
8
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.