This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch / RFC] PR 45385


On 10/21/2011 04:56 PM, Jason Merrill wrote:
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.
Ah great, thanks a lot. The below passes testing, if it's Ok I would be tempted to backport it to the 4_6-branch too after 4.6.2 is out..

Thanks again,
Paolo.

//////////////////////

Attachment: CL_45385_2
Description: Text document

Attachment: patch_45385_2
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]