Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
249 Views

Compilation aborted (code 4) Error

I installed the latest Intel C compiler on a Linux machine.

I tried to build 32bit/64bit binaries to compare them with gcc-produced binaries.

However, Intel C compiler emits abort message when I try to compile 32bit coreutils. 

I just added '-m32' option to config file.

(gcc compiler successfully generates 32bit binary with same option.)

I cannot figure out why compilation is aborted? 

I add an error message as follows:

----------------------------------------------------------------------------------

...

CC lib/openat-die.o
CC lib/openat-safer.o
CC lib/parse-datetime.o
parse-datetime.y(308) (col. 12): internal error: 04010002_1870

compilation aborted for ../../../coreutils-8.30/lib/parse-datetime.c (code 4)
Makefile:9142: recipe for target 'lib/parse-datetime.o' failed
make[2]: *** [lib/parse-datetime.o] Error 4

...

----------------------------------------------------------------------------------

Machine: ubuntu-18.04 64-bit

ICC version: v19.1.2.254

Binary: coreutils-8.30

Labels (1)
0 Kudos
8 Replies
Highlighted
Moderator
219 Views

Hi,

 

It looks like a bug to me.

 

Could you please send the pre-processed file for parse-datetime.c (parse-datetime.i) or the minimal reproducible source file that is causing the error?

 

Is the 64-bit version of the same source file compilable with icc?

 

Thanks,

Rahul  

0 Kudos
Highlighted
Beginner
197 Views

Thank you for your reply.

I added '-save-temps' option into a Makefile but Intel C Compiler does not emit pre-processed file.

I read following document and I guess ICC removes the pre-processed file right after generating assembly file.

https://software.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-...

How can I produce pre-processed file?

 

Instead I post relevant source code as follows

----------------------------------------------------------------

   303 static bool
   304 apply_relative_time (parser_control *pc, relative_time rel, int factor)
   305 {
   306  if (factor < 0
   307      ? (INT_SUBTRACT_WRAPV (pc->rel.ns, rel.ns, &pc->rel.ns)
   308         | INT_SUBTRACT_WRAPV (pc->rel.seconds, rel.seconds, &pc->rel.seconds)
   309         | INT_SUBTRACT_WRAPV (pc->rel.minutes, rel.minutes, &pc->rel.minutes)
   310         | INT_SUBTRACT_WRAPV (pc->rel.hour, rel.hour, &pc->rel.hour)
   311         | INT_SUBTRACT_WRAPV (pc->rel.day, rel.day, &pc->rel.day)
   312         | INT_SUBTRACT_WRAPV (pc->rel.month, rel.month, &pc->rel.month)
   313         | INT_SUBTRACT_WRAPV (pc->rel.year, rel.year, &pc->rel.year))
   314      : (INT_ADD_WRAPV (pc->rel.ns, rel.ns, &pc->rel.ns)
   315         | INT_ADD_WRAPV (pc->rel.seconds, rel.seconds, &pc->rel.seconds)
   316         | INT_ADD_WRAPV (pc->rel.minutes, rel.minutes, &pc->rel.minutes)
   317         | INT_ADD_WRAPV (pc->rel.hour, rel.hour, &pc->rel.hour)
   318         | INT_ADD_WRAPV (pc->rel.day, rel.day, &pc->rel.day)
   319         | INT_ADD_WRAPV (pc->rel.month, rel.month, &pc->rel.month)
   320         | INT_ADD_WRAPV (pc->rel.year, rel.year, &pc->rel.year)))
   321    return false;
   322  pc->rels_seen = true;
   323  return true;
   324 }
----------------------------------------------------------------
file name: parse-datetime.y
 
- Hyungseok
0 Kudos
Highlighted
Moderator
192 Views

Can you look into your build log file (assume there is one), see how parse-datetime.c was compiled. Then replace -c with -E, remove -o parse-datetime.o and capture the output. That should give you a parse-datetime.i.


0 Kudos
Highlighted
Beginner
185 Views

Thank you for your advise.

I simplify error code as follows.

-----------------------------------------------------------------

