Skip to content

In GetVectorElementPointer - EltSize assertions fail if getSizeInBits is less than 8 #29388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Aug 17, 2016 · 4 comments
Labels
bugzilla Issues migrated from bugzilla invalid Resolved as invalid, i.e. not a bug llvm:codegen

Comments

@llvmbot
Copy link
Member

llvmbot commented Aug 17, 2016

Bugzilla Link 29018
Version 3.8
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @RKSimon

Extended Description

The code at lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:1031 seems to have issues if the element size is less than a full byte (e.g., processing a "i1"), as EltSize will truncate to 0 and then the assertion will fail. Allowing the assertion to be ignored if EltSize == 0 seems to fix this issue, but it looks like something that needs more review:

// Calculate the element offset and add it to the pointer.
unsigned EltSize = EltVT.getSizeInBits() / 8; // FIXME: should be ABI size.
if (EltSize)
{
assert(EltSize * 8 == EltVT.getSizeInBits() &&
"Converting bits to bytes lost precision");
}

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@Endilll
Copy link
Contributor

Endilll commented Jul 15, 2023

I don't see 8-bit bytes being hardcoded in that file as of post-16 trunk.

CC @efriedma-quic @rjmccall

@Endilll Endilll closed this as completed Jul 15, 2023
@efriedma-quic
Copy link
Collaborator

I'm pretty sure the code in question was fixed.

@vfdff
Copy link
Contributor

vfdff commented May 21, 2024

hi @efriedma-quic ,I find there is some crash related above assert, eg: 42304, 54423

@vfdff vfdff reopened this May 21, 2024
@efriedma-quic
Copy link
Collaborator

This isn't really a useful ticket as-is; please track each issue in a separate ticket, e.g. "SplitVecRes_INSERT_SUBVECTOR is broken for non-byte-size types", or "SplitVecOp_EXTRACT_VECTOR_ELT is broken for non-byte-size types larger than 8 bits".

@efriedma-quic efriedma-quic closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
@EugeneZelenko EugeneZelenko added the invalid Resolved as invalid, i.e. not a bug label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla invalid Resolved as invalid, i.e. not a bug llvm:codegen
Projects
None yet
Development

No branches or pull requests

5 participants