[Bug c/56507] New: GCC -march=native for Core2Duo
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56507 Bug #: 56507 Summary: GCC -march=native for Core2Duo Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: bratsi...@gmail.com GCC -march=native includes only flags: -mmmx -msse -msse2 -msse3 -mssse3 but some Core2Duo processors have -msse4 -msse4.1.
[Bug c/56507] GCC -march=native for Core2Duo
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56507 --- Comment #2 from Alexander 2013-03-02 13:49:39 UTC --- (In reply to comment #1) > (In reply to comment #0) > > GCC -march=native includes only flags: -mmmx -msse -msse2 -msse3 -mssse3 > > but some Core2Duo processors have -msse4 -msse4.1. > > But yours must not. GCC's -march=native uses cpuid's flags field to see if > sse4/sse4.1 is supported. > > From driver-i386.c: > __cpuid (1, eax, ebx, ecx, edx); > ... > has_sse4_1 = ecx & bit_SSE4_1; > has_sse4_2 = ecx & bit_SSE4_2; > ... > const char *sse4_2 = has_sse4_2 ? " -msse4.2" : " -mno-sse4.2"; > const char *sse4_1 = has_sse4_1 ? " -msse4.1" : " -mno-sse4.1"; I have Core2Duo E8200, this is Wolfdale and this processor include SSE4.1.
[Bug c/56507] GCC -march=native for Core2Duo
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56507 --- Comment #4 from Alexander 2013-03-02 18:51:35 UTC --- (In reply to comment #3) > Can you invoke the following command: > cat /proc/cpuinfo I'm terribly sorry, something went wrong (several times), when I executed "gcc -march=native -Q --help=target", and -msse4.1 been unchecked.
[Bug c/54587] New: Error with constant in arithmetic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54587 Bug #: 54587 Summary: Error with constant in arithmetic Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: bratsi...@gmail.com If i enter: > printf("%x", 0x404e-0x4043); GCC give me error: > test.c: In function ‘main’: > test.c:164:15: error: invalid suffix "-0x4043" on integer constant If write: > printf("%x", 0x404e - 0x4043); everything all right.
[Bug c/50135] New: Loop optimization.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50135 Bug #: 50135 Summary: Loop optimization. Classification: Unclassified Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: bratsi...@gmail.com May be single-cycle should translate that: C code: for(unsigned int i=0; i<123456; i++) or for(unsigned int i=123456; i>0; i--) Assembler code: movq 123456, %rcx L0: loop LO
[Bug c/50136] New: Loop inc/dec optimization.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50136 Bug #: 50136 Summary: Loop inc/dec optimization. Classification: Unclassified Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: bratsi...@gmail.com Maybe shoud use inc and dec, than sub $1, %ebx? GCC translate this C code: unsigned int i; scanf("%u", &i); for(unsigned int qwe=i; qwe>0; qwe--) printf("fg"); Into this Assembler code: leaq12(%rsp), %rsi xorl%eax, %eax movl$.LC0, %edi call__isoc99_scanf movl12(%rsp), %ebx testl%ebx, %ebx je.L2 .p2align 4,,10 .p2align 3 .L4: xorl%eax, %eax movl$.LC1, %edi callprintf subl$1, %ebx ;This not good, dec %ebx is better jne.L4
[Bug c/50992] New: abs() and cabs()
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50992 Bug #: 50992 Summary: abs() and cabs() Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: bratsi...@gmail.com gcc does not see an obvious error. Code: complex double Z; abs(Z); abs() even not a fabsl()! And this code work!
[Bug c/50992] abs() and cabs()
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50992 --- Comment #2 from Alexander 2011-11-04 14:59:53 UTC --- Created attachment 25714 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25714 NULL I right now noticed that abs() just return real part of complex number.
[Bug c/50992] abs() and cabs()
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50992 Alexander changed: What|Removed |Added Summary|Wconversion does not handle |abs() and cabs() |complex type conversions| --- Comment #4 from Alexander 2011-11-04 15:12:13 UTC --- (In reply to comment #3) > #include > > extern int abs(int); > int foo(void) { > complex double Z = 0.1 + 0.2I; > return abs(Z); > } > > GCC says nothing with -Wall -Wextra -Wconversion, because > c-common.c:conversion_warnings() does not handle complex variables. > > Clang: > > test.c:6:14: warning: implicit conversion discards imaginary component: > '_Complex double' to 'int' [-Wconversion] > return abs(Z); > ~~~ ^ > 1 warning generated. I noticed. So what? Why was this done?
[Bug c/50992] Wconversion does not handle complex type conversions
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50992 Alexander changed: What|Removed |Added Severity|enhancement |normal --- Comment #6 from Alexander 2011-11-04 15:22:53 UTC --- (In reply to comment #5) > (In reply to comment #4) > > > > I noticed. So what? Why was this done? > > It is just not implemented yet. Someone needs to want it enough to implement > it. May be people just not see that thing, like me(I noticed this only after a couple of hours).
[Bug target/89951] New: Uncorrect flag for Nehalem / westmere
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89951 Bug ID: 89951 Summary: Uncorrect flag for Nehalem / westmere Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: bratsinot at gmail dot com Target Milestone: --- gcc set uncorrect flags -mavx256-split-unaligned-load and -mavx256-split-unaligned-store when use -march=native or Nehalem / westmere arch. Nehalem / westmere don't have AVX instruction set. So program with these instructions build incorrectly. For example: # gcc -march=westmere -Q --help=target ... | grep avx -mavx [disabled] <...> -mavx256-split-unaligned-load [enabled] -mavx256-split-unaligned-store[enabled] <...>
[Bug target/89951] Uncorrect instructions flag for Nehalem / westmere arch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89951 --- Comment #4 from Alexander --- (In reply to Uroš Bizjak from comment #2) > These two flags are irrelevant without -mavx. But, for example, when i build Qt5 gcc give error about these two instructions.
[Bug target/89951] Uncorrect instructions flag for Nehalem / westmere arch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89951 --- Comment #6 from Alexander --- (In reply to Martin Liška from comment #5) > What kind of error? Can you please provide a test-case? Like these: > cd gui/ && ( test -e Makefile || > /tmp/qt-everywhere-src-5.12.1/qtbase/bin/qmake -o Makefile > /tmp/qt-everywhere-src-5.12.1/qtbase/src/gui/gui.pro ) && make -f Makefile > make[3]: Entering directory '/tmp/qt-everywhere-src-5.12.1/qtbase/src/gui' > g++ -c -pipe -Os -mtune=native -march=native -mno-avx256-split-unaligned-load > -mno-avx256-split-unaligned-store -pipe -fPIC -O3 -std=c++1z > -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W > -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow > -D_REENTRANT -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH > -DENABLE_PIXMAN_DRAWHELPERS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT > -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII > -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER > -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x05 > -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG > -DQT_CORE_LIB -march=core-avx2 -I. -I../../include -I../../include/QtGui > -I../../include/QtGui/5.12.1 -I../../include/QtGui/5.12.1/QtGui -I.tracegen > -isystem /usr/include/libdrm -I../../include/QtCore/5.12.1 > -I../../include/QtCore/5.12.1/QtCore -I../../include/QtCore -I.moc -isystem > /usr/include/libpng16 -I../3rdparty/harfbuzz-ng/include > -I../../mkspecs/linux-g++ painting/qdrawhelper_avx2.cpp -o > .obj/qdrawhelper_avx2.o > painting/qdrawhelper_avx2.cpp: In function ‘void > BLEND_SOURCE_OVER_ARGB32_AVX2(quint32*, const quint32*, int)’: > painting/qdrawhelper_avx2.cpp:143:43: warning: AVX vector return without AVX > enabled changes the ABI [-Wpsabi] > const __m256i half = _mm256_set1_epi16(0x80); > ~^~ > In file included from > /usr/lib64/gcc/x86_64-slackware-linux/8.3.0/include/immintrin.h:43, > from > ../../include/QtCore/5.12.1/QtCore/private/../../../../../src/corelib/tools/qsimd_p.h:191, > from ../../include/QtCore/5.12.1/QtCore/private/qsimd_p.h:1, > from painting/qdrawhelper_p.h:65, > from painting/qdrawhelper_avx2.cpp:40: > /usr/lib64/gcc/x86_64-slackware-linux/8.3.0/include/avx2intrin.h: In function > ‘void BYTE_MUL_AVX2(__m256i&, const __m256i&, const __m256i&, const > __m256i&)’: > /usr/lib64/gcc/x86_64-slackware-linux/8.3.0/include/avx2intrin.h:574:1: > error: inlining failed in call to always_inline ‘__m256i > _mm256_or_si256(__m256i, __m256i)’: target specific option mismatch > _mm256_or_si256 (__m256i __A, __m256i __B) But now i see, than Qt5 add additional -march=core-avx2 in FLAGS, so yeah, it's not gcc problem.
[Bug c/55646] New: Array of data as argument
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55646 Bug #: 55646 Summary: Array of data as argument Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: bratsi...@gmail.com If wrote this: > fwrite("\xAA\xBB\xCC\x0A", 1, 4, stdout); gcc put in .data/.text section one piece of data, something like that: > .string "\252\273\314\n" But if wrote this: > fwrite((uint8_t[]){0xAA,0xBB,0xCC,0x0A}, 1, 4, stdout); gcc will put the data bit by bit in stack, something like that: > movb $-86, (%rsp) > movb $-69, 1(%rsp) > movb $-52, 2(%rsp) > movb $10, 3(%rsp) P.S. Build with -O3
[Bug c/55646] Array of data as argument
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55646 --- Comment #1 from Alexander 2012-12-11 14:07:21 UTC --- If write this: > static const uint8_t qwe[] = {0xAA,0xBB,0xCC,0x0A}; > fwrite(qwe, 1, 4, stdout); gcc put data in one piece, something like that: > qwe.2230: > .byte -86 > .byte -69 > .byte -52 > .byte 10 P.S.S. Sorry for my mistakes, English not my native language.