[LLVMbugs] [Bug 16454] New: clang blindly include's altivec.h given -maltivec -- even on assembly code!
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jun 25 16:15:09 PDT 2013
http://llvm.org/bugs/show_bug.cgi?id=16454
Bug ID: 16454
Summary: clang blindly include's altivec.h given -maltivec --
even on assembly code!
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Driver
Assignee: unassignedclangbugs at nondot.org
Reporter: chandlerc at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
% touch x.S
% ./bin/clang -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S
# 1 "x.S"
# 1 "<built-in>" 1
# 158 "<built-in>"
# 1
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
1 3
# 39
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
3
static vector signed char __attribute__((__overloadable__, __always_inline__))
vec_perm(vector signed char __a, vector signed char __b, vector unsigned char
__c);
...
wat....
This is running the preprocessor on the assembly file, why does it have C
builtin functions in it??? Well:
% ./bin/clang -v -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S
clang version 3.4
Target: powerpc64-unknown-linux-gnu
Thread model: posix
"/home/chandlerc/src/llvm.git/ninja-build/bin/clang-3.1" -cc1 -triple
powerpc64-unknown-linux-gnu -E -disable-free -main-file-name x.S
-mrelocation-model static -mdisable-fp-elim -fmath-errno -mconstructor-aliases
-target-cpu ppc64 -target-feature +altivec -v -coverage-file
/home/chandlerc/src/llvm.git/ninja-build/- -resource-dir
/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4 -internal-isystem
/usr/local/include -internal-isystem
/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fno-dwarf-directory-asm -fdebug-compilation-dir
/home/chandlerc/src/llvm.git/ninja-build -ferror-limit 19 -fmessage-length 283
-faltivec -mstackrealign -fno-signed-char -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fdiagnostics-show-option
-fcolor-diagnostics -vectorize-loops -o - -x assembler-with-cpp x.S
clang -cc1 version 3.4 based upon LLVM 3.4svn default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include
/usr/include
End of search list.
# 1 "x.S"
# 1 "<built-in>" 1
# 158 "<built-in>"
# 1
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
1 3
# 39
"/home/chandlerc/src/llvm.git/ninja-build/bin/../lib/clang/3.4/include/altivec.h"
3
static vector signed char __attribute__((__overloadable__, __always_inline__))
vec_perm(vector signed char __a, vector signed char __b, vector unsigned char
__c);
....
Note the '-faltivec' we pass to Clang's -cc1.... this seems deeply suspicious.
Either we shouldn't pass that at all, shouldn't pass it when just running the
preprocessor, or shouldn't do the automatic include of altivec.h when we see
that and are in assembler-with-cpp mode. =/
--
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/20130625/1730153c/attachment.html>
More information about the llvm-bugs
mailing list