https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106582
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>
080157fe: movs r3, #0
08015800: ldr.w r2, [r9, #20]
08015804: str r2, [r3, #12]
This is doing a store at the address 12 which is invalid normally.
I suspect for your code you need -fno-delete-null-pointer-checks .
Or you are missing a null pointer check.
The code does:
if (pQueryChunk && ioIsValid(pRawChunk))
{
pQueryChunk->pSrcDriver = pRawChunk->pSrcDriver;
}
else
{
if (pParser)
{
pQueryChunk->pSrcDriver = pParser->pSourceDriver;
}
}
But the store for "pQueryChunk->pSrcDriver" is not checked to see if
pQueryChunk was a non-null pointer before doing the store after the check that
pParser was a non-null pointer.
That is I don't think this is a bug in GCC.