Skip to content
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

ScalarReplAggregates.cpp:474 assert tripped #1417

Closed
llvmbot opened this issue Dec 12, 2006 · 3 comments
Closed

ScalarReplAggregates.cpp:474 assert tripped #1417

llvmbot opened this issue Dec 12, 2006 · 3 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 12, 2006

Bugzilla Link 1045
Resolution FIXED
Resolved on Feb 22, 2010 12:44
Version trunk
OS Linux
Attachments Bytecode
Reporter LLVM Bugzilla Contributor

Extended Description

ScalarReplAggregates.cpp:474 assert tripped while compiling the gcc4 frontend.
Also occurs when running gccld directly on the resulting bytecode (with -O2 -g
removed and -emit-llvm inserted on the compiler's command line):

[compiler ugliness, started in gdb]
Starting program:
/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/gcc/xgcc -O2 -g
-shared-libgcc -B/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/gcc/
-nostdinc++
-L/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/src
-L/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/src/.libs
-B/work/scottm/llvm-cfrontend/i686-unknown-linux-gnu/i686-pc-linux-gnu/bin/
-B/work/scottm/llvm-cfrontend/i686-unknown-linux-gnu/i686-pc-linux-gnu/lib/
-isystem
/work/scottm/llvm-cfrontend/i686-unknown-linux-gnu/i686-pc-linux-gnu/include
-isystem
/work/scottm/llvm-cfrontend/i686-unknown-linux-gnu/i686-pc-linux-gnu/sys-include
-I/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
-I/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/include
-I/work/scottm/llvm-cfrontend/libstdc++-v3/libsupc++ -D_GNU_SOURCE
-fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections -c
../../../../../libstdc++-v3/src/bitmap_allocator.cc -o bitmap_allocator.o
[Thread debugging using libthread_db enabled]
[New Thread -1479231808 (LWP 20699)]
WARNING: EH not supported yet!
cc1plus: /work/scottm/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:474:
bool MergeInType(const llvm::Type*, const llvm::Type*&, const
llvm::TargetData&): Assertion `In->isIntegral() && "Unknown FP type!"' failed.
/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/include/ext/bitmap_allocator.h:
In member function '_Tp*
__gnu_cxx::bitmap_allocator<_Tp>::_M_allocate_single_object() [with _Tp = wchar_t]':
/work/scottm/llvm-cfrontend/obj/i686-unknown-linux-gnu/i686-pc-linux-gnu/libstdc++-v3/include/ext/bitmap_allocator.h:998:
internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See URL:http://llvm.org/bugs for instructions.

[gccld ugliness]
(gemsbok) src gccld bitmap_allocator.bc
gccld: /work/scottm/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:474:
bool MergeInType(const llvm::Type*, const llvm::Type*&, const
llvm::TargetData&): Assertion `In->isIntegral() && "Unknown FP type!"' failed.
gccld((anonymous namespace)::PrintStackTrace()+0x1a)[0x827732a]
/lib/tls/i686/cmov/libc.so.6(abort+0x109)[0xa7cbefb9]
/lib/tls/i686/cmov/libc.so.6(__assert_fail+0x10f)[0xa7cb6fbf]
gccld[0x8116987]
zsh: abort gccld bitmap_allocator.bc

@llvmbot
Copy link
Collaborator Author

llvmbot commented Dec 12, 2006

assigned to @lattner

@llvmbot
Copy link
Collaborator Author

llvmbot commented Dec 12, 2006

The problem here is that In is VoidTy and not handled by the switch cases. At
the beginning of the function there is:
// If this is our first type, just use it.
const PackedType *PTy;
if (Accum == Type::VoidTy || In == Accum) {
Accum = In;
but there's no check to see if In is VoidTy. Perhaps there should be?

This is what triggers the assert:
switch (In->getTypeID()) {
case Type::PointerTyID: In = TD.getIntPtrType(); break;
case Type::FloatTyID: In = Type::UIntTy; break;
case Type::DoubleTyID: In = Type::ULongTy; break;
default:
assert(In->isIntegral() && "Unknown FP type!");
break;
}

Reid.

@lattner
Copy link
Collaborator

lattner commented Dec 12, 2006

Fixed, testcase here:
Transforms/ScalarRepl/2006-12-11-SROA-Crash.ll

Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061211/041239.html

Thanks!

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
clementval pushed a commit to clementval/llvm-project that referenced this issue Feb 16, 2022
Account for paraent components when accessing an extended type component
of an array of derived types.  This is the array version of the scalar code
in PR llvm#1417.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead
Projects
None yet
Development

No branches or pull requests

2 participants