This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch / RFC] PR 45385
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 21 Oct 2011 10:56:15 -0400
- Subject: Re: [C++ Patch / RFC] PR 45385
- References: <4EA148F8.40404@oracle.com>
I think the fix for 35602 was wrong; instead of trying to suppress the
warning, we should avoid building expressions that trip it. In this
case, the problem is a type mismatch in build_vec_init between
maxindex/iterator (ptrdiff_type_node) and array_type_nelts_total
(sizetype). And indeed, converting (ptrdiff_t)-1 to unsigned changes
its sign.
I think a better fix for 35602 would be to bail out of build_vec_init
exit early if maxindex is -1.
Jason