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

2013-10-21 Thread bugzi...@poradnik-webmastera.com
: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com I am trying to build gcc 4.8.2, and I got following compilation error: make[3]: Entering directory `[path]/gcc/obj/gcc' g++ -g -fkeep-inline-functions -DIN_GCC -fno-exceptions -fno

[Bug bootstrap/58840] New: Problem compiling gcc 4.7.3 using gcc 4.4.6

2013-10-22 Thread bugzi...@poradnik-webmastera.com
: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com make[3]: Entering directory `[path]/gcc/obj/gcc' build/gengtype \ -S ../../gcc-4.7.3/gcc -I gtyp-input.list -w tmp-gtype.state ../../gcc-4.7.3/gcc/../include/splay-t

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

2013-10-23 Thread bugzi...@poradnik-webmastera.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58828 --- Comment #2 from Daniel Fruzynski --- Thanks for reply. As I checked, this also happens when compiling using gcc 4.7.3, so looks that this is more general problem. File [path]/gcc/obj/gcc/config.status contains following entry: configured by

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

2013-10-23 Thread bugzi...@poradnik-webmastera.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58828 --- Comment #3 from Daniel Fruzynski --- OK, I found it. I used script symlink-tree (distributed with binutils) to create symlinks to binutils in gcc source dir. This script removed some gcc source files and replaced them with symlinks to correspo

[Bug bootstrap/58840] Problem compiling gcc 4.7.3 using gcc 4.4.6

2013-10-23 Thread bugzi...@poradnik-webmastera.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58840 --- Comment #2 from Daniel Fruzynski --- OK, I found this. I used script symlink-tree to create symlinks to binutils in gcc src dir. This script replaced some files with symlinks to their counterparts in binutil dir, what caused this problem. gcc

[Bug c/58988] New: -Werror=missing-include-dirs does not work

2013-11-04 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com I tried to pass -Werror=missing-include-dirs option to gcc in order to find all non-existing include dirs and found that this option in broken. In gcc 4.5.2 this option is ignored - gcc does not print

[Bug c/58988] -Werror=missing-include-dirs does not work

2013-11-05 Thread bugzi...@poradnik-webmastera.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58988 --- Comment #1 from Daniel Fruzynski --- gcc 4.8.2 is also affected by this bug - is works in the same way as gcc 4.7.3.

