TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

GCC 4.8 Breaks Broken SPEC 2006 Benchmarks (fixed)

48 点作者 neeee大约 12 年前

5 条评论

jedbrown大约 12 年前
It's disappointing that SPEC refuses to fix the code and is spreading disinformation like "it is at minimum arguable that the code fragment is compliant under the C89 standard". If the global 'int d[16]' is placed at the very end of a page (which the linker is allowed to do), that code compiled in the most naive possible way will SEGV.
评论 #5429094 未加载
评论 #5429626 未加载
kzrdude大约 12 年前
As pointed out by the LWN crowd, the article author is mistaken, because the 4.8 release doesn't do this. <a href="http://lwn.net/Articles/544123/" rel="nofollow">http://lwn.net/Articles/544123/</a>
ginko大约 12 年前
I'm not really a crack at micro-optimizing C code, so can anyone here explain to me why the given function was written in the form it was?<p>Why not something like this:<p><pre><code> int d[16]; int SATD (void) { int satd = 0, dd, k; for (k=0; k&#60;16; ++k) { dd = d[k]; satd += (dd &#60; 0 ? -dd : dd); } return satd; } </code></pre> Does this generate slower code?
评论 #5428654 未加载
评论 #5428924 未加载
miga大约 12 年前
Should SPEC pay for static analysis services like Coverity on the code that enters the benchmark?<p>Or does it take a law to make them fix bugs in the code they ship?
mrich大约 12 年前
As pointed out in the comments the code is quite contrived to begin with, no surprise such mistakes go unnoticed.<p>As long as a warning is emitted when the compiler relies only such undefined behavior it is a good thing to optimize this heavily, there are not many other ways to get more performance from C/C++.