<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 8, 2015 at 9:40 PM, Roman Bogorodskiy <span dir="ltr"><<a href="mailto:bogorodskiy@gmail.com" target="_blank">bogorodskiy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have a question regarding -Wframe-larger-than in clang. I'm building a<br>
project (libvirt git version) that uses this flag. The system I build on<br>
is FreeBSD 11.0-CURRENT amd64.<br>
<br>
Build fails with:<br>
<br>
virshtest.c:253:1: error: stack frame size of 5512 bytes in function<br>
'mymain' [-Werror,-Wframe-larger-than=]<br>
mymain(void)<br>
<br>
This happens with:<br>
<br>
FreeBSD clang version 3.6.0 (tags/RELEASE_360/final 230434) 20150225<br>
<br>
I have tried some other versions as well and figured out that this one<br>
also triggers the same error:<br>
<br>
clang version 3.5.2 (tags/RELEASE_352/final)<br>
<br>
However, this one works fine:<br>
<br>
clang version 3.4.2 (tags/RELEASE_34/dot2-final)<br></blockquote><div><br>I think we implemented -Wframe-larger-than in clang relatievly recently, so I wouldn't be too surprised if it didn't fire in older releases of Clang<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I've also tried gcc:<br>
<br>
gcc version 5.1.0 (FreeBSD Ports Collection)<br></blockquote><div><br>Clang and GCC produce different frame layouts, especially at -O0 Clang doesn't do much in the way of stack reuse, so it wouldn't surprise me if the warning fires on Clang -O0 but not GCC.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
And it also works fine.<br>
<br>
Is that an intentional behavior that the newer clang versions (>=3.5)<br>
generate a code with a larget stack frame size?<br>
<br>
PS I'm not posting a complete CFLAGS line used in the project as it's<br>
quite huge. Specific value for -Wframe-larger-than used is 4096. Please<br>
let me know if some other information is needed.<br>
<br>
Thanks,<br>
<br>
Roman Bogorodskiy<br>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div></div>