<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - incorrect dwarf information about function arguments is produced in one case"
href="http://llvm.org/bugs/show_bug.cgi?id=15662">15662</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>incorrect dwarf information about function arguments is produced in one case
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.2
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>avg@FreeBSD.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=10282" name="attach_10282" title="pre-processed source code">attachment 10282</a> <a href="attachment.cgi?id=10282&action=edit" title="pre-processed source code">[details]</a></span>
pre-processed source code
Function signature in FreeBSD source code is:
void _sx_xunlock(struct sx *sx, const char *file, int line);
clang generated dwarf information (as reported by objdump -W) is:
<1><2c70>: Abbrev Number: 55 (DW_TAG_subprogram)
<2c71> DW_AT_name : (indirect string, offset: 0x1817): _sx_xunlock
<2c75> DW_AT_decl_file : 1
<2c76> DW_AT_decl_line : 373
<2c78> DW_AT_prototyped : 1
<2c78> DW_AT_external : 1
<2c78> DW_AT_inline : 1 (inlined)
<2><2c79>: Abbrev Number: 51 (DW_TAG_formal_parameter)
<2c7a> DW_AT_name : (indirect string, offset: 0xd061): line
<2c7e> DW_AT_decl_file : 1
<2c7f> DW_AT_decl_line : 373
<2c81> DW_AT_type : <a2>
<2><2c85>: Abbrev Number: 51 (DW_TAG_formal_parameter)
<2c86> DW_AT_name : (indirect string, offset: 0xd056): sx
<2c8a> DW_AT_decl_file : 1
<2c8b> DW_AT_decl_line : 373
<2c8d> DW_AT_type : <782c>
<2><2c91>: Abbrev Number: 51 (DW_TAG_formal_parameter)
<2c92> DW_AT_name : (indirect string, offset: 0xc67): file
<2c96> DW_AT_decl_file : 1
<2c97> DW_AT_decl_line : 373
<2c99> DW_AT_type : <32>
That is, order of arguments is recorded as 'line', 'sx', 'file'.
Please see the attached preprocessed file.
My compilation options were:
-pipe -fno-strict-aliasing -march=amdfam10 -std=c99 -g -O -Wall
-Wredundant-decls
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-Winline
-Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions
-Wmissing-include-dirs
-fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equality -nostdinc -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone
-mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding
-fstack-protector -Werror
clang is:
FreeBSD clang version 3.2 (tags/RELEASE_32/final 170710) 20121221
The problem doesn't seem to be a common one.
Thus far, I have seen it only with this function (out of many inspected).
Please also see this thread for a preliminary discussion of this issue:
<a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/028829.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-April/028829.html</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>