From 03fe405587eb3bc859a5f3fe117053af0b172a96 Mon Sep 17 00:00:00 2001 From: Simon Cook Date: Wed, 22 Apr 2015 11:22:01 +0100 Subject: [PATCH] [AVR] Fix function call for 8-bit division. This should be __divmodhi4 for AVR. Fixes bug #70. --- lib/Target/AVR/AVRISelLowering.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Target/AVR/AVRISelLowering.cpp b/lib/Target/AVR/AVRISelLowering.cpp index d92dea93960..f78452cf9e1 100644 --- a/lib/Target/AVR/AVRISelLowering.cpp +++ b/lib/Target/AVR/AVRISelLowering.cpp @@ -129,6 +129,9 @@ AVRTargetLowering::AVRTargetLowering(AVRTargetMachine &tm) : setOperationAction(ISD::MULHS, MVT::i8, Expand); setOperationAction(ISD::MULHS, MVT::i16, Expand); + // Custom names for libgcc/compiler_rt functions + setLibcallName(RTLIB::UDIV_I8, "__divmodhi4"); + setMinFunctionAlignment(1); }