- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
How can I produce pre-processed file?
Instead I post relevant source code as follows
----------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We would need to have a completed preprocess file along with your command line options in order to investigate the issue. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the preprocess file. I've reported this bug to our Developer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
I am waiting for the result of error report.
- Hyungseok
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It will take sometime before this bug can be fixed.
In the meantime can you add this as a workaround?
long long fake_result;
#define __builtin_add_overflow_p(x,y,z) __builtin_add_overflow(x,y,(typeof(z) *)&fake_result)
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Have you tried the workaround? Please let us know if it works for you, then we can close this thread.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are going to close this thread as we have provided a workaround. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.
Thanks,
Viet

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page