[Bug c++/78073] inherited initializer_list constructor is not accessible

2016-11-21 Thread a...@q-fu.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78073

Andrey Zholos <a...@q-fu.com> changed:

   What|Removed |Added

 CC||a...@q-fu.com

--- Comment #2 from Andrey Zholos <a...@q-fu.com> ---
I think the below code triggers the same bug. But it seems to be fixed in
latest trunk.


// -std=c++1z

struct A {
A(int, int) {}
};

struct B : A {
using A::A;
};

B b{1, 2};

[Bug tree-optimization/64718] New: Bad 16-bit bswap replacement

2015-01-21 Thread a...@q-fu.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64718

Bug ID: 64718
   Summary: Bad 16-bit bswap replacement
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: a...@q-fu.com
Target: i686-pc-linux-gnu

This code is reduced from htons((int)port) on FreeBSD.

The expression gets replaced with a rotation in a 32-bit register
instead of a 16-bit register, so the upper byte is lost.

int swap(int x) {
return (unsigned short)((unsigned short)x  8 | (unsigned short)x  8);
}

gcc -O2 -S swap.c

swap:
movl4(%esp), %eax
roll$8, %eax   # should be %ax
movzwl  %ax, %eax
ret


Complete program:

#include stdio.h

int swap(int x) {
return (unsigned short)((unsigned short)x  8 | (unsigned short)x  8);
}

int a = 0x1234;
int main() {
int b = 0x1234;
printf(%x - %x\n, a, swap(a));
printf(%x - %x\n, b, swap(b));
}

gcc -O2 swap.c  ./a.out

1234 - 3400
1234 - 3412


[Bug c++/58089] expanding empty parameter pack as constructor arguments requires accessible copy constructor

2013-11-29 Thread a...@q-fu.com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58089

Andrey Zholos a...@q-fu.com changed:

   What|Removed |Added

 CC||a...@q-fu.com

--- Comment #2 from Andrey Zholos a...@q-fu.com ---
I also stumbled onto this bug, and bug 59141 is a duplicate.

It appears the empty parameter pack is expanded as t({}) rather than t().

There is a similar example in 14.5.3p6 that indicates obj should be value-
initialized (not copy-constructed), and clang accepts this code.