static bool
apply_relative_time (parser_control *pc, relative_time rel, int factor)
 {
      int a = INT_ADD_WRAPV (pc->rel.ns, rel.ns, &pc->rel.ns)
                   | INT_ADD_WRAPV (pc->rel.seconds, rel.seconds, &pc->rel.seconds);

     /*
           if (factor < 0
            ? (INT_SUBTRACT_WRAPV (pc->rel.ns, rel.ns, &pc->rel.ns)
            | INT_SUBTRACT_WRAPV (pc->rel.seconds, rel.seconds, &pc->rel.seconds)
            | INT_SUBTRACT_WRAPV (pc->rel.minutes, rel.minutes, &pc->rel.minutes)
            | INT_SUBTRACT_WRAPV (pc->rel.hour, rel.hour, &pc->rel.hour)
            | INT_SUBTRACT_WRAPV (pc->rel.day, rel.day, &pc->rel.day)
            | INT_SUBTRACT_WRAPV (pc->rel.month, rel.month, &pc->rel.month)
            | INT_SUBTRACT_WRAPV (pc->rel.year, rel.year, &pc->rel.year))
            : (INT_ADD_WRAPV (pc->rel.ns, rel.ns, &pc->rel.ns)
            | INT_ADD_WRAPV (pc->rel.seconds, rel.seconds, &pc->rel.seconds)
            | INT_ADD_WRAPV (pc->rel.minutes, rel.minutes, &pc->rel.minutes)
            | INT_ADD_WRAPV (pc->rel.hour, rel.hour, &pc->rel.hour)
            | INT_ADD_WRAPV (pc->rel.day, rel.day, &pc->rel.day)
            | INT_ADD_WRAPV (pc->rel.month, rel.month, &pc->rel.month)
            | INT_ADD_WRAPV (pc->rel.year, rel.year, &pc->rel.year)))
            return false;
       */

     pc->rels_seen = true;
     return true;
}

-----------------------------------------------------------------

And this is the relevant code in the preprocessed file.

-----------------------------------------------------------------

apply_relative_time (parser_control *pc, relative_time rel, int factor)
int a = (sizeof *(&pc->rel . ns) == sizeof (signed char) ? (sizeof ((pc->rel . ns) + (rel . ns)) < sizeof (signed char) ? ((__builtin_add_overflow_p ((signed char) (pc->rel . ns), (signed char) (rel . ns), (__typeof__ (((signed char) (pc->rel . ns)) + ((signed char) (rel . ns)))) 0) || (((0 * (((signed char) (pc->rel . ns)) + ((signed char) (rel . ns))) - (1)) < 0) && (((signed char) (pc->rel . ns)) + ((signed char) (rel . ns))) < ((-127-1))) || (127) < (((signed char) (pc->rel . ns)) + ((signed char) (rel . ns)))) ? (*(&pc->rel . ns) = ((signed char) ((unsigned int) ((signed char) (pc->rel . ns)) + (unsigned int) ((signed char) (rel . ns)))), 1) : (*(&pc->rel . ns) = ((signed char) ((unsigned int) ((signed char) (pc->rel . ns)) + (unsigned int) ((signed char) (rel . ns)))), 0)) : ((__builtin_add_overflow_p (pc->rel . ns, rel . ns, (__typeof__ ((pc->rel . ns) + (rel . ns))) 0) || (((0 * ((pc->rel . ns) + (rel . ns)) - (1)) < 0) && ((pc->rel . ns) + (rel . ns)) < ((-127-1))) || (127) < ((pc->rel . ns) + (rel . ns))) ? (*(&pc->rel . ns) = ((signed char) ((unsigned int) (pc->rel . ns) + (unsigned int) (rel . ns))), 1) : (*(&pc->rel . ns) = ((signed char) ((unsigned int) (pc->rel . ns) + (unsigned int) (rel . ns))), 0))) : sizeof *(&pc->rel . ns) == sizeof (short int) ? (sizeof ((pc->rel . ns) + (rel . ns)) < sizeof (short int) ? ((__builtin_add_overflow_p ((short int) (pc->rel . ns), (short int) (rel . ns), (__typeof__ (((short int) (pc->rel . ns)) + ((short int) (rel . ns)))) 0) || (((0 * (((short int) (pc->rel . ns)) + ((short int) (rel . ns))) - (1)) < 0) && (((short int) (pc->rel . ns)) + ((short int) (rel . ns))) < ((-32767 -1))) || (32767) < (((short int) (pc->rel . ns)) + ((short int) (rel . ns)))) ? (*(&pc->rel . ns) = ((short int) ((unsigned int) ((short int) (pc->rel . ns)) + (unsigned int) ((short int) (rel . ns)))), 1) : (*(&pc->rel . ns) = ((short int) ((unsigned int) ((short int) (pc->rel . ns)) + (unsigned int) ((short int) (rel . ns)))), 0)) : ((__builtin_add_overflow_p (pc->rel . ns, rel . ns, (__typeof__ ((pc->rel . ns) + (rel . ns))) 0) || (((0 * ((pc->rel . ns) + (rel . ns)) - (1)) < 0) && ((pc->rel . ns) + (rel . ns)) < ((-32767 -1))) || (32767) < ((pc->rel . ns) + (rel . ns))) ? (*(&pc->rel . ns) = ((short int) ((unsigned int) (pc->rel . ns) + (unsigned int) (rel . ns))), 1) : (*(&pc->rel . ns) = ((short int) ((unsigned int) (pc->rel . ns) + (unsigned int) (rel . ns))), 0))) : sizeof *(&pc->rel . ns) == sizeof (int) ? (sizeof ((pc->rel . ns) + (rel . ns)) < sizeof (int) ? ((__builtin_add_overflow_p ((int) (pc->rel . ns), (int) (rel . ns), (__typeof__ (((int) (pc->rel . ns)) + ((int) (rel . ns)))) 0) || (((0 * (((int) (pc->rel . ns)) + ((int) (rel . ns))) - (1)) < 0) && (((int) (pc->rel . ns)) + ((int) (rel . ns))) < ((-2147483647 -1))) || (2147483647) < (((int) (pc->rel . ns)) + ((int) (rel . ns)))) ? (*(&pc->rel . ns) = ((int) ((unsigned int) ((int) (pc->rel . ns)) + (unsigned int) ((int) (rel . ns)))), 1) : (*(&pc->rel . ns) = ((int) ((unsigned int) ((int) (pc->rel . ns)) + (unsigned int) ((int) (rel . ns)))), 0)) : ((__builtin_add_overflow_p (pc->rel . ns, rel . ns, (__typeof__ ((pc->rel . ns) + (rel . ns))) 0) || (((0 * ((pc->rel . ns) + (rel . ns)) - (1)) < 0) && ((pc->rel . ns) + (rel . ns)) < ((-2147483647 -1))) || (2147483647) < ((pc->rel . ns) + (rel . ns))) ? (*(&pc->rel . ns) = ((int) ((unsigned int) (pc->rel . ns) + (unsigned int) (rel . ns))), 1) : (*(&pc->rel . ns) = ((int) ((unsigned int) (pc->rel . ns) + (unsigned int) (rel . ns))), 0))) : (sizeof *(&pc->rel . ns) == sizeof (long int) ? (sizeof ((pc->rel . ns) + (rel . ns)) < sizeof (long int) ? ((__builtin_add_overflow_p ((long int) (pc->rel . ns), (long int) (rel . ns), (__typeof__ (((long int) (pc->rel . ns)) + ((long int) (rel . ns)))) 0) || (((0 * (((long int) (pc->rel . ns)) + ((long int) (rel . ns))) - (1)) < 0) && (((long int) (pc->rel . ns)) + ((long int) (rel . ns))) < ((-2147483647 -1L))) || (2147483647) < (((long int) (pc->rel . ns)) + ((long int) (rel . ns)))) ? (*(&pc->rel . ns) = ((long int) ((unsigned long int) ((long int) (pc->rel . ns)) + (unsigned long int) ((long int) (rel . ns)))), 1) : (*(&pc->rel . ns) = ((long int) ((unsigned long int) ((long int) (pc->rel . ns)) + (unsigned long int) ((long int) (rel . ns)))), 0)) : ((__builtin_add_overflow_p (pc->rel . ns, rel . ns, (__typeof__ ((pc->rel . ns) + (rel . ns))) 0) || (((0 * ((pc->rel . ns) + (rel . ns)) - (1)) < 0) && ((pc->rel . ns) + (rel . ns)) < ((-2147483647 -1L))) || (2147483647) < ((pc->rel . ns) + (rel . ns))) ? (*(&pc->rel . ns) = ((long int) ((unsigned long int) (pc->rel . ns) + (unsigned long int) (rel . ns))), 1) : (*(&pc->rel . ns) = ((long int) ((unsigned long int) (pc->rel . ns) + (unsigned long int) (rel . ns))), 0))) : (sizeof ((pc->rel . ns) + (rel . ns)) < sizeof (long long int) ? ((__builtin_add_overflow_p ((long long int) (pc->rel . ns), (long long int) (rel . ns), (__typeof__ (((long long int) (pc->rel . ns)) + ((long long int) (rel . ns)))) 0) || (((0 * (((long long int) (pc->rel . ns)) + ((long long int) (rel . ns))) - (1)) < 0) && (((long long int) (pc->rel . ns)) + ((long long int) (rel . ns))) < ((-0x7fffffffffffffff-1LL))) || (0x7fffffffffffffff) < (((long long int) (pc->rel . ns)) + ((long long int) (rel . ns)))) ? (*(&pc->rel . ns) = ((long long int) ((unsigned long long int) ((long long int) (pc->rel . ns)) + (unsigned long long int) ((long long int) (rel . ns)))), 1) : (*(&pc->rel . ns) = ((long long int) ((unsigned long long int) ((long long int) (pc->rel . ns)) + (unsigned long long int) ((long long int) (rel . ns)))), 0)) : ((__builtin_add_overflow_p (pc->rel . ns, rel . ns, (__typeof__ ((pc->rel . ns) + (rel . ns))) 0) || (((0 * ((pc->rel . ns) + (rel . ns)) - (1)) < 0) && ((pc->rel . ns) + (rel . ns)) < ((-0x7fffffffffffffff-1LL))) || (0x7fffffffffffffff) < ((pc->rel . ns) + (rel . ns))) ? (*(&pc->rel . ns) = ((long long int) ((unsigned long long int) (pc->rel . ns) + (unsigned long long int) (rel . ns))), 1) : (*(&pc->rel . ns) = ((long long int) ((unsigned long long int) (pc->rel . ns) + (unsigned long long int) (rel . ns))), 0)))))
| (sizeof *(&pc->rel . seconds) == sizeof (signed char) ? (sizeof ((pc->rel . seconds) + (rel . seconds)) < sizeof (signed char) ? ((__builtin_add_overflow_p ((signed char) (pc->rel . seconds), (signed char) (rel . seconds), (__typeof__ (((signed char) (pc->rel . seconds)) + ((signed char) (rel . seconds)))) 0) || (((0 * (((signed char) (pc->rel . seconds)) + ((signed char) (rel . seconds))) - (1)) < 0) && (((signed char) (pc->rel . seconds)) + ((signed char) (rel . seconds))) < ((-127-1))) || (127) < (((signed char) (pc->rel . seconds)) + ((signed char) (rel . seconds)))) ? (*(&pc->rel . seconds) = ((signed char) ((unsigned int) ((signed char) (pc->rel . seconds)) + (unsigned int) ((signed char) (rel . seconds)))), 1) : (*(&pc->rel . seconds) = ((signed char) ((unsigned int) ((signed char) (pc->rel . seconds)) + (unsigned int) ((signed char) (rel . seconds)))), 0)) : ((__builtin_add_overflow_p (pc->rel . seconds, rel . seconds, (__typeof__ ((pc->rel . seconds) + (rel . seconds))) 0) || (((0 * ((pc->rel . seconds) + (rel . seconds)) - (1)) < 0) && ((pc->rel . seconds) + (rel . seconds)) < ((-127-1))) || (127) < ((pc->rel . seconds) + (rel . seconds))) ? (*(&pc->rel . seconds) = ((signed char) ((unsigned int) (pc->rel . seconds) + (unsigned int) (rel . seconds))), 1) : (*(&pc->rel . seconds) = ((signed char) ((unsigned int) (pc->rel . seconds) + (unsigned int) (rel . seconds))), 0))) : sizeof *(&pc->rel . seconds) == sizeof (short int) ? (sizeof ((pc->rel . seconds) + (rel . seconds)) < sizeof (short int) ? ((__builtin_add_overflow_p ((short int) (pc->rel . seconds), (short int) (rel . seconds), (__typeof__ (((short int) (pc->rel . seconds)) + ((short int) (rel . seconds)))) 0) || (((0 * (((short int) (pc->rel . seconds)) + ((short int) (rel . seconds))) - (1)) < 0) && (((short int) (pc->rel . seconds)) + ((short int) (rel . seconds))) < ((-32767 -1))) || (32767) < (((short int) (pc->rel . seconds)) + ((short int) (rel . seconds)))) ? (*(&pc->rel . seconds) = ((short int) ((unsigned int) ((short int) (pc->rel . seconds)) + (unsigned int) ((short int) (rel . seconds)))), 1) : (*(&pc->rel . seconds) = ((short int) ((unsigned int) ((short int) (pc->rel . seconds)) + (unsigned int) ((short int) (rel . seconds)))), 0)) : ((__builtin_add_overflow_p (pc->rel . seconds, rel . seconds, (__typeof__ ((pc->rel . seconds) + (rel . seconds))) 0) || (((0 * ((pc->rel . seconds) + (rel . seconds)) - (1)) < 0) && ((pc->rel . seconds) + (rel . seconds)) < ((-32767 -1))) || (32767) < ((pc->rel . seconds) + (rel . seconds))) ? (*(&pc->rel . seconds) = ((short int) ((unsigned int) (pc->rel . seconds) + (unsigned int) (rel . seconds))), 1) : (*(&pc->rel . seconds) = ((short int) ((unsigned int) (pc->rel . seconds) + (unsigned int) (rel . seconds))), 0))) : sizeof *(&pc->rel . seconds) == sizeof (int) ? (sizeof ((pc->rel . seconds) + (rel . seconds)) < sizeof (int) ? ((__builtin_add_overflow_p ((int) (pc->rel . seconds), (int) (rel . seconds), (__typeof__ (((int) (pc->rel . seconds)) + ((int) (rel . seconds)))) 0) || (((0 * (((int) (pc->rel . seconds)) + ((int) (rel . seconds))) - (1)) < 0) && (((int) (pc->rel . seconds)) + ((int) (rel . seconds))) < ((-2147483647 -1))) || (2147483647) < (((int) (pc->rel . seconds)) + ((int) (rel . seconds)))) ? (*(&pc->rel . seconds) = ((int) ((unsigned int) ((int) (pc->rel . seconds)) + (unsigned int) ((int) (rel . seconds)))), 1) : (*(&pc->rel . seconds) = ((int) ((unsigned int) ((int) (pc->rel . seconds)) + (unsigned int) ((int) (rel . seconds)))), 0)) : ((__builtin_add_overflow_p (pc->rel . seconds, rel . seconds, (__typeof__ ((pc->rel . seconds) + (rel . seconds))) 0) || (((0 * ((pc->rel . seconds) + (rel . seconds)) - (1)) < 0) && ((pc->rel . seconds) + (rel . seconds)) < ((-2147483647 -1))) || (2147483647) < ((pc->rel . seconds) + (rel . seconds))) ? (*(&pc->rel . seconds) = ((int) ((unsigned int) (pc->rel . seconds) + (unsigned int) (rel . seconds))), 1) : (*(&pc->rel . seconds) = ((int) ((unsigned int) (pc->rel . seconds) + (unsigned int) (rel . seconds))), 0))) : (sizeof *(&pc->rel . seconds) == sizeof (long int) ? (sizeof ((pc->rel . seconds) + (rel . seconds)) < sizeof (long int) ? ((__builtin_add_overflow_p ((long int) (pc->rel . seconds), (long int) (rel . seconds), (__typeof__ (((long int) (pc->rel . seconds)) + ((long int) (rel . seconds)))) 0) || (((0 * (((long int) (pc->rel . seconds)) + ((long int) (rel . seconds))) - (1)) < 0) && (((long int) (pc->rel . seconds)) + ((long int) (rel . seconds))) < ((-2147483647 -1L))) || (2147483647) < (((long int) (pc->rel . seconds)) + ((long int) (rel . seconds)))) ? (*(&pc->rel . seconds) = ((long int) ((unsigned long int) ((long int) (pc->rel . seconds)) + (unsigned long int) ((long int) (rel . seconds)))), 1) : (*(&pc->rel . seconds) = ((long int) ((unsigned long int) ((long int) (pc->rel . seconds)) + (unsigned long int) ((long int) (rel . seconds)))), 0)) : ((__builtin_add_overflow_p (pc->rel . seconds, rel . seconds, (__typeof__ ((pc->rel . seconds) + (rel . seconds))) 0) || (((0 * ((pc->rel . seconds) + (rel . seconds)) - (1)) < 0) && ((pc->rel . seconds) + (rel . seconds)) < ((-2147483647 -1L))) || (2147483647) < ((pc->rel . seconds) + (rel . seconds))) ? (*(&pc->rel . seconds) = ((long int) ((unsigned long int) (pc->rel . seconds) + (unsigned long int) (rel . seconds))), 1) : (*(&pc->rel . seconds) = ((long int) ((unsigned long int) (pc->rel . seconds) + (unsigned long int) (rel . seconds))), 0))) : (sizeof ((pc->rel . seconds) + (rel . seconds)) < sizeof (long long int) ? ((__builtin_add_overflow_p ((long long int) (pc->rel . seconds), (long long int) (rel . seconds), (__typeof__ (((long long int) (pc->rel . seconds)) + ((long long int) (rel . seconds)))) 0) || (((0 * (((long long int) (pc->rel . seconds)) + ((long long int) (rel . seconds))) - (1)) < 0) && (((long long int) (pc->rel . seconds)) + ((long long int) (rel . seconds))) < ((-0x7fffffffffffffff-1LL))) || (0x7fffffffffffffff) < (((long long int) (pc->rel . seconds)) + ((long long int) (rel . seconds)))) ? (*(&pc->rel . seconds) = ((long long int) ((unsigned long long int) ((long long int) (pc->rel . seconds)) + (unsigned long long int) ((long long int) (rel . seconds)))), 1) : (*(&pc->rel . seconds) = ((long long int) ((unsigned long long int) ((long long int) (pc->rel . seconds)) + (unsigned long long int) ((long long int) (rel . seconds)))), 0)) : ((__builtin_add_overflow_p (pc->rel . seconds, rel . seconds, (__typeof__ ((pc->rel . seconds) + (rel . seconds))) 0) || (((0 * ((pc->rel . seconds) + (rel . seconds)) - (1)) < 0) && ((pc->rel . seconds) + (rel . seconds)) < ((-0x7fffffffffffffff-1LL))) || (0x7fffffffffffffff) < ((pc->rel . seconds) + (rel . seconds))) ? (*(&pc->rel . seconds) = ((long long int) ((unsigned long long int) (pc->rel . seconds) + (unsigned long long int) (rel . seconds))), 1) : (*(&pc->rel . seconds) = ((long long int) ((unsigned long long int) (pc->rel . seconds) + (unsigned long long int) (rel . seconds))), 0)))));
pc->rels_seen = 1;
return 1;

------------------------------------------

Thank you 

0 Kudos
Highlighted
Moderator
180 Views

We would need to have a completed preprocess file along with your command line options in order to investigate the issue. Thanks


0 Kudos
Highlighted
Beginner
172 Views

I understand. Thanks.

I attach the pre-processed file and this is my compile option. 

Compile Option: icc -I. -I../../../coreutils-8.30 -I./lib -Ilib -I../../../coreutils-8.30/lib -Isrc -I../../../coreutils-8.30/src -m32 -ggdb -save-temps -fverbose-asm -O0 -fPIE -pie -MT lib/parse-datetime.o -MD -MP -MF lib/.deps/parse-datetime.Tpo -E ../../../coreutils-8.30/lib/parse-datetime.c

Thank you.

- Hyungseok

0 Kudos
Highlighted
Moderator
150 Views

Thanks for the preprocess file. I've reported this bug to our Developer.


0 Kudos
Highlighted
Beginner
143 Views

Thank you.

I am waiting for the result of error report.  

- Hyungseok

0 Kudos