Assignee: ibuclaw at gdcproject dot org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
import std.stdio;
struct test
{
int[0] foo;
};
void main()
{
test* t;
auto a = cast(typeof((*t).foo)[0])t.foo;
writeln(a);
}
/opt/wandbox/gdc-head/lib/gcc
ormal
Priority: P3
Component: d
Assignee: ibuclaw at gdcproject dot org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
import core.stdc.stdio;
extern(C) int main(int argc, char **argv)
{
// works in ldc, dmd, doesnt work in gdc
unction-Attributes.html
Status: UNCONFIRMED
Keywords: documentation
Severity: normal
Priority: P3
Component: d
Assignee: ibuclaw at gdcproject dot org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
>From documentat
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
void test(char x)
{
switch (x)
{
case "abc"[0]: // error: case label does not reduce to an integer constant
p
IRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
unsigned test_mult(unsigned a, unsig
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91882
--- Comment #1 from SztfG at yandex dot ru ---
Similar problem with other tautology:
unsigned int impl_bit(unsigned int a, unsigned int b) // bitwise implication
{
return (~a | b);
}
unsigned int eq_bit(unsigned int a, unsigned int b
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
This functions is always return true regardless of the value of the arguments:
bool bool_xor_test(bool a, bool b)
{
return (a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89478
--- Comment #3 from SztfG at yandex dot ru ---
Another testcase:
int test4 = []() constexpr {int a = a; a = 5; return a;}();
GCC is able compile this, so it "think" this is valid constexpr lambda, but
anyway doing this:
_GLOBAL__s
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89478
--- Comment #2 from SztfG at yandex dot ru ---
(In reply to Marc Glisse from comment #1)
> I think the uninitialized variable makes the initialization not constexpr
> (and indeed gcc/clang complain if you try to declare test constexpr). The
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
constexpr void mul2(int &a, const int b)
{
a = b
ormal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
Target: x86_64-linux-gnu
Here are two function:
void sort2_ternary(int a, int b, int *pa, int *pb)
{
*p
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66152
--- Comment #4 from SztfG at yandex dot ru ---
GCC from trunk doing this:
.Ltext0:
.LC0:
.string ""
.ascii "\001\002\003\004\005\006\007"
bar:
.LFB0:
sub rsp, 24
mov rax, QWORD PTR .LC0[rip]
lea rdi, [rsp+8]
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
Target: x86_64-linux-gnu
Testcase:
#include
#include
#include
int main(void)
{
char a[8], b[8];
char *a_ptr = a+8;
char
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
Target: x86_64-linux-gnu
example:
#include
uint32_t saturation_add(uint32_t a, uint32_t b)
{
const
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87426
--- Comment #1 from SztfG at yandex dot ru ---
reduced testcase
int arr[1] ={ 0 };
int test(int a)
{
return (arr[abs(a)]);
}
: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
#include
#include
//#include
static const uint32_t pow2[511] ={ 0 }; // doesnt matter
#define SQR(x) pow2[x]
uint16_t mul8b(uint8_t a, uint8_t b)
{
return (SQR((uint16_t)a+(uint16_t
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87208
--- Comment #2 from SztfG at yandex dot ru ---
(In reply to Jonathan Wakely from comment #1)
> Dup of PR 51577 ?
Strictly speaking, it is not a dup, because PR 51577 and all the bugs marked as
dups of PR 51577 are about finding an operator w
: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
[temp.dep.res]/1: In resolving dependent names, names from the following
sources are considered:
— Declarations that are
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
#include
void crasher()
{
constexpr __m128 w = {1,2,3,4};
asm ("addps %[w], %[w]" : : [w] ""(w));
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51515
SztfG at yandex dot ru changed:
What|Removed |Added
CC||SztfG at yandex dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80574
SztfG at yandex dot ru changed:
What|Removed |Added
CC||SztfG at yandex dot ru
ation
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
GCC can't simplify static inline function for xor/xnor, but can, if used macro
instead
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80574
--- Comment #5 from SztfG at yandex dot ru ---
> He did not claim it was always better...
Ahh, so I need to do some research to figure out, in which cases static inline
function is better, and in which macro is better. It's bad
> P
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80574
--- Comment #3 from SztfG at yandex dot ru ---
Georg-Johann Lay, GCC not always do things better if use static inline function
instead macro. For example, this code:
#include
#define TYPE uint8_t
#define M_XOR(a,b) ((!!a)^(!!b))
#define
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
Created attachment 41287
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41287&action=edit
nested ternary sample
GCC
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
testcase:
int main()
{
auto f = [](void* ptr) { goto *ptr; };
f(&&label);
label:
return 0;
}
$ g++ -std=c++11 -O2 test.cpp
test.cpp: In
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71343
--- Comment #2 from SztfG at yandex dot ru ---
This also not optimized by gcc:
unsigned int test3(unsigned int a , unsigned int b)
{
return (a << 2) + (b << 2) == (a + b) << 2;
}
but this works:
unsigned int test4(unsigne
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
Host: x86_64-linux-gnu
Target: x86_64
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
this function
unsigned int test12(unsigned int a , unsigned in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68027
--- Comment #4 from SztfG at yandex dot ru ---
I think this can be optimized in this way:
cmpl$100, %edi
jg a1
jne a2
jmp a3
without any label jumps
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68027
--- Comment #3 from SztfG at yandex dot ru ---
btw why nobody confirm my old reported bug about stack-allocated array missed
optimization https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66152 ?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68027
--- Comment #1 from SztfG at yandex dot ru ---
># no need to do this, eax is equal $100 at this point
I mean edi. after this part:
cmpl$100, %edi
jg .L5
jne .L6
if it passed this jg jne instruction with
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
C source code:
int a1(int);
int a2(int);
int a3(int);
int test1(int a)
{
if (a > 100) return a1(a);
else if (a < 100) retur
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66123
--- Comment #7 from SztfG at yandex dot ru ---
Similar bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66178
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66178
--- Comment #2 from SztfG at yandex dot ru ---
another testcase:
int test(void)
{
static int a = ((char *)&&l1-(char *)&&l2)-1;
l1:
l2:
return a;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66178
--- Comment #1 from SztfG at yandex dot ru ---
better test case
int test(void)
{
static int a = ((char *)&&l2-(char *)&&l3)+((char *)&&l1-(char *)&&l2);
l1:
l2:
l3:
return a;
}
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
c and c++ compiler crashes. Testcase:
void bar(int);
int test(void) {
static int test = ((char *)&&l2-(char *)&&l3)+((char *)&&l1-(char *)&&a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66152
--- Comment #1 from SztfG at yandex dot ru ---
If array of char is initialized using string, gcc can use larger mov
instruction, like movabsq, movq, movl etc. but not movdqa, movaps or other xmm
But if zero byte appears in string, compiler always
-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
for code
void foo(char *);
void bar(void)
{
char a[] = {0,1,2,3,4,5,6,7};
foo(a);
}
gcc generates many movb instructions:
subq$24, %rsp
movq%rsp
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: SztfG at yandex dot ru
Target Milestone: ---
Created attachment 35529
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35529&action=edit
Prepr
40 matches
Mail list logo