Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

slight delay when a console application exit

mrusso
초보자
2,298 조회수

Hi,

I made a console application which print something and then exit, after printing instead of exit immediately, like the same application compiled with other compilers it delays the exit, what would be the reason for that?

0 포인트
1 솔루션
mrusso
초보자
1,983 조회수

Ok I found the issue:

Basically before the loop that follows, I have:

v85 = v5 + 1;

v87 = 1;

for ( j = v87; j <= v83; ++j ) //V87 TRAIN FROM, V83 PREDICT TO

{

  *(int *)(handle + sizeof(int) * j) = *(int *)(byte_4BC818 + sizeof(int) * j); 

}

 

so I had to move the line v85 = v5 + 1; after the scanf that counts how many values are in the data file, v5 is the counter.

원본 게시물의 솔루션 보기

0 포인트
11 응답
Alex_Y_Intel
중재자
2,205 조회수

Why is it related to Intel DPC++/C++ compiler? 

0 포인트
mrusso
초보자
2,199 조회수

Hi,

The issue seems related to optimization, when turned off, works fine, when turn on, sometime got output and sometime no output but always delay in exit.

0 포인트
Alex_Y_Intel
중재자
2,198 조회수

A reproducer and exact commands used need to be provided for understanding your issue. 

0 포인트
mrusso
초보자
2,044 조회수

These are the commands:

icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED
icx /QxHOST /O1 /Qansi-alias VRA.c -o VRASIZE
icx /QxHOST /O2 /Qansi-alias -Qipo VRA.c -o VRASPEED1
icx /QxHOST /O3 /Qansi-alias -Qipo VRA.c -o VRAMAXSPEED
icx /QxHOST /Os /Qansi-alias VRA.c -o VRASIZE2
icx /QxHOST /Ot /Qiiansi-alias -Qipo VRA.c -o VRASPEED2
icx /QxHOST /Od /Qansi-alias -Qipo VRA.c -o VRADISABLE ; THIS IS THE ONLY ONE THAT WORKS FINE.

 

and also tried:

 

icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED -fprofile-instr-generate
VRASPEED 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED -fprofile-instr-use=code.profdata

icx /QxHOST /O1 /Qansi-alias VRA.c -o VRASIZE -fprofile-instr-generate
VRASIZE 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /O1 /Qansi-alias VRA.c -o VRASIZE -fprofile-instr-use=code.profdata

icx /QxHOST /O2 /Qansi-alias -Qipo VRA.c -o VRASPEED1 -fprofile-instr-generate
VRASPEED1 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /O2 /Qansi-alias -Qipo VRA.c -o VRASPEED1 -fprofile-instr-use=code.profdata


icx /QxHOST /O3 /Qansi-alias -Qipo VRA.c -o VRAMAXSPEED -fprofile-instr-generate
VRAMAXSPEED 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /O3 /Qansi-alias -Qipo VRA.c -o VRAMAXSPEED -fprofile-instr-use=code.profdata


icx /QxHOST /Os /Qansi-alias VRA.c -o VRASIZE2 -fprofile-instr-generate
VRASIZE2 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Os /Qansi-alias VRA.c -o VRASIZE2 -fprofile-instr-use=code.profdata


icx /QxHOST /Ot /Qiiansi-alias -Qipo VRA.c -o VRASPEED2 -fprofile-instr-generate
VRASPEED2 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED2 -fprofile-instr-use=code.profdata


icx /QxHOST /Od /Qansi-alias -Qipo VRA.c -o VRADISABLE -fprofile-instr-generate
VRADISABLE 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Od /Qansi-alias -Qipo VRA.c -o VRADISABLE -fprofile-instr-use=code.profdata

 

 

0 포인트
mrusso
초보자
2,044 조회수

icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED
icx /QxHOST /O1 /Qansi-alias VRA.c -o VRASIZE
icx /QxHOST /O2 /Qansi-alias -Qipo VRA.c -o VRASPEED1
icx /QxHOST /O3 /Qansi-alias -Qipo VRA.c -o VRAMAXSPEED
icx /QxHOST /Os /Qansi-alias VRA.c -o VRASIZE2
icx /QxHOST /Ot /Qiiansi-alias -Qipo VRA.c -o VRASPEED2
icx /QxHOST /Od /Qansi-alias -Qipo VRA.c -o VRADISABLE

 

 

 

 

 

icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED -fprofile-instr-generate
VRASPEED 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED -fprofile-instr-use=code.profdata

icx /QxHOST /O1 /Qansi-alias VRA.c -o VRASIZE -fprofile-instr-generate
VRASIZE 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /O1 /Qansi-alias VRA.c -o VRASIZE -fprofile-instr-use=code.profdata

icx /QxHOST /O2 /Qansi-alias -Qipo VRA.c -o VRASPEED1 -fprofile-instr-generate
VRASPEED1 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /O2 /Qansi-alias -Qipo VRA.c -o VRASPEED1 -fprofile-instr-use=code.profdata


icx /QxHOST /O3 /Qansi-alias -Qipo VRA.c -o VRAMAXSPEED -fprofile-instr-generate
VRAMAXSPEED 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /O3 /Qansi-alias -Qipo VRA.c -o VRAMAXSPEED -fprofile-instr-use=code.profdata


icx /QxHOST /Os /Qansi-alias VRA.c -o VRASIZE2 -fprofile-instr-generate
VRASIZE2 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Os /Qansi-alias VRA.c -o VRASIZE2 -fprofile-instr-use=code.profdata


icx /QxHOST /Ot /Qiiansi-alias -Qipo VRA.c -o VRASPEED2 -fprofile-instr-generate
VRASPEED2 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED2 -fprofile-instr-use=code.profdata


icx /QxHOST /Od /Qansi-alias -Qipo VRA.c -o VRADISABLE -fprofile-instr-generate
VRADISABLE 1.txt 3 2
llvm-profdata merge -output=code.profdata default.profraw
icx /QxHOST /Od /Qansi-alias -Qipo VRA.c -o VRADISABLE -fprofile-instr-use=code.profdata

 

0 포인트
mrusso
초보자
2,187 조회수

icx /QxHOST /Ot /Qansi-alias -Qipo VRA.c -o VRASPEED
icx /QxHOST /O1 /Qansi-alias VRA.c -o VRASIZE
icx /QxHOST /O2 /Qansi-alias -Qipo VRA.c -o VRASPEED1
icx /QxHOST /O3 /Qansi-alias -Qipo VRA.c -o VRAMAXSPEED
icx /QxHOST /Os /Qansi-alias VRA.c -o VRASIZE2
icx /QxHOST /Ot /Qiiansi-alias -Qipo VRA.c -o VRASPEED2
icx /QxHOST /Od /Qansi-alias -Qipo VRA.c -o VRADISABLE

 

 

 

 

 

 

 

0 포인트
Alex_Y_Intel
중재자
2,170 조회수

What is VRA.c ?

0 포인트
mrusso
초보자
2,166 조회수
0 포인트
Alex_Y_Intel
중재자
2,147 조회수

We need to have your VRA.c source file to duplicate your observation and investigate it. 

0 포인트
mrusso
초보자
2,138 조회수

to run as vra.exe 1.txt 3 2

Also please note that it works only if optimizations are disabled.

On same other compilers it works even with optimizations.

0 포인트
mrusso
초보자
1,985 조회수

Ok I found the issue:

Basically before the loop that follows, I have:

v85 = v5 + 1;

v87 = 1;

for ( j = v87; j <= v83; ++j ) //V87 TRAIN FROM, V83 PREDICT TO

{

  *(int *)(handle + sizeof(int) * j) = *(int *)(byte_4BC818 + sizeof(int) * j); 

}

 

so I had to move the line v85 = v5 + 1; after the scanf that counts how many values are in the data file, v5 is the counter.

0 포인트
응답