[llvm-commits] Fix K&R prototype handling

Chris Lattner clattner at apple.com
Thu Jan 4 15:25:52 PST 2007


This patch causes us to compile functions like:

p1 (f2, l)
float f2; short l;  {
   printf("%d\n", l);
}

into:

define i32 %p1(double %f2, i32 %l) {

instead of:

define i32 %p1(float %f2, i16 %l) {

due to K&R promotion rules.  This fixes a miscompilation of  
SingleSource/UnitTests/2007-01-04-KNR-Args.c on PowerPC at -O0.

-Chris


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070104/5c2b9cf1/attachment.txt>


More information about the llvm-commits mailing list