[llvm-commits] [llvm] r123990 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp unittests/ADT/TripleTest.cpp

Renato Golin Renato.Golin at arm.com
Sun Jan 23 13:03:56 PST 2011


On 23/01/11 13:21, Duncan Sands wrote:
> The advantage of this very simple scheme is that we don't need 1500 lines of
> crazy logic like in GCC's config.sub. The disadvantage is that while it is
> good enough for what LLVM does with triples, front-ends like clang may need
> more. In my opinion if clang needs more it should build its own
> infrastructure
> for providing more on top of the triple class, using the output of
> Normalize as
> a useful starting point.

Duncan,

I understood how the normalisation works, and that problem had nothing
to do with the EABI environment. It had to do with the fact that GNU is
an environment (as said in the test TODO comment) and the triple
x86_64-gnu-linux was ignoring the "gnu" part until I added it as an
environment.

The bug (segfault) happened because Triple was reading a three-token
triple (so the vector size was 3) and trying to re-create a four-token
triple (by writing to the 4th element). Before adding GNU as
environment, the bug was never there, but now that environment is not
*always* invalid, the bug showed up.

This is not a band-aid, the vector really needs four elements and has
only three. Maybe that loop has to always create a four-element vector,
even if it doesn't use them all, just in case you just write "gnu" and
that goes to the fourth element.

I'll re-examine the code and will come with a better approach on Monday.

cheers,
--renato

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.





More information about the llvm-commits mailing list