[llvm-testresults] Red bots at night, buildczar's delight?

Chandler Carruth chandlerc at google.com
Wed Nov 17 16:35:59 PST 2010


On Wed, Nov 17, 2010 at 11:33 AM, dalej <dalej at apple.com> wrote:

>
> On Nov 17, 2010, at 10:39 AM, dalej wrote:
> >>>> clang-i386-darwin10 running the gcc testsuite developed 5 new failures
> (there are others, claimed by Rafael but not fixed) in the range
> 119343-119345 (build 1625).  That's Chandler and John; all the patches look
> unrelated to the failures to me, but obviously one of them isn't.
>
> John analyzed this as:
>
> >>> gcc.apple/default-x86_64-sse3.c has:
> >>> #include <pmmintrin.h>
>
> ...which eventually includes <mm_malloc.h>, a gcc-supplied header....
>
> >>> gcc's mm_malloc.h has:
> >>> #include <stdlib.h>
> >>>
> >>> After r119343, Clang's mm_malloc.h has:
> >>> #include <stddef.h>
> >>>
> >>> The test case contains a (spurious) call to exit().  Cue clang warning
> about exit() not being declared and dejagnu complaining about extra
> "errors".
>
> I said:
>
> > there's no reason <pmmintrin.h> should declare exit.  Test is broken,
> I'll fix.
>
>
> but on further consideration I'm not so sure.  gcc's *mmintrin.h files have
> been (indirectly) including <stdlib.h> forever, at least since 2004, and use
> of those headers is widespread in X86 code.  Removing <stdlib.h> breaks
> these 5 tests, and may well break user code.   I don't think these headers
> are covered by any standard, but I'm not seeing a good reason to break
> compatibility with gcc in this way.  Chandler, why did you do this?  Other
> opinions?


Sorry this broke stuff. =/

My motivation for the change was quite simple: this is a builtin header
file, and as such a minimal set of system header includes is preferable.
None is even more preferable as it provides for the use of the header in a
freestanding context. When I've discussed this header in the past, the
sentiment from Chris and others was that there was a general trend in both
GCC and Clang to reduce the number of system headers included by builtin
headers.

I'd vote for continuing the trend. This isn't the first time it has happened
(GCC dropped errno.h from mm_malloc.h not too long ago) and I can't imagine
it will be the last. It's hard to argue that we should match GCC on this
front when in fact, GCC is a moving target here, and moving in the same
direction if at a different speed.

I also cannot come up with a principled reason why any code should expect an
*mmintrin.h header to provide the definitions within stdlib.h. 'exit()' in
particular just doesn't make sense. I think finding this bad code and fixing
it is the correct approach.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-testresults/attachments/20101117/e7e592ef/attachment.html>


More information about the llvm-testresults mailing list