Re: Optimization bug in VC++ 6.0
From: Joe Hagen (jdhagen_at_chorus.net)
Date: 03/23/04
- Next message: H: "Re: (MSVCRT.DLL): 0xC0000005: Access Violation"
- Previous message: Emmanuel Stapf: "Re: Optimization bug in VC++ 6.0"
- In reply to: Emmanuel Stapf: "Optimization bug in VC++ 6.0"
- Next in thread: Alexander Grigoriev: "Re: Optimization bug in VC++ 6.0"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Mar 2004 17:14:51 -0600
Emmanuel Stapf wrote:
> Hi,
>
> The following code fails to compile and cl (VC++ 6.0 SP5) returns an
> internal error.
>
> extern void f();
>
> void *tab[40];
> void tab_init () {
> long i;
> for (i = 8; i < 11; i++) {
> tab[i] = (void *) f;
> }
> }
>
> command line used: cl -Ox -c a.c
>
> compiler output:
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for
> 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
>
> a.c(7) : fatal error C1001: INTERNAL COMPILER ERROR
> (compiler file 'E:\8966\vc98\p2\src\P2\main.c', line
> 494) Please choose the Technical Support command on the Visual C++
> Help menu, or open the Technical Support help file for more
> information
>
> Seems that it is fixed in later version of VC++, but I still need to
> use VC 6.0.
>
> My question is how can I rewrite this code without disabling the
> optimizations and without the internal compiler error.
>
> Thanks in advance,
> Manu
Manu,
One workaround, although the code generated may not be as
optimal, is to declare "i" as volatile.
Joe
- Next message: H: "Re: (MSVCRT.DLL): 0xC0000005: Access Violation"
- Previous message: Emmanuel Stapf: "Re: Optimization bug in VC++ 6.0"
- In reply to: Emmanuel Stapf: "Optimization bug in VC++ 6.0"
- Next in thread: Alexander Grigoriev: "Re: Optimization bug in VC++ 6.0"
- Messages sorted by: [ date ] [ thread ]