[Bug d/101490] New: ICE at convert_expr(tree_node*, Type*, Type*)

2021-07-17 Thread SztfG at yandex dot ru via Gcc-bugs
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

[Bug d/101441] New: __FUNCTION__ doesn't work in core.stdc.stdio functions without cast

2021-07-13 Thread SztfG at yandex dot ru via Gcc-bugs
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 puts

[Bug d/101440] New: Documentation bug for __attribute__ ((access))

2021-07-13 Thread SztfG at yandex dot ru via Gcc-bugs
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

[Bug c/92487] New: case label error when label is made from character of C string

2019-11-12 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/92233] New: missed optimisation for multiplication when it's known that at least one of the arguments is 0

2019-10-25 Thread SztfG at yandex dot ru
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, unsigned b

[Bug tree-optimization/91882] boolean XOR tautology missed optimisation

2019-09-24 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/91882] New: boolean XOR tautology missed optimisation

2019-09-24 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/89478] missed optimization for lambda expression when variable is uninitialized when declared

2019-03-05 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/89478] missed optimization for lambda expression when variable is uninitialized when declared

2019-02-24 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/89478] New: missed optimization for lambda expression when variable is uninitialized when declared

2019-02-23 Thread SztfG at yandex dot ru
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 , const int b) { a = b * 2

[Bug tree-optimization/89360] New: GCC doesn't emit movcc instruction in some cases

2019-02-15 Thread SztfG at yandex dot ru
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) { *pa

[Bug rtl-optimization/66152] suboptimal load bytes to stack

2019-02-15 Thread SztfG at yandex dot ru
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]

[Bug c/89157] New: Pointers comparison do not correspond to the standard

2019-02-01 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/88603] New: optimization missed for saturation arithmetic add

2018-12-26 Thread SztfG at yandex dot ru
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

[Bug c/87426] c_parser_unary_expression ICE

2018-09-24 Thread SztfG at yandex dot ru
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)]); }

[Bug c/87426] New: c_parser_unary_expression ICE

2018-09-24 Thread SztfG at yandex dot ru
: 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

[Bug c++/87208] dependent name resolution selects a function it should have NEVER considered

2018-09-04 Thread SztfG at yandex dot ru
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 opera

[Bug c++/87208] New: dependent name resolution selects a function it should have NEVER considered

2018-09-03 Thread SztfG at yandex dot ru
: 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

[Bug inline-asm/84625] New: ICE with constexpr and inline asm

2018-02-28 Thread SztfG at yandex dot ru
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)); }

[Bug c/51515] Unable to forward declare nested functions

2017-07-30 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/80574] GCC fail to optimize nested ternary

2017-05-04 Thread 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

[Bug tree-optimization/80588] New: GCC can't simplify static inline function with xor/xnor

2017-05-01 Thread SztfG at yandex dot ru
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. Testcase

[Bug tree-optimization/80574] GCC fail to optimize nested ternary

2017-05-01 Thread SztfG at yandex dot ru
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 > Please

[Bug tree-optimization/80574] GCC fail to optimize nested ternary

2017-05-01 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/80574] New: GCC fail to optimize nested ternary

2017-04-30 Thread SztfG at yandex dot ru
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=edit nested ternary sample GCC fail to optim

[Bug tree-optimization/78383] New: label as values ICE with C++ lambda

2016-11-16 Thread SztfG at yandex dot ru
-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: return 0; } $ g++ -std=c++11 -O2 test.cpp test.cpp: In function ‘

[Bug tree-optimization/71343] missed optimization (can't "prove" shift and multiplication equivalence)

2016-10-23 Thread SztfG at yandex dot ru
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

[Bug tree-optimization/71923] New: Two consecutive "rep ret" instruction in assembly output of recursive function

2016-07-18 Thread SztfG at yandex dot ru
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

[Bug rtl-optimization/71343] New: missed optimization (can't "prove" shift and multiplication equivalence)

2016-05-30 Thread SztfG at yandex dot ru
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 int b)

[Bug tree-optimization/68027] conditional statement and unnecessary register assignment

2015-10-20 Thread SztfG at yandex dot ru
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 ?

[Bug tree-optimization/68027] conditional statement and unnecessary register assignment

2015-10-20 Thread SztfG at yandex dot ru
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

[Bug middle-end/68027] conditional statement and unnecessary register assignment

2015-10-19 Thread SztfG at yandex dot ru
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

[Bug middle-end/68027] New: conditional statement and unnecessary register assignment

2015-10-19 Thread SztfG at yandex dot ru
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) ret

[Bug tree-optimization/66178] Another label as values ICE

2015-05-16 Thread SztfG at yandex dot ru
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; }

[Bug tree-optimization/66178] New: Another label as values ICE

2015-05-16 Thread SztfG at yandex dot ru
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 *)l2); l1: l2: l3: bar(test); return

[Bug tree-optimization/66178] Another label as values ICE

2015-05-16 Thread SztfG at yandex dot ru
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; }

[Bug tree-optimization/66123] [4.8/4.9/5 Regression] Array of labels as values + ternary operator + pointer arithmetic = internal compiler error

2015-05-16 Thread SztfG at yandex dot ru
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

[Bug rtl-optimization/66152] New: suboptimal load bytes to stack

2015-05-14 Thread SztfG at yandex dot ru
-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

[Bug rtl-optimization/66152] suboptimal load bytes to stack

2015-05-14 Thread SztfG at yandex dot ru
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

[Bug c/66123] New: Array of labels as values + ternary operator + pointer arithmetic = internal compiler error

2015-05-12 Thread SztfG at yandex dot ru
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=35529action=edit Preprocessed source