New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 37339 - FunctionComparator::cmpInlineAsm is overly restrictive
Summary: FunctionComparator::cmpInlineAsm is overly restrictive
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Transformation Utilities (show other bugs)
Version: trunk
Hardware: All All
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-04 09:03 PDT by Anthony Ramine
Modified: 2018-05-17 05:07 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s): r331990


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Ramine 2018-05-04 09:03:52 PDT
cmpInlineAsm will crash with an assertion if the two InlineAsm pointers aren't equal but their fields are all compared equal. This is overly restrictive, given two function types may compare equal even if they don't point to the same function type.

This leads to https://godbolt.org/g/qn3ZNM failing to compile with assertions on.

Found in https://github.com/rust-lang/rust/pull/49479#issuecomment-386406036.
Comment 1 Anthony Ramine 2018-05-04 09:06:02 PDT
It has been suggested that the assertion could be replaced by this more specific one:

```
L->getFunctionType() != R->getFunctionType()
```
Comment 2 Nikita Popov 2018-05-17 05:07:14 PDT
This has been fixed by https://reviews.llvm.org/rL331990.