> -----Original Message-----
> From: Jakub Jelinek [mailto:[email protected]]
> Sent: Tuesday, November 21, 2017 9:07 AM
> To: Moore, Catherine <[email protected]>; Matthew
> Fortune <[email protected]>
> Cc: [email protected]; James Cowgill
> <[email protected]>
> 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  <[email protected]>
>           Jakub Jelinek  <[email protected]>
> 
>       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.

Reply via email to