Re: Implicit conversion to a generic vector type

2016-05-26 Thread martin krastev
Hi Marc,

Thank you for the reply. So it's a known g++ issue with a candidate
patch. Looking at the patch, I was wondering, what precludes the
generic vector types form being proper arithmetic types?

Regards,
Martin

On 26 May 2016 at 09:02, Marc Glisse  wrote:
> On Thu, 26 May 2016, martin krastev wrote:
>
>> Hello,
>>
>> I've been scratching my head over an implicit conversion issue,
>> depicted in the following code:
>>
>>
>> typedef __attribute__ ((vector_size(4 * sizeof(int int
>> generic_int32x4;
>>
>> struct Foo {
>>Foo() {
>>}
>>Foo(const generic_int32x4& src) {
>>}
>>operator generic_int32x4() const {
>>return (generic_int32x4){ 42 };
>>}
>> };
>>
>> struct Bar {
>>Bar() {
>>}
>>Bar(const int src) {
>>}
>>operator int() const {
>>return 42;
>>}
>> };
>>
>> int main(int, char**) {
>>
>>const Bar b = Bar() + Bar();
>>const generic_int32x4 v = (generic_int32x4){ 42 } + (generic_int32x4){
>> 42 };
>>const Foo e = generic_int32x4(Foo()) + generic_int32x4(Foo());
>>const Foo f = Foo() + Foo();
>>const Foo g = (generic_int32x4){ 42 } + Foo();
>>const Foo h = Foo() + (generic_int32x4){ 42 };
>>return 0;
>> }
>>
>> In the above, the initialization expression for local 'b' compiles as
>> expected, and so do the expressions for locals 'v' and 'e'. The
>> initializations of locals 'f', 'g' and 'h', though, fail to compile
>> (under g++-6.1.1, likewise under 5.x and 4.x) with:
>>
>> $ g++-6 xxx.cpp
>> xxx.cpp: In function ‘int main(int, char**)’:
>> xxx.cpp:28:22: error: no match for ‘operator+’ (operand types are
>> ‘Foo’ and ‘Foo’)
>>  const Foo f = Foo() + Foo();
>>~~^~~
>> xxx.cpp:29:40: error: no match for ‘operator+’ (operand types are
>> ‘generic_int32x4 {aka __vector(4) int}’ and ‘Foo’)
>>  const Foo g = (generic_int32x4){ 42 } + Foo();
>> ~~~^~~
>> xxx.cpp:30:22: error: no match for ‘operator+’ (operand types are
>> ‘Foo’ and ‘generic_int32x4 {aka __vector(4) int}’)
>>  const Foo h = Foo() + (generic_int32x4){ 42 };
>>~~^
>>
>> Apparently there is some implicit conversion rule that stops g++ from
>> doing the expected implicit conversions, but I can't figure out which
>> rule that is. The fact clang handles the code without an issue does
>> not help either. Any help will be appreciated.
>
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57572
>
> --
> Marc Glisse


Re: Implicit conversion to a generic vector type

2016-05-26 Thread Marc Glisse

On Thu, 26 May 2016, martin krastev wrote:


Thank you for the reply. So it's a known g++ issue with a candidate
patch. Looking at the patch, I was wondering, what precludes the
generic vector types form being proper arithmetic types?


In some cases vectors act like arithmetic types (operator+, etc), and in 
others they don't (conversions in general). We have scalarish_type_p for 
things that are scalars or vectors, we could add arithmeticish_type_p ;-)


(I think the name arithmetic comes directly from the standard, so we don't 
want to change its meaning)


--
Marc Glisse


gcc-6-20160526 is now available

2016-05-26 Thread gccadmin
Snapshot gcc-6-20160526 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/6-20160526/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 6 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-6-branch 
revision 236799

You'll find:

 gcc-6-20160526.tar.bz2   Complete GCC

  MD5=dc42bb597212c4b6ea981c2374b1d2ed
  SHA1=447d23c67db78d0c23892aa80d8a269326c2b20b

Diffs from 6-20160519 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-6
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


GCC 5 Branch is frozen

2016-05-26 Thread Richard Biener
Hi,

The GCC 5 branch is frozen now in preparation for a GCC 5.4 release candidate.  
All changes require release manager approval until after the GCC 5.4 release.

Thanks,
Richard.