Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Internal error while building gcc 4.6.1

king_duckz
Beginner
483 Views
Hello, I've just downloaded gcc 4.6.1 and I'm trying to build it using icc/icpc. My compiler version is 12.0. Everything went well (gmp, isl, mpfr, mpc, cloog, ppl), but I get many internal errors on libcpp/lex.c. I could work around some of them by adding #ifndef __INTEL_COMPILER, but i got one on a opening { following a function declaration that I don't see how to solve. I could successfully build both gcc 4.5.3 and gcc 4.6.0, so this must've been introduced recently. Is this problem knewn already? Is there any workaround or even better, a fix? If so, when is the new release due?
0 Kudos
7 Replies
mecej4
Honored Contributor III
483 Views
I cannot vouch for this but in the past I had come across extensions to C that were present in GCC that were not supported by other compilers. Some of these extensions may have been created specifically to make self-generation of GCC possible.

A simple work-around is to compile just those sources that need the extensions with GCC, and the rest with ICC. Would that work for you?
0 Kudos
TimP
Honored Contributor III
483 Views

If you want this looked into, you should file a problem report on your premier.intel.com account. You haven't given enough information here (specific icc version, options, ....), and, preferably, the pre-processed source code.

I doubt that anyone routinely attempts to build gcc with icc; at best, it would enable you to accomplish the same thing as with a normal gcc.

0 Kudos
king_duckz
Beginner
483 Views

Hello TimP, I tried to login at the address you provided but it's quite strange. Anyways, it just says the system can't authenticate me, and I don't really know why (user and password should be correct). It's not as if I "want" the problem looked into anyways, I'm just reporting a problem I met to the developers, much as I do with other softwares. If no one is making the same builds as me, then I guess my bug report won't be a duplicate ;)

I'm sorry for the lack of informations, I posted from another computer from which I didn't have access to the detailed error. I don't know how to dump preprocessed files, if you tell me how to do that I'll be glad to post it here.

So, here we go:

checking for modern makeinfo... (cached) no
configure: WARNING:
*** Makeinfo is missing or too old.
*** Info documentation will not be built.
checking for recent Pod::Man... .././../libcpp/include/cpplib.h(500): warning #1286: invalid attribute for "unsigned char (*)(cpp_reader *, int, int, source_location={unsigned int}, unsigned int, const char *, va_list *)"
ATTRIBUTE_FPTR_PRINTF(6,0);
^

.././../libcpp/include/cpplib.h(500): warning #1287: invalid attribute for field "error"
ATTRIBUTE_FPTR_PRINTF(6,0);
^

.././../libcpp/lex.c(345) (col. 11): warning #964: no EMMS instruction before call

.././../libcpp/lex.c(372) (col. 1): internal error: 0_1845

compilation aborted for .././../libcpp/lex.c (code 4)

and the code around line 372 looks like this (opening "{" is line 372):

static const uchar *
#ifndef __SSE2__
__attribute__((__target__("sse2")))
#endif
search_line_sse2 (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
{
typedef char v16qi __attribute__ ((__vector_size__ (16)));

const v16qi repl_nl = *(const v16qi *)repl_chars[0];


I hope it helps. Let me know if you need more info about this issue!

0 Kudos
TimP
Honored Contributor III
483 Views
I'm not a compiler expert, but it still looks important to see exactly what source code is left after pre-processing: is it the same as would be passed to gcc (presumably you set options which should have defined __SSE2__ ?) and what code triggered the internal error (should have either worked or triggered an error message).
If your license hasn't been registered, registering it at https://registrationcenter.intel.com should create the account with the credentials of your choice. In the event of difficulty with registration, there is a companion forum for quicker resolution of registration problems.
0 Kudos
Dale_S_Intel
Employee
483 Views
I am a compiler expert (or at least that's what I tell my boss :-), so perhaps I can help. Tim's right, it would be helpful to see the preprocessed file. You can produce it with -E and redirect the output to a ".i" file. Gcc and ICC will produce different preprocessed files (some header files are differen), so if you could post both (one built with gcc and one built with icc) that might be helpful as well, but at least posting the one that produces the internal error would make it easier for me to investigate further.
Dale
0 Kudos
king_duckz
Beginner
483 Views

Ok, here is what you asked for:http://www.box.net/shared/zhqab1m64ng5c9ipihx2

It includes both preprocessed files and the original source file (not header files, but you got them in the .i files). The .c file differs from the original one you can find on gcc's website, as I added a few ifdefs and an #include when __INTEL_COMPILER is defined, in order to fix previous build errors.

Again, here is my icc version:

$ icc --version
icc (ICC) 12.0.4 20110427
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.

I'll try to do as TimP said later during my lunch break and try to file a bug report. Thank you, and don't hesitate to ask if you need me to do something else.

0 Kudos
Greeshma_Y_Intel
Employee
483 Views
Hi,

Sorry in the delay in reply. Did you manage to file a problem report? I was able to narrow down the problem to these few lines of code :

t |= acc_char_cmp (val, repl_cr);

t |= acc_char_cmp (val, repl_bs);

t |= acc_char_cmp (val, repl_qm);

For some reason, icc is not able to understand the |=. I will file a bug report and keep you updated once I hear back from the developers.
Greeshma

0 Kudos
Reply