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]

[Committed] Fix C/31520, bug in finish_decl causing an errorous "array subscript is above array bounds" in 4.3


Hi,
  The problem here is that store_init_value will change the type of the 
decl and in finish_decl, we kept the old type around so we go and call 
complete_array_type even though we already have a completed array type. 
This only shows up on the mainline with -Warray-bounds but it is a latent 
bug introduced by the patch for PR 27184.

Applied to the trunk as obvious after a bootstrap/test on i686-linux-gnu 
with no regressions.

I will apply this to the 4.2 and 4.1 branch after a bootstrap there too.

Thanks,
Andrew Pinski


ChangeLog:
        * c-del.c (finish_decl): Grab the type of the decl after the call 
to store_init_value.

        * testsuite/gcc.dg/gnu89-init-4.c: New testcase.

Attachment: fixpr31520.diff.txt
Description: Text document


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