This is the mail archive of the
mailing list for the GCC project.
Re: [PR 88214] Check that an argument is pointer before attempting agg jf construction from it
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 20 Dec 2018 15:20:23 +0100
- Subject: Re: [PR 88214] Check that an argument is pointer before attempting agg jf construction from it
- References: <email@example.com> <CAFiYyc3QmA+giL9hUsUsb21tEJCqhFHi=4UXmXzKt6_YJTVV7Q@mail.gmail.com>
On Mon, Dec 10 2018, Richard Biener wrote:
> On Fri, Dec 7, 2018 at 3:59 PM Martin Jambor <firstname.lastname@example.org> wrote:
>> On a related note, would people object to adding the following assert,
>> which would have made this bug much more straightforward to find?
> That's fine with me.
Thanks, I have just committed the following as r267298 after
bootstrapping and testing it on x86_64-linux.
2018-12-20 Martin Jambor <email@example.com>
* tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Assert that
ptr is a pointer.
gcc/tree-ssa-alias.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 85a5de7ce05..66cf2f2c669 100644
@@ -710,6 +710,7 @@ ao_ref_init_from_ptr_and_size (ao_ref *ref, tree ptr, tree size)
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (ptr)));
ref->base = build2 (MEM_REF, char_type_node,
ref->offset = 0;