[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&action=edit MinGW package versions

[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 --host=x86_

[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&action=edit Source code which triggers crash I added code which causes crash when compiling. Here is command which I use

[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&action=edit Valgrind log Here is Valgrind log. It found multiple cases when uninitialized value vas used. However in all

[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-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 #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 n

[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 #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 t

[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 #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 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 in

[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 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/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++/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 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, and

[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] -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 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 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++/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++/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++/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++/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 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 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 [rdi

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

[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 Resolution|INVALI

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

[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 Resolution|INVALI

[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 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 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 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 --with-as=x

[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 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 = vld1q_u32((uint32_t*)(&

[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 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] test(int):

[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. F

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

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

[Bug libstdc++/71547] New: Error in std::result_of - fail if function returns pointer to function

2016-06-15 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- #include typedef void(*Func1)(int); typedef Func1(*Func2)(int*); typedef typename std::result_of::type Type1; $ g

[Bug c/81664] New: __attribute__((target("movbe"))) does not work

2017-08-02 Thread bugzi...@poradnik-webmastera.com
mponent: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I found this when I tried to benchmark performance of ntohl with and without movbe. Looka that target attribute with values "movbe" and "no

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

2017-08-02 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Enums usually are used to define set of strongly-typed constants, and every enum element is considered separate from others

[Bug target/81664] __attribute__((target("movbe"))) does not work

2017-08-02 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81664 --- Comment #2 from Daniel Fruzynski --- So there is another problem here: for some reason both mentioned gcc versions accepts -mmovbe and -mno-movbe options. If movbe is not supported, gcc should complain that these options are unrecognized. I

[Bug target/81664] __attribute__((target("movbe"))) does not work

2017-08-02 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81664 Daniel Fruzynski changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resolution|INVALI

[Bug target/81664] __attribute__((target("movbe"))) does not work

2017-08-06 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81664 Daniel Fruzynski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug tree-optimization/81739] New: Replace calls to memcmp with more efficient code if possible

2017-08-06 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- In our app we had function which was comparing two uint64 values using memcmp. As it turned out, it was taking a lot of

[Bug c/81759] New: Improve data tracking for _pext_u64 and __builtin_ffsll

2017-08-07 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- This simple function gets index of least significant byte with its MSB cleared: #include #include "immintrin.h"

[Bug c/81772] New: Compile-time snprintf optimization

2017-08-08 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- snprintf is slow. This is caused not only by format string handling, but there is also some internal fault with string handling - see https://sourceware.org/bugzilla/show_bug.cgi?id

[Bug tree-optimization/81772] Compile-time snprintf optimization

2017-08-08 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81772 --- Comment #2 from Daniel Fruzynski --- You probably could optimize snprintf(buf, size, "%s", str) into this: if (size > 0) { buf[0] = 0; strncat(buf, str, size - 1); } Other optimizations would require to generate more code aa you wrote.

[Bug c/81798] New: Please introduce new attribute to tell that function zeroes returned memory

2017-08-10 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- gcc is able to detect case when memory is allocated using calloc and then zeroed out again using memset - in such case it

[Bug c/81914] New: gcc 7.1 generates branch for code which was branchless in earlier gcc version

2017-08-21 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Code: #include int cmp(int64_t a, int64_t b) { return a < b ? -1 : a > b; } Above function compiled with g

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

2017-08-21 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81914 --- Comment #3 from Daniel Fruzynski --- Yes, branchless version is faster. Here are results for code compiled with gcc 4.8.5: BenchmarkTime CPU Iterations -- BM_memcmp

[Bug c++/81972] New: Improve data tracking for simple conditional code

2017-08-24 Thread bugzi...@poradnik-webmastera.com
: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- [code] __attribute__((nonnull(1))) void f1(int*); void f2(int* n) { int* ptr = nullptr; if (*n > 2) ptr = n; f1(ptr); } void f3(int* n) {

[Bug c/80806] New: gcc does not warn if local array is memset only

2017-05-17 Thread bugzi...@poradnik-webmastera.com
: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- gcc has warning "variable ā€˜c’ set but not used". However this warning is not printed when local variable is cleared using memset, and then not used. Attempt

[Bug c/80807] New: Improve FORTIFY_SOURCE protection for sprintf

2017-05-17 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Following code compiles cleanly with -D_FORTIFY_SOURCE=2, and then crashes at runtime because buffer overflow was detected. However gcc could detect that this code will

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806 --- Comment #3 from Daniel Fruzynski --- "in" attribute is similar to "const", I am not sure if we need another one for this. "out" attribute would be handy. I recall than in the past I was looking for it. gcc can print warning that uninitialize

[Bug c/80806] gcc does not warn if local array is memset only

2017-05-20 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80806 --- Comment #6 from Daniel Fruzynski --- I have checked list of my issues reported here and found Bug 68034 which is closely related to this one. This patch probably will fix that one too, user will know that his memset was removed by compiler.

[Bug c/81117] New: Improve buffer overflow checking in strncpy

2017-06-17 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Code: #include char buf[2]; void test(const char* str) { strncpy(buf, "12345", sizeof("12345")); // 1 strncpy(buf, "12345", strlen(&

[Bug c/81117] Improve buffer overflow checking in strncpy

2017-06-17 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81117 --- Comment #1 from Daniel Fruzynski --- In this case this code will lead to buffer overflows, but in general case it often may work fine. However this is still error in code, and it would be good if gcc could detect and report it.

[Bug c/81391] New: Use of parenthesis disables warning about incorrect size parameter

2017-07-11 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- When code below is compiled, gcc complains only about first call to strncpy. 2nd call has the same problem as the 1st one (sizeof

[Bug c/79680] New: format attribute cannot be used with template parameters

2017-02-22 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I had logging function with printf-like declaration, and __attribute__((format(printf, x, y))). For performance reasons I wanted to add

[Bug c++/77958] printf format checking -vs- variadic template functions

2017-02-22 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77958 --- Comment #3 from Daniel Fruzynski --- This attribute should also work when some parameters are not variadic ones. One use case presented in bug 79680 is to have two overloaded logging function: one printf-like, and another one which accepts co

[Bug c/79693] New: Memory buffer handling - additional optimization proposal

2017-02-23 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- I have checked how gcc treats temporary buffers allocated in different ways (local buffer on stack, malloced locally in function, malloced

[Bug c/82855] New: AVX512: replace OP+movemask with OP_mask+ktest

2017-11-05 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Before AVX512, AVX/SSE code was written as in test1 function below: some operation(s) created mask in vector register, it was then converted to int with movemask

[Bug c++/82915] New: Please mark intrinsics as constexpr

2017-11-08 Thread bugzi...@poradnik-webmastera.com
++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Intrinsics are marked as inline now. However gcc knows what they do, and is able to optimize out some code code which uses them - e.g. in example below both count1a() and count2a

[Bug c/81117] Improve buffer overflow checking in strncpy

2017-11-13 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81117 --- Comment #17 from Daniel Fruzynski --- (In reply to Martin Sebor from comment #14) > (In reply to Dmitry G. Dyachenko from comment #12) > > I'm afraid the warning in the constant string case is unavoidable. The call > is folded at a point wh

[Bug c++/83049] New: Allow overloading of ?: conditional operator

2017-11-19 Thread bugzi...@poradnik-webmastera.com
++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- C++ standard states than conditional operator ?: cannot be overloaded. However things changed since this rule was created, and now there are reasons to do this - in fact

[Bug c++/83050] New: Please provide shortcircuit attribute for || and && operators

2017-11-19 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Built-int || and && operators are shortcircuiting, i.e. they may skip evaluation of 2nd argument in some cases. Ho

[Bug c++/83049] Allow overloading of ?: conditional operator

2017-11-19 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83049 --- Comment #1 from Daniel Fruzynski --- If you decide to implement this, please also attempt to add this as an feature to some future version of C++ standard. By doing so users of other compilers would benefit from this too.

[Bug c/83123] New: Int compare - different asm code for different return type

2017-11-23 Thread bugzi...@poradnik-webmastera.com
Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- int test1(int a, int b) { return (a < 0) && (b < 0); } bool test2(int a, int b) { return (a < 0) && (b < 0)

[Bug c/83202] New: Try joining operations on consecutive array elements during tree vectorization

2017-11-28 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- void test(double data[4][4]) { for (int i = 0; i < 4; i++) { for (int j = i; j < 4; j+=2) { dat

[Bug c/83202] Try joining operations on consecutive array elements during tree vectorization

2017-11-28 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83202 --- Comment #1 from Daniel Fruzynski --- This was compiled with -O3 -mavx -ftree-vectorize After sending this I noticed that I wrote inner loop incorrectly, I meant one below. Anyway, it it also not optimized: for (int j = 0; j < i; j+=4) I also

[Bug tree-optimization/83202] Try joining operations on consecutive array elements during tree vectorization

2017-11-29 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83202 --- Comment #4 from Daniel Fruzynski --- One more case. Code has to process diagonal half of matrix and uses SSE intrinsics - see test1() below. When n is constant like in test2() below, gcc unrolls loops. However more more transform could be per

[Bug c/68034] New: Print warning when memset is optimized out

2015-10-20 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- It is recommended to clear memory area storing sensitive data (e.g. passwords) when they are no longer needed. When memset is used for this, it may lead to subtle bug because

[Bug c/68201] New: alloc_size attribute and memory pools

2015-11-03 Thread bugzi...@poradnik-webmastera.com
Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- When memory pool is used to allocate fixed-size blocks, size of block is often stored in structure describing mempool. In such case it is not possible to tell gcc via alloc_size

[Bug c/68201] alloc_size attribute and memory pools

2015-11-04 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68201 --- Comment #2 from Daniel Fruzynski --- What about code compiled with -D_FORTIFY_SOURCE=1, when functions like strcpy are replaced with __builtin___strcpy_chk? This is a runtime check, so passing pool->block_size should be reasonable there. Inl

[Bug c++/68407] New: Code generation failure, "rep ret" in .s file

2015-11-18 Thread bugzi...@poradnik-webmastera.com
mponent: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com Target Milestone: --- Created attachment 36752 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36752&action=edit Assembler output Test code: int testfunc(const char

[Bug c++/62202] New: g++ does not accept typedef-name after struct even if -fpermissive is used

2014-08-20 Thread bugzi...@poradnik-webmastera.com
: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: bugzi...@poradnik-webmastera.com gcc silently compiles this, even with -Wall -Wextra -pedantic: struct test_s { int n; }; typedef struct test_s test_t; typedef struct test_t

[Bug c/31893] Please provide an "inout" attribute for function parameters.

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

[Bug c/31893] Please provide an "inout" attribute for function parameters.

2015-06-10 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31893 --- Comment #9 from Daniel Fruzynski --- My bad, now I see my error. What do you think about adding this new attribute to mark function arguments as out only? I think it would allow to eliminate more dead or unnecessary code (e.g. when value is

<    1   2