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]

bug in egcs



?c++ -c sample.cpp
sample.cpp: In function `int main(int, char **)':
sample.cpp:31: Internal compiler error.
sample.cpp:31: Please submit a full bug report to `egcs-bugs@cygnus.com'.
?c++ -c -DWORKAROUND=1 sample.cpp
?

-- sample.cpp --

#include <stdio.h>
#include <stdlib.h>

void evilRises (void **ptr)
{
    int *pi;
    
    pi = new int;

    *pi = 0;
    
    *ptr = (void *)pi;
}

int main (int argc, char *argv[])
{
#ifdef WORKAROUND
    union foo
#else
    union
#endif
    {
        int a;
        int b;
        int c;
    } *fred, barney;
    
    evilRises((void **)&fred);
    
    barney = *fred;
    
    return EXIT_SUCCESS;
}

Doug, Speaking Only For Himself (I do NOT REPRESENT VISIX!)
-- doug@visix.com



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