https://bugs.llvm.org/show_bug.cgi?id=39210
Bug ID: 39210
Summary: [AVR] uint32_t is incorrectly compiled to i16
Product: clang
Version: 7.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Headers
Assignee: unassignedclangb...@nondot.org
Reporter: aykevanlaet...@gmail.com
CC: llvm-bugs@lists.llvm.org
When compiling this function for avr:
#include <stdint.h>
uint32_t size32() {
return 3;
}
With the following options:
clang-7 --target=avr-atmel-none -emit-llvm -S -o intsize.ll -c intsize.c
I get the following IR (cut down to the essential parts):
target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
target triple = "avr-atmel-none"
; Function Attrs: noinline nounwind optnone
define dso_local i16 @size32() #0 {
ret i16 3
}
In other words, uint32_t is compiled to i16 instead of i32 as it should.
I hit this problem while trying to build compiler-rt for AVR and hitting lots
of "shift count >= width of type" warnings which are probably caused by this
problem.
I'm running Debian stable (stretch) with clang-7 from apt.llvm.org.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs