[llvm-bugs] [Bug 47784] New: [PowerPC] Clang disagrees with GCC about type identity of AltiVec vector [un]signed long, mangles differently

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 9 11:02:53 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47784

            Bug ID: 47784
           Summary: [PowerPC] Clang disagrees with GCC about type identity
                    of AltiVec vector [un]signed long, mangles differently
           Product: clang
           Version: trunk
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    nemanja.i.ibm at gmail.com, richard-llvm at metafoo.co.uk

The `vector unsigned long` type is treated by GCC as `vector unsigned int` in
32-bit mode and `vector unsigned long long` in 64-bit mode at the C++ type
system level. Clang does not match this behaviour. This leads to name mangling
differences.

Compiler Explorer link: https://godbolt.org/z/fsxxc5

### SOURCE (<stdin>):
double f(vector unsigned long long);
double f(vector unsigned int);

double (*g(void))(vector unsigned long) {
  return f;
}


### COMPILER INVOCATION:
clang -cc1 -fsyntax-only -triple powerpc64-unknown-linux-gnu -target-cpu pwr7
-xc++ -


### ACTUAL OUTPUT:
<stdin>:4:35: warning: Use of 'long' with '__vector' is deprecated
[-Wdeprecated]
double (*g(void))(vector unsigned long) {
                                  ^
<stdin>:5:10: error: address of overloaded function 'f' does not match required
type 'double (__vector unsigned long)'
  return f;
         ^
<stdin>:2:8: note: candidate function has type mismatch at 1st parameter
(expected '__vector unsigned long' (vector of 2 'unsigned long' values) but has
'__vector unsigned int' (vector of 4 'unsigned int' values))
double f(vector unsigned int);
       ^
<stdin>:1:8: note: candidate function has type mismatch at 1st parameter
(expected '__vector unsigned long' (vector of 2 'unsigned long' values) but has
'__vector unsigned long long' (vector of 2 'unsigned long long' values))
double f(vector unsigned long long);
       ^
1 warning and 1 error generated.


### EXPECTED OUTPUT:
(clean compile)


### COMPILER VERSION INFO (clang++ -v):
clang version 12.0.0 (https://github.com/llvm/llvm-project.git
68e1a8d20795802077987529e1268c184d749564)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/wandbox/clang-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201009/81eaa6d2/attachment.html>


More information about the llvm-bugs mailing list