[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 knowl

[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] voi

[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/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/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 #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 = _mm_testn_ep

[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/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 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/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 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] 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, m

[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 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__ * __r

[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/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/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) { fo

[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 cou

[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 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 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] Wh

[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 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/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 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/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 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 for

[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/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 #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 #3 from Daniel Fruzynski --- I have checked svn head version (20181221), issue is still there.

[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 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] 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 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 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 whi

[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 v

[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 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 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 w

[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/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 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 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/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++/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 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/83369] New: Missing diagnostics during inlining

2017-12-11 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- When code below is compiled, gcc prints warnings that null is passed to function with nonnull attribute. However gcc does not point that error is caused by inlining of my_strcpy at

[Bug c/83373] New: False positive reported by -Wstringop-overflow

2017-12-11 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- When code below is compiled, gcc incorrectly complains that memcpy will read data after end of buffer in line marked with star. Looks that gcc does not take into account

[Bug middle-end/81914] [7/8 Regression] gcc 7.1 generates branch for code which was branchless in earlier gcc version

2017-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81914 --- Comment #9 from Daniel Fruzynski --- In the meantime I found another case when gcc 7 inserts lots of jumps. I am not sure if your extra test cases covers it too: #include int test(int data1[9][9], int data2[9][9]) { uint64_t b1 = 0, b2 =

[Bug middle-end/83373] False positive reported by -Wstringop-overflow

2017-12-12 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83373 --- Comment #4 from Daniel Fruzynski --- > Bug 83373 - False positive reported by -Wstringop-overflow, is > another example of warning triggered by a missed optimization > opportunity, this time in the strlen pass. The optimization > is discusse

[Bug middle-end/83373] False positive reported by -Wstringop-overflow

2017-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83373 --- Comment #6 from Daniel Fruzynski --- My understanding is that after this patch will be applied, gcc will still emit warning for last field in struct, e.g. like in code below. Is my understanding correct or I missed something? struct Msg {

[Bug middle-end/83373] False positive reported by -Wstringop-overflow

2017-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83373 --- Comment #7 from Daniel Fruzynski --- In my case structures like Msg above are generated from IDL files together with code for serialization and deserialization. Because of this I cannot freely move or add new fields there, this may break comp

[Bug middle-end/83373] False positive reported by -Wstringop-overflow

2017-12-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83373 --- Comment #9 from Daniel Fruzynski --- Thanks for explanation. In addition to allocation on stack, my app also uses custom allocator function like below. So in this case it also should work as expected. void* msg_alloc(int msg_id); ... Msg* m

[Bug c++/83429] New: Incorrect line number reported by -Wformat-truncation

2017-12-14 Thread bugzi...@poradnik-webmastera.com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #include struct S { char str1[10]; char str2[10]; char out[15]; }; void test(S* s) // line 10 { snprintf(s->out, sizeof(s->out),

[Bug c++/83430] New: buffer overflow diagnostics for snprintf is broken

2017-12-14 Thread bugzi...@poradnik-webmastera.com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #include struct S { char str[20]; char out[15]; }; void test(S* s) { snprintf(s->out, sizeof(s->str), "[%s]", s->str); } [/co

[Bug c++/83431] New: -Wformat-truncation may incorrectly report truncation

2017-12-14 Thread bugzi...@poradnik-webmastera.com
Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- This looks like another missing optimization - -Wformat-truncation does not take into account that there is "if" which checks that truncation will

[Bug middle-end/59521] __builtin_expect not effective in switch

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

[Bug c++/83429] Incorrect line number reported by -Wformat-truncation

2017-12-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83429 --- Comment #1 from Daniel Fruzynski --- Another test case, this time "note:" with argument range also points to incorrect line: [code] #include struct S { unsigned char n; char out[2]; }; void test(S* s) // line 9 { snprintf(s->o

[Bug c++/83429] Incorrect line number reported by -Wformat-truncation

2017-12-15 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83429 --- Comment #2 from Daniel Fruzynski --- Sometimes actual location is not reported at all: [code] #include #include struct S { char* str; int n; char out[10]; }; void test(S* s) { if (s->str) snprintf(s->out, sizeof(s

[Bug c/83479] New: Register spilling in AVX code

2017-12-19 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Here is snipped of code which performs some calculations on matrix. It repeatedly transforms some (N * N) matrix into (N-1 * N-1) one, and returns final scalar value. gcc for some reason

[Bug c/83479] Register spilling in AVX code

2017-12-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83479 --- Comment #1 from Daniel Fruzynski --- Here is clang 5.0 output, it is also shorted than gcc one (213 lines, gcc produced 247). test(double const (*) [8]): # @test(double const (*) [8]) vmovapd ymm3, ymmword ptr [rdi + 64] vmovapd ymm4, ym

[Bug target/83479] Register spilling in AVX code

2017-12-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83479 --- Comment #4 from Daniel Fruzynski --- Rule No.1: never log bugs before morning coffee ;) This does not produce warnings, compiled with "-O3 -march=haswell -mavx512f -mavx512vl -mavx512bw -mavx512dq -mavx512cd -Wall -Werror". [code] #include "

[Bug target/83479] Register spilling in AVX code

2017-12-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83479 --- Comment #5 from Daniel Fruzynski --- Here is also valid AVX version, it also spills a bit. Compiled with "-O3 -march=haswell -Wall -Werror". [code] #include "immintrin.h" double test(const double data[5][4]) { __m256d vLastRow, vLastCol,

[Bug target/83479] Register spilling in AVX code

2017-12-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83479 --- Comment #6 from Daniel Fruzynski --- One correction: In c#4 line 17 has incorrect index, should be 8 instead of 9. For some reason gcc did not complain here. vLastRow = _mm512_load_pd (&data[8][0]);

[Bug middle-end/81914] [7 Regression] gcc 7.1 generates branch for code which was branchless in earlier gcc version

2017-12-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81914 --- Comment #12 from Daniel Fruzynski --- One more test case. Code compiled with TEST defined is branchless, without it has branch. [code] #include #define TEST void test(uint64_t* a) { uint64_t n = *a / 8; if (0 == n) n = 1; #ifdef T

[Bug c/83610] New: __builtin_expect sometimes is ignored

2017-12-28 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] void f1(); void f2(); void test(int a, int b, int c, int d, int n, int k) { int val = a & b; if (__builtin_expect(!!(n == k), 0)) val &= c; if (__builti

[Bug c/83610] __builtin_expect sometimes is ignored

2017-12-28 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83610 --- Comment #1 from Daniel Fruzynski --- Code was compiled with "-O3 -march=core2 -mtune=generic"

[Bug middle-end/83610] __builtin_expect sometimes is ignored

2017-12-29 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83610 --- Comment #3 from Daniel Fruzynski --- Created attachment 42980 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42980&action=edit Benchmark Here is benchmark for this case. With unlikely() execution time decreases from 20.5sec to 20.3sec

[Bug target/81759] Improve data tracking for _pext_u64 and __builtin_ffsll

2017-12-29 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81759 --- Comment #2 from Daniel Fruzynski --- Looks that __builtin_ffs does not check if input value is nonzero at all. Assembler code for following code also has unnecessary instructions: [code] unsigned int test(unsigned int n) { if (n == 0)

[Bug c/83634] New: ICE in useless_type_conversion_p, at gimple-expr.c:86

2017-12-30 Thread bugzi...@poradnik-webmastera.com
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] void test(unsigned int* ptr) { const int foo = Foo(); const int bar = Bar(); unsigned short n; for (n = foo; n < 100; n += bar) {} } [/code] I

[Bug c/83634] ICE in useless_type_conversion_p, at gimple-expr.c:86

2017-12-30 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83634 --- Comment #1 from Daniel Fruzynski --- A bit simpler test case which triggers this ICE: [code] void test() { const int foo = Foo(); short n; for (n = foo; n < 100; ++n) {} } [/code]

[Bug c/83671] New: Fix for false positive reported by -Wstringop-overflow does not work with inlining

2018-01-03 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: --- Fix for bug 83373 does not work well with inlining: [code] #include #include char dest[20]; char src[10

[Bug target/82915] Please mark intrinsics as constexpr

2018-01-03 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82915 --- Comment #2 from Daniel Fruzynski --- SIMD ISAa for other CPU types (e.g. ARM/AARCH64 NEON) also can benefit from this.

[Bug target/82915] Please mark intrinsics as constexpr

2018-01-03 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82915 --- Comment #4 from Daniel Fruzynski --- For tracking purposes it probably would be better to have separate issues for every CPU type which could benefit this. So this one could be for x86, and you could open other requests for other CPUs which s

[Bug c/83688] New: Please check if buffers may overlap when copying strings

2018-01-04 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Functions like strcpy internally use memcpy to copy data. This may cause problems when someone will try to use them to move string in buffer

[Bug c/83688] Please check if buffers may overlap when copying strings

2018-01-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #1 from Daniel Fruzynski --- This also would allow to catch code which use sprintf to concatenate strings, what is an undefined behavior (snippet from https://linux.die.net/man/3/snprintf): sprintf(buf, "%s some further text", buf);

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #3 from Daniel Fruzynski --- Looks that something is not working properly. I have pasted output from compilation of function in 1st post, and -Wrestrict complained only about last memcpy call. Please take a look on this. BTW, string

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #5 from Daniel Fruzynski --- > There is nothing to indicate that the first call to memcpy() in comment #0 > overlaps so -Wrestrict doesn't warn for it. I thought that fix for bug 83373 will somehow help here. gcc could guess that mem

[Bug c/83688] Please check if buffers may overlap when copying strings using sprintf

2018-01-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83688 --- Comment #7 from Daniel Fruzynski --- In general case yes, this can produce a lot of false positives. I wanted to use this only for strings stored in fixed-size buffer. Existing string-related warnings already uses this information, and this r

[Bug preprocessor/83773] New: Warning for redefined macro does not have its own -Wsomething switch

2018-01-10 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Warning for redefined macro does not have its own -Wsomething switch, please add one. I also tried to use -fdiagnostics

[Bug c/83859] New: Please add new attribute which will establish relation between parameters for buffer and its size

2018-01-15 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: --- gcc can detect if buffer size passed to function like strncpy is incorrect, e.g. it is sizeof pointer

[Bug c/84085] New: Array element is unnecessary loaded twice

2018-01-28 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] #define N 9 struct S1 { int a1[N][N]; }; struct S2 { int a2[N][N]; int a3[N][N]; }; void test1(S1* s1, S2* s2) { s2->a2[N-1][N-1] = s1->a1[N-

[Bug c/84106] New: gcc is not able to vectorize code for 1D array, but does so for 2D array of the same size

2018-01-29 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] #define N 9 int a1[N][N]; int a2[N][N]; int b1[N*N]; int b2[N*N]; void test1() { for (int i = 0

[Bug tree-optimization/84106] gcc is not able to vectorize code for 1D array, but does so for 2D array of the same size

2018-01-30 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84106 --- Comment #2 from Daniel Fruzynski --- Test included in comment 0 is part of bigger test which I performed. In full version code was also computing bitmask and stored in 3rd array. For test1 gcc was able to vectorize inner loop to series of loa

[Bug tree-optimization/84106] gcc is not able to vectorize code for 1D array, but does so for 2D array of the same size

2018-01-30 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84106 --- Comment #4 from Daniel Fruzynski --- Here are results of small benchmark executed on Xeon E5-2683 v3. Code was compiled using gcc 4.8.5. This gcc version also splits loops. Manually vectorized code is 3.5 times faster: [out]

[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&action=edit Ful

[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 --- 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 twice as fast as test1 function (for gcc 4.8.5

[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 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/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 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: __attribute__((expect_not_return

[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&action=edit Preprocessed code I got ICE Segmentation fault when trying t

  1   2   >