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
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_
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471
--- Comment #7 from Daniel Fruzynski ---
Preprocessed source is in 1st attachment here.
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.
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90471
--- Comment #16 from Daniel Fruzynski ---
I checked it using Git Bash and got 2048.
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
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.
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.
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
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
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
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
: 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
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
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.
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.
++
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.
++
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
: 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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87732
--- Comment #1 from Daniel Fruzynski ---
New warning for this also would be welcome.
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87731
--- Comment #3 from Daniel Fruzynski ---
Logged Bug 87736 for new proposed attributes.
-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
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88097
Daniel Fruzynski changed:
What|Removed |Added
Status|RESOLVED|UNCONFIRMED
Resolution|INVALI
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.
: 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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88153
Daniel Fruzynski changed:
What|Removed |Added
Status|RESOLVED|UNCONFIRMED
Resolution|INVALI
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;
+
: 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
: 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.
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
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
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*)(&
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
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):
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
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
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.
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
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
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
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
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
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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81664
Daniel Fruzynski changed:
What|Removed |Added
Status|RESOLVED|UNCONFIRMED
Resolution|INVALI
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81664
Daniel Fruzynski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
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
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"
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
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.
: 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
: 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
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
: 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)
{
: 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
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
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
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.
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(&
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.
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
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
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
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
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
++
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
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
++
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
: 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
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.
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)
: 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
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
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
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
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
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
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
: 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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=31893
Daniel Fruzynski changed:
What|Removed |Added
CC||bugzilla@poradnik-webmaster
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
101 - 187 of 187 matches
Mail list logo