1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/lib/Target/BPF
Yonghong Song c3a06b2be5 bpf: fix a strict-aliasing issue
Davide Italiano reported the following issue if llvm
is compiled with gcc -Wstrict-aliasing -Werror:
.....
lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFISelDAGToDAG.cpp.o
../lib/Target/BPF/BPFISelDAGToDAG.cpp: In member function ‘virtual
void {anonymous}::BPFDAGToDAGISel::PreprocessISelDAG()’:
../lib/Target/BPF/BPFISelDAGToDAG.cpp:264:26: warning: dereferencing
type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]
       val = *(uint16_t *)new_val;
.....

The error is caused by my previous commit (revision 305560).

This patch fixed the issue by introducing an union to avoid
type casting.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 305608
2017-06-16 23:28:04 +00:00
..
Disassembler Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
InstPrinter Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MCTargetDesc Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
TargetInfo Move the global variables representing each Target behind accessor function 2016-10-09 23:00:34 +00:00
BPF.h
BPF.td convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
BPFAsmPrinter.cpp bpf: clang-format on BPFAsmPrinter.cpp 2017-06-13 16:17:20 +00:00
BPFCallingConv.td
BPFFrameLowering.cpp
BPFFrameLowering.h
BPFInstrFormats.td
BPFInstrInfo.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
BPFInstrInfo.h Finish renaming remaining analyzeBranch functions 2016-09-14 20:43:16 +00:00
BPFInstrInfo.td bpf: set missing types in insn tablegen file 2017-06-16 15:30:55 +00:00
BPFISelDAGToDAG.cpp bpf: fix a strict-aliasing issue 2017-06-16 23:28:04 +00:00
BPFISelLowering.cpp [bpf] disallow global_addr+off folding 2017-05-26 22:32:41 +00:00
BPFISelLowering.h [bpf] disallow global_addr+off folding 2017-05-26 22:32:41 +00:00
BPFMCInstLower.cpp Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
BPFMCInstLower.h [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
BPFRegisterInfo.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
BPFRegisterInfo.h
BPFRegisterInfo.td
BPFSubtarget.cpp
BPFSubtarget.h
BPFTargetMachine.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
BPFTargetMachine.h Delete Reloc::Default. 2016-05-18 22:04:49 +00:00
CMakeLists.txt [BPF] Correct the file name of the -gen-asm-matcher output file to not start with X86. 2017-05-31 19:01:05 +00:00
LLVMBuild.txt [bpf] add BPF disassembler 2016-11-20 02:25:00 +00:00