Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation error (-std=gnu++14 ) : altivec types aliases with 'using' keyword and macros preprocessor in the same file #1861

Open
quickwritereader opened this issue Dec 8, 2020 · 6 comments
Labels

Comments

@quickwritereader
Copy link

quickwritereader commented Dec 8, 2020

#include <altivec.h>
using vdbl =  __vector double;

#define BREAK 1

workaround 0:
-std=c++14
workaround 1:
typedef __vector double vdbl;
workaround 2:
using vdbl = __attribute__((altivec(vector__))) double;
workaround 3:
putting dummy function between
void dummy(){};

@quickwritereader
Copy link
Author

@quickwritereader quickwritereader changed the title alias using and macros preprocessor together breaks compilation while using altivec types and -std=gnu++14 in the same file alias using and macros preprocessor together breaks compilation (-std=gnu++14 ) while using altivec types and preprocessor in the same file Dec 8, 2020
@quickwritereader quickwritereader changed the title alias using and macros preprocessor together breaks compilation (-std=gnu++14 ) while using altivec types and preprocessor in the same file compilation error (-std=gnu++14 ) : altivec types aliases with 'using' keyword and macros preprocessor in the same file Dec 8, 2020
@Flamefire
Copy link

This is intresting indeed. I also found there is some dependency on maltivec vs mvsx and ppc vs ppcle: https://godbolt.org/z/4bGsh8
It seems to swallow what comes after __vector

@mscastanho
Copy link
Contributor

I was able to reproduce it on AT 14:

$ cat /tmp/test-vector.c 
#include <altivec.h>
using vdbl =  __vector double;
#define BREAK 1
$ /opt/at14.0/bin/g++ -c /tmp/test-vector.c 
/tmp/test-vector.c:4:15: error: expected type-specifier before numeric constant
    4 | #define BREAK 1
      |               ^
/tmp/test-vector.c:4:9: note: in expansion of macro ‘BREAK’
    4 | #define BREAK 1
      |         ^~~~~
$ /opt/at14.0/bin/g++ -c /tmp/test-vector.c -std=c++14
$

@mscastanho
Copy link
Contributor

@quickwritereader This looks like a general GCC bug, not limited to AT. Could you open a bug report upstream (gcc.gnu.org/bugzilla), please? Thanks!

@tuliom
Copy link
Contributor

tuliom commented Dec 23, 2020

AFAICS, this issue is still broken on AT 14.
I'm reopening this issue so that we can use it to track the fix downstream.

@tuliom tuliom reopened this Dec 23, 2020
@tuliom tuliom added the bug label Dec 23, 2020
@tuliom
Copy link
Contributor

tuliom commented Jun 22, 2021

I didn't find a bug report upstream for this issue, so I reported it: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants