[Bug c++/91235] Array size expression is implicitly casted to unsigned long type

2019-08-29 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91235 --- Comment #1 from Daniel Fruzynski --- I checked that trunk gcc also accepts this code, both with -std=c++11 and -std=c++1z. Clang also compiles this without error. Could someone take a look on this and add some comment here?

[Bug c++/91235] New: Array size expression is implicitly casted to unsigned long type

2019-07-23 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] void foo(char*); inline void bar(int n) { if (__builtin_constant_p(n)) { char a[(int)(n == 2 ? -1 : 0

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #21 from Daniel Fruzynski --- I have increased stack size on Linux to 800MB, verified that ulimit -s reports new value and run gcc again - it crashed again.

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #20 from Daniel Fruzynski --- gcc 8.2.0 does not crash on this code. I tried to use sgcheck, but without luck - it exited on some assertion failure.

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #18 from Daniel Fruzynski --- Unfortunately default Valgrind tool (memcheck) does not look for stack issues. It has separate tool (sgcheck) which does this. I will try to use it too and see if it will something. One more thing come

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #16 from Daniel Fruzynski --- I checked it using Git Bash and got 2048.

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #14 from Daniel Fruzynski --- How to check default stack size? I found that ld has --stack option to set it, but I cannot find a way to check default. I tried to dump default linker script using --verbose when linking, but there was

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #10 from Daniel Fruzynski --- If I recall correctly, I tried it on 8.2 or 8.3 crosscompiler too, and it worked there. However I am not sure if I used the same command to run it. I will check this later after I return home.

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #7 from Daniel Fruzynski --- Preprocessed source is in 1st attachment here.

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-14 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #5 from Daniel Fruzynski --- Created attachment 46356 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46356=edit Valgrind log Here is Valgrind log. It found multiple cases when uninitialized value vas used. However in all cases

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-14 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #3 from Daniel Fruzynski --- Created attachment 46355 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46355=edit Source code which triggers crash I added code which causes crash when compiling. Here is command which I used on

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-14 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #2 from Daniel Fruzynski --- I was able to reproduce crash using MinGW crosscompiler build for CentOS 7, configured in following way: ../gcc-7.4.0/configure --prefix=/root/gcc-7.4.0-mingw64 --build=x86_64-redhat-linux-gnu

[Bug debug/90471] ICE Segmentation fault when compiling with debug info

2019-05-14 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471 --- Comment #1 from Daniel Fruzynski --- Created attachment 46354 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46354=edit MinGW package versions

[Bug c/90471] New: ICE Segmentation fault when compiling with debug info

2019-05-14 Thread bugzi...@poradnik-webmastera.com
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Created attachment 46353 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46353=edit Preprocessed code I got ICE Segmentation fault when trying to build Ope

[Bug c/90293] New function attribute: expect_return

2019-04-30 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90293 --- Comment #1 from Daniel Fruzynski --- One more case: sometimes it may be more handy to specify what will *not* be usually returned, e.g. special invalid value. For such cases another attribute would be needed:

[Bug c/90293] New: New function attribute: expect_return

2019-04-30 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I have an idea of new function attribute: expect_return. It would allow to specify value usually returned from function, so it could help with optimization in similar way like

[Bug tree-optimization/89317] Ineffective code from std::copy

2019-02-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89317 --- Comment #2 from Daniel Fruzynski --- Yes, I mean inefficient.

[Bug c++/89317] New: Ineffective code from std::copy

2019-02-12 Thread bugzi...@poradnik-webmastera.com
++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- gcc produces ineffective code when std::copy is used to copy data. For test I created my own version of std::copy and this version is optimized properly. Compiles using g++ (GCC

[Bug c/88963] New: gcc generates terrible code for vectors of 64+ length which are not natively supported

2019-01-21 Thread bugzi...@poradnik-webmastera.com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] typedef int VInt __attribute__((vector_size(64))); void test(VInt*__restrict a, VInt*__restrict b

[Bug c/88959] Unnecessary xor before bsf/tzcnt

2019-01-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88959 --- Comment #1 from Daniel Fruzynski --- I have found that this extra xor is not added when compiling with -O3 -march=sandybridge or -O3 -march=ivydybridge. However with -O3 -march=sandybridge/ivydybridge -mbmi it is added.

[Bug c/88959] New: Unnecessary xor before bsf/tzcnt

2019-01-21 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] int test(int x) { return __builtin_ctz(x); } [/code] gcc 4.9.1 with -O3 produces this: [asm] test(int): rep bsf eax, edi ret [/asm] And this with -O3 -mbmi: [asm

[Bug target/71659] _xgetbv intrinsic missing

2019-01-17 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659 --- Comment #5 from Daniel Fruzynski --- I meant pr85684

[Bug target/71659] _xgetbv intrinsic missing

2019-01-17 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659 Daniel Fruzynski changed: What|Removed |Added CC||bugzilla@poradnik-webmaster

[Bug target/88679] SSE2 intrinsics are available by default on x86

2019-01-03 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88679 --- Comment #2 from Daniel Fruzynski --- I used compiler at https://godbolt.org/. Here are outputs for both commands: $ gcc -v Using built-in specs. COLLECT_GCC=/opt/compiler-explorer/gcc-snapshot/bin/g++ Target: x86_64-linux-gnu Configured

[Bug c/88679] New: SSE2 intrinsics are available by default on x86

2019-01-03 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- SSE2 intrinsics are available by default when compiling code for 32-bit x86. Code below compiles fine with options -m32 -O3. I had to add -mno-sse2 to get an error

[Bug c++/87729] Please include -Woverloaded-virtual in -Wall

2019-01-02 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87729 --- Comment #2 from Daniel Fruzynski --- Here you are: [code] class Foo { public: virtual void f(int); }; class Bar : public Foo { public: virtual void f(short); }; [/code]

[Bug target/65782] Assembly failure (invalid register for .seh_savexmm) with -O3 -mavx512f on mingw-w64

2019-01-01 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782 --- Comment #5 from Daniel Fruzynski --- I got following link: https://stackoverflow.com/questions/53733624/is-xmm8-register-value-preserved-across-calls/53733767#53733767 Quote from it: "Any additional registers for newer instruction sets are

[Bug target/65782] Assembly failure (invalid register for .seh_savexmm) with -O3 -mavx512f on mingw-w64

2019-01-01 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782 --- Comment #4 from Daniel Fruzynski --- I have found that I can use -ffixed-reg option for this. It allows to eliminate one register, so I have to use it 16 times to eliminate all xmm16..31 registers. It would be handy to have another option

[Bug target/65782] Assembly failure (invalid register for .seh_savexmm) with -O3 -mavx512f on mingw-w64

2019-01-01 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782 Daniel Fruzynski changed: What|Removed |Added CC||bugzilla@poradnik-webmaster

[Bug middle-end/88575] gcc got confused by different comparison operators

2019-01-01 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88575 --- Comment #3 from Daniel Fruzynski --- I have tried to compile with -O3 -march=skylake -ffast-math and got this: [asm] test(double, double): vminsd xmm2, xmm0, xmm1 vcmplesdxmm0, xmm0, xmm1 vxorpd xmm1, xmm1,

[Bug middle-end/88575] gcc got confused by different comparison operators

2019-01-01 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88575 --- Comment #2 from Daniel Fruzynski --- Code was compiled with -O3 -march=skylake. I have tried to add -fno-signed-zeros and -fsigned-zeros, and got the same output for both cases.

[Bug middle-end/88575] New: gcc got confused by different comparison operators

2018-12-22 Thread bugzi...@poradnik-webmastera.com
: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- In test() gcc is not able to determine that for a==b it does not have to evaluate 2nd comparison and can use value of a if 1st comparison is true. When

[Bug target/88570] Missing or ineffective vectorization of scatter load

2018-12-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88570 --- Comment #3 from Daniel Fruzynski --- I have checked svn head version (20181221), issue is still there.

[Bug target/88571] AVX512: when calculating logical expression with all values in kN registers, do not use GPRs

2018-12-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88571 --- Comment #3 from Daniel Fruzynski --- I have checked svn head version (20181221), issue is still there.

[Bug target/88570] Missing or ineffective vectorization of scatter load

2018-12-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88570 --- Comment #2 from Daniel Fruzynski --- In g++ (GCC-Explorer-Build) 9.0.0 20181219 (experimental) this still exists.

[Bug target/88571] AVX512: when calculating logical expression with all values in kN registers, do not use GPRs

2018-12-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88571 --- Comment #2 from Daniel Fruzynski --- Yes. Issue still exists in g++ (GCC-Explorer-Build) 9.0.0 20181219 (experimental).

[Bug target/88571] New: AVX512: when calculating logical expression with all values in kN registers, do not use GPRs

2018-12-21 Thread bugzi...@poradnik-webmastera.com
Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- This is a side effect of finding Bug 88570. I have noticed that when gcc has to generate code

[Bug middle-end/88570] New: Missing or ineffective vectorization of scatter load

2018-12-21 Thread bugzi...@poradnik-webmastera.com
Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] void test1(int*__restrict n1, int*__restrict n2, int*__restrict n3, int*__restrict n4) { for (int n = 0; n < 8; ++n) { if (n

[Bug middle-end/88569] New: Track relations between variable values

2018-12-21 Thread bugzi...@poradnik-webmastera.com
-end Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- This example comes from code which could be compiled for various CPUs, and had dedicated sections for AVX and SSE2. I left original ifdefs in comments. When 1st loop

[Bug middle-end/88487] union prevents autovectorization

2018-12-20 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #6 from Daniel Fruzynski --- Not good. Fortunately I found workaround. This is probably the best what one can get: [code] #include #include template struct TypeHelper { constexpr unsigned offset(); operator Type&() {

[Bug tree-optimization/88540] Issues with vectorization of min/max operations

2018-12-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88540 --- Comment #3 from Daniel Fruzynski --- Looks that AARCH64 is also affected. This is output from gcc 8.2 for SIZE=2: [asm] test(double*, double*, double*): ldp d1, d0, [x0] ldp d3, d2, [x1] fcmpe d1, d3

[Bug middle-end/88542] Optimize symmetric range check

2018-12-18 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88542 --- Comment #2 from Daniel Fruzynski --- No, code with -ffast-math is the same. BTW, fabs(NaN) is NaN, so result is the same as before (false).

[Bug c/88542] New: Optimize symmetric range check

2018-12-18 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #include bool test1(double d, double max) { return (d < max) && (d > -max); } bool test2(double d, double max) { return fabs(d) < max; } [/code]

[Bug c/88540] New: Issues with vectorization of min/max operations

2018-12-18 Thread bugzi...@poradnik-webmastera.com
: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- 1st issue: [code] #define SIZE 2 void test(double* __restrict d1, double* __restrict d2, double* __restrict d3) { for (int n = 0; n < SIZE; ++n) { d

[Bug middle-end/88487] union prevents autovectorization

2018-12-14 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #4 from Daniel Fruzynski --- OK, I see. Is there any workaround for this? I tried to assign pointer to local variable directly and with intermediate casting via void*, but it did not help. Casting S1* to S2* also does not work.

[Bug middle-end/88490] Missed autovectorization when indices are different

2018-12-14 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88490 --- Comment #3 from Daniel Fruzynski --- In this case s->d is pointer to pointer to double, and both pointer levels have restrict qualifier. I wonder if you could add some tag that s->d[n] and s->d[k] points to separate memory areas. This tag

[Bug middle-end/88490] Missed autovectorization when indices are different

2018-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88490 --- Comment #1 from Daniel Fruzynski --- Ehh, small typo. This is correct version, also not vectorized: [code] struct S { double* __restrict__ * __restrict__ d; }; void test(S* __restrict__ s, int n, int k) { if (n > k) {

[Bug middle-end/88490] New: Missed autovectorization when indices are different

2018-12-13 Thread bugzi...@poradnik-webmastera.com
: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Code below reads and writes data using different indices what is checked by "if" above loop. This can be autovectorized, as both memory areas do n

[Bug middle-end/88487] union prevents autovectorization

2018-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #2 from Daniel Fruzynski --- I spotted that test3 in previous comment uses structure S2 which does not have union inside. When I changes it to use S1, I got non-vectorized code. So this workaround does not work.

[Bug middle-end/88487] union prevents autovectorization

2018-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88487 --- Comment #1 from Daniel Fruzynski --- Update: when pointers to data are copied to local variables like below, autovectorization starts working again. [code] void test3(S2* __restrict__ s1, S2* __restrict__ s2) { double* __restrict__ *

[Bug middle-end/88487] New: union prevents autovectorization

2018-12-13 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- When pointer to data is inside union, loops are not autovectorized. This also happen when I removed "i" field from union, so it had only one field. Code compiled with

[Bug target/88473] AVX512: constant folding on mask does not remove unnecessary instructions

2018-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88473 --- Comment #2 from Daniel Fruzynski --- I was playing with Compiler Explorer, to see how compilers optimize various pieces of code. I found that next clang version (currently trunk) will be able to analyze expressions which spans over vectors,

[Bug middle-end/88476] New: Optimize expressions which uses vector, mask and general purpose registers

2018-12-12 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I was playing with Compiler Explorer to see how compilers can optimize various pieces of code. I found next version

[Bug target/88473] New: AVX512: constant folding on mask does not remove unnecessary instructions

2018-12-12 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #include void test(void* data, void* data2) { __m128i v = _mm_load_si128((__m128i const*)data

[Bug target/88465] AVX512: optimize loading of constant values to kN registers

2018-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88465 --- Comment #3 from Daniel Fruzynski --- This "null" ia an icc bug. Matt Godbolt from Compiler Explorer filed a bug with Intel: ref 03997020

[Bug target/88465] AVX512: optimize loading of constant values to kN registers

2018-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88465 --- Comment #2 from Daniel Fruzynski --- I have logged issue for CompileExplorer to clarify this null instruction: https://github.com/mattgodbolt/compiler-explorer/issues/1220

[Bug c/88465] New: AVX512: optimize loading of constant values to kN registers

2018-12-12 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- When constant value is loaded into kN register, gcc puts it into eax first, and then moved to kN register: [code] #include #include

[Bug target/88461] AVX512: gcc should keep value in kN registers if possible

2018-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88461 --- Comment #3 from Daniel Fruzynski --- Good catch, mask should be 16-bit. Here is fixed version: [code] #include #include int test(uint16_t* data, int a) { __m128i v = _mm_load_si128((const __m128i*)data); __mmask16 m =

[Bug c/81665] Please introduce flags attribute for enums which will mimic one from C#

2018-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81665 --- Comment #4 from Daniel Fruzynski --- @Jonathan Wakely: constexpr requires C++11. When I reported this bug, we still were at C++98 with most of out codebase.

[Bug target/88461] AVX512: gcc should keep value in kN registers if possible

2018-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88461 --- Comment #1 from Daniel Fruzynski --- For comparison, this is code generated by icc 19.0.1: [asm] test(unsigned short*, int): vmovdqu xmm0, XMMWORD PTR [rdi] #6.48 vptestnmw k0, xmm0, xmm0

[Bug c/88461] New: AVX512: gcc should keep value in kN registers if possible

2018-12-12 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I tried to write piece of code which used new AVX512 logic instructions which works on kN registers. It turned out that gcc was moving

[Bug target/88271] Omit test instruction after add

2018-12-10 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #10 from Daniel Fruzynski --- Here is possible code transformation to equivalent form, where this optimization can be simply applied. This change also has a bit surprising side effect, second nested while loop is unrolled. [code]

[Bug target/88271] Omit test instruction after add

2018-12-07 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #9 from Daniel Fruzynski --- I have idea about alternate approach to this. gcc could try to look for relations between loop control statement, and other statements which modify variables used in that control statement. With such

[Bug target/88271] Omit test instruction after add

2018-12-06 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #8 from Daniel Fruzynski --- I have results from Callgrind. Cycle estimation for MoveRows function (without children) is 58.29%. This is for app without test instruction. So in synthetic benchmark for this function only speed change

[Bug target/88271] Omit test instruction after add

2018-12-06 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #7 from Daniel Fruzynski --- One more note: this particular function creates matrices with all possible permutations of row order of original matrix, which satisfies some additional criteria. So this optimization may be applicable to

[Bug target/88271] Omit test instruction after add

2018-12-06 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #6 from Daniel Fruzynski --- Average for version with test is 246.313ms, I deleted too many digits.

[Bug target/88271] Omit test instruction after add

2018-12-06 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #5 from Daniel Fruzynski --- How to use perf? I did not have change to use it yet, I usually use time command or callgrind. I have run my app compiled with AVX2 instructions on Xeon E5-2683 v3, CentOS 7.6, on idle CPU. I run it 3

[Bug target/88271] Omit test instruction after add

2018-12-06 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #3 from Daniel Fruzynski --- What about adding new pass at the end? It would look for various possible optimizations, which were missed earlier because they are cross-basic block. In my case this example code is part of tight loop.

[Bug target/88271] Omit test instruction after add

2018-12-06 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88271 --- Comment #1 from Daniel Fruzynski --- I checked that in simple case when bit shift is used in "if", it is optimized: [code] void f(); void g(); void test(int n) { if (n << 1) f(); else g(); } [/code] [asm]

[Bug middle-end/88387] New: Possible code optimization when right shift count >= width of type

2018-12-06 Thread bugzi...@poradnik-webmastera.com
mal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- When signed int is shifted right by more than its width, results will be either 0 or -1. This can used to simpl

[Bug middle-end/88361] gcc does not unroll loop

2018-12-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88361 --- Comment #1 from Daniel Fruzynski --- For reference, this is NEON code which I used on AARCH64: [code] void test2() { int n = 0; for (; n < SIZE*SIZE-3; n += 4) { // Copy data uint32x4_t v =

[Bug middle-end/88361] New: gcc does not unroll loop

2018-12-04 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #include "immintrin.h" #define SIZE 9 int src[SIZE][SIZE] __attribute__((aligned(16))); int dst1[SIZE][SIZE] __attribute__((aligned(16))); int dst2[SIZE][SIZE] __a

[Bug bootstrap/88321] Crosscompiled gcc does not use preinstalled as

2018-12-03 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88321 --- Comment #1 from Daniel Fruzynski --- Update: there is workaround for this, pass "--with-ld=/bin/x86_64-w64-mingw32-ld --with-as=/bin/x86_64-w64-mingw32-as" to configure script. I also tried to use "--with-ld=x86_64-w64-mingw32-ld

[Bug bootstrap/88321] New: Crosscompiled gcc does not use precompiled as

2018-12-03 Thread bugzi...@poradnik-webmastera.com
: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I have build gcc 8.2.0 as as crosscompiler for Centos 7 x86_64 -> MinGW x86_64. Before starting I installed gcc 4.9.3 MinGW crosscompiler from EPEL repository.

[Bug c/88276] New: AVX512: reorder bit ops to get free and operation

2018-11-30 Thread bugzi...@poradnik-webmastera.com
: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #include #include int test1(const __m128i* src, int mask) { __m128i v = _mm_load_si128(src); int cmp = _mm_cmpeq_epi16_mask(v, _mm_setzero_si128

[Bug c/88271] New: Omit test instruction after add

2018-11-29 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] int data[8]; void test(int k) { int level = 0; int val = 1; while (1) { if (val) { val = data[level] << 1; +

[Bug tree-optimization/88153] sqrt() is not vectorized

2018-11-26 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88153 Daniel Fruzynski changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED

[Bug tree-optimization/88153] sqrt() is not vectorized

2018-11-22 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88153 --- Comment #2 from Daniel Fruzynski --- I checked that godbolt.org uses g++ (GCC-Explorer-Build) 9.0.0 20181110 (experimental). This version does not have such patch merged. Anyway, code compiled with -fmath-errno enabled would benefit from

[Bug c/88153] New: sqrt() is not vectorized

2018-11-22 Thread bugzi...@poradnik-webmastera.com
: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Sequence of calls to sqrt() is not vectorized. I found Bug 21466 that claims that it was fixed in GCC 4.3, but looks that change was reverted - at least 4.4.7 it also is not vectorized. I

[Bug middle-end/88097] Missing optimization of endian conversion

2018-11-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88097 --- Comment #6 from Daniel Fruzynski --- Thanks Joseph for info. godbolt.org now uses glibc 2.27, so no wonder that I got results which I posted here.

[Bug middle-end/88097] Missing optimization of endian conversion

2018-11-20 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88097 Daniel Fruzynski changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED

[Bug middle-end/88097] Missing optimization of endian conversion

2018-11-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88097 --- Comment #2 from Daniel Fruzynski --- Please also take a look on code which performs opposite conversion. gcc also does not use movbe here. Both gcc and clang are not able to optimize this into one 32-bit store, this is another possible

[Bug middle-end/88097] Missing optimization of endian conversion

2018-11-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88097 --- Comment #1 from Daniel Fruzynski --- I also tried to swap Word1 and Word2 fields in structure to see what will happen. It turned out that gcc with -O3 -mmovbe generates code without movbe: [asm] test(Test*): movzx eax, WORD PTR

[Bug middle-end/88097] New: Missing optimization of endian conversion

2018-11-19 Thread bugzi...@poradnik-webmastera.com
-end Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I have found some old code network code which looked like this: [code] #include #include struct Test { uint16_t Word1; uint16_t Word2; }; uint32_t test

[Bug c++/87731] Detection of mismatched alloc/free pairs

2018-10-24 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87731 --- Comment #3 from Daniel Fruzynski --- Logged Bug 87736 for new proposed attributes.

[Bug c++/87736] New: New attributes to mark custom alloc/free function pair

2018-10-24 Thread bugzi...@poradnik-webmastera.com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- This is split from Bug 87731, as recommended by Jonathan Wakely: Valgrind provides set of macros which allows it to track custom alloc/free functions. It would

[Bug c++/87732] Detect and eliminate unnecessary alloc/free pairs

2018-10-24 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87732 --- Comment #1 from Daniel Fruzynski --- New warning for this also would be welcome.

[Bug c++/87732] New: Detect and eliminate unnecessary alloc/free pairs

2018-10-24 Thread bugzi...@poradnik-webmastera.com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] void foo() { char* c = new char[4]; delete[] c; } [/code] gcc with -O3 generates this: [asm] foo(): sub rsp, 8 mov edi, 4

[Bug c++/87731] New: Detection of mismatched alloc/free pairs

2018-10-24 Thread bugzi...@poradnik-webmastera.com
++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Following code compiles cleanly on gcc: void foo() { char* c = new char[4]; delete c; } When it is compiles using clang 7.0.0, it generates following warning. Please

[Bug c++/87729] New: Please include -Woverloaded-virtual in -Wall

2018-10-24 Thread bugzi...@poradnik-webmastera.com
++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- clang includes -Woverloaded-virtual in -Wall. Please do same for gcc.

[Bug web/87684] -Woverloaded-virtual is not documented

2018-10-22 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87684 --- Comment #4 from Daniel Fruzynski --- Thanks for the link. I have tried to google for "gcc Woverloaded-virtual" and it did not show on the top, so I assumed that option is undocumented. I will open new issue to add it to -Wall.

[Bug web/87684] -Woverloaded-virtual is not documented

2018-10-22 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87684 --- Comment #1 from Daniel Fruzynski --- Last paragraph should be "clang includes -Woverloaded-virtual in -Wall", I noticed this too late to correct it.

[Bug web/87684] New: -Woverloaded-virtual is not documented

2018-10-22 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- -Woverloaded-virtual is not documented at https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html . I found this option when clang reported this kind of issue in my code

[Bug c/87323] New: More complicated assembly for sode with custom copy constructor

2018-09-15 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #include typedef int32_t VInt __attribute((vector_size(32))); class V1 { VInt v; public: constexpr V1(const V1&am

[Bug c/87319] New: When vector is wrapped, expression is not optimized.

2018-09-15 Thread bugzi...@poradnik-webmastera.com
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I was playing with vector extensions and intrinsics, checking if gcc would be able to optimize vector expression a*c+b*c to (a+b)*c. It turned out that this works

[Bug c/87307] New: Implicit conversion from int to vector works, explicit is an error

2018-09-14 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Vector types defined using __attribute((vector_size(N))) supports implicit conversion from int to vector type for arithmetic

[Bug bootstrap/58828] Problem compiling gcc 4.8.2 using gcc 4.4.6

2018-09-07 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58828 --- Comment #5 from Daniel Fruzynski --- (In reply to Eric Gallager from comment #4) > (In reply to Daniel Fruzynski from comment #3) > > OK, I found it. I used script symlink-tree (distributed with binutils) to > > create symlinks to binutils

[Bug c++/84403] New: Possible further extension of constexpr: allow to use them as template parameters

2018-02-15 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Values in constexpr functions are known at compile time, so theoretically they could be used as template parameters

[Bug tree-optimization/84106] loop distribution cost-model needs work

2018-02-05 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84106 --- Comment #6 from Daniel Fruzynski <bugzi...@poradnik-webmastera.com> --- When you will be revisiting your cost-model for loops, please also take a look on this code. test2 has one assignment moved to separate loops, and it is about

[Bug bootstrap/84199] New: Error building gcc 7.3.0 on Odroid XU4 (ARM, Ubuntu): cannot load liblto_plugin.so

2018-02-04 Thread bugzi...@poradnik-webmastera.com
Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Created attachment 43337 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43337=edit Full build log

  1   2   >