This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH] Fix mips hang with --help=target --help=optimizers (PR target/82880)
- From: "Moore, Catherine" <Catherine_Moore at mentor dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, Matthew Fortune <matthew dot fortune at imgtec dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, James Cowgill <James dot Cowgill at imgtec dot com>
- Date: Tue, 21 Nov 2017 14:46:17 +0000
- Subject: RE: [PATCH] Fix mips hang with --help=target --help=optimizers (PR target/82880)
- Authentication-results: sourceware.org; auth=none
- References: <20171121140647.GZ14653@tucnak>
> -----Original Message-----
> From: Jakub Jelinek [mailto:jakub@redhat.com]
> Sent: Tuesday, November 21, 2017 9:07 AM
> To: Moore, Catherine <Catherine_Moore@mentor.com>; Matthew
> Fortune <matthew.fortune@imgtec.com>
> Cc: gcc-patches@gcc.gnu.org; James Cowgill
> <James.Cowgill@imgtec.com>
> Subject: [PATCH] Fix mips hang with --help=target --help=optimizers (PR
> target/82880)
>
> Hi!
>
> This is a patch from James that has been sitting in bugzilla for a few
> weeks. The bug is that mips_register_frame_header_opt registers
> the pass from a static variable which has an automatic variable in the
> initializer, which means that the first time it is called it is registered
> properly, but if it is called multiple times (e.g. possible with gccjit
> or multiple --help options), then the second time it creates a new pass,
> but registers with the old pass (since the var isn't initialized again).
> register_pass doesn't store the address it is called with anywhere, just
> uses the fields of the struct and stores the pass (first field).
> All other spots that call register_pass in all backends do it properly
> it seems.
>
> I've just fixed up formatting and added a testcase, tested with cross to
> mips and tested the testcase on x86_64-linux and i686-linux.
>
> Ok for trunk?
>
> 2017-11-21 James Cowgill <James.Cowgill@imgtec.com>
> Jakub Jelinek <jakub@redhat.com>
>
> PR target/82880
> * config/mips/frame-header-opt.c
> (mips_register_frame_header_opt):
> Remove static keyword from f variable.
>
> * gcc.dg/opts-8.c: New test.
>
Yes, this is OK. Thanks for fixing.