public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Ping! Re: [PATCH, Fortran] PR71523 - Static variables given automatic initializers with -finit-* and -fmax-stack-var-size
@ 2016-07-15 20:32 Fritz Reese
  2016-07-17 15:54 ` Jerry DeLisle
  0 siblings, 1 reply; 3+ messages in thread
From: Fritz Reese @ 2016-07-15 20:32 UTC (permalink / raw)
  To: fortran, Steve Kargl

https://gcc.gnu.org/ml/fortran/2016-06/msg00032.html

I have plenty more DEC extension patches ready to submit but I've been
waiting on this one to get integrated to avoid bit rot. I'd like to
get my DEC patches through before stage 1 closes up for gcc 7 (in
about a month, right?). Can someone review/commit this (and the other
DEC extensions when they come up) please?

Thanks,

---
Fritz Reese


On Mon, Jun 13, 2016 at 12:46 PM, Fritz Reese <fritzoreese@gmail.com> wrote:
> RE: https://gcc.gnu.org/ml/fortran/2016-06/msg00023.html
>
> On Thu, Jun 9, 2016 at 2:01 PM, Fritz Reese <fritzoreese@gmail.com> wrote:
>> It looks like when -fautomatic and -finit-local-zero are set with
>> -fmax-stack-var-size=X, an automatic initializer is generated even for
>> variables larger than X which are given static storage, causing such
>> static variables to have their value re-initialized upon each entry to
>> their namespace.
>> ...
> <snip>
>
> After doing more research I noticed PR41860
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41860) was very similar
> to this issue, so I've decided this is a bug and created PR71523
> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71523). Here's a patch
> for it.
>
> The bug seems to be due to an oversight - since the size of a variable
> is not known at resolution time when initializer expressions are
> applied, -finit-* is too greedy in the case that the variable is large
> enough to be removed from the stack according to -fmax-stack-var-size.
> This patch removes automatic initializers at translation time which
> were inserted by -finit-* (and inserts the appropriate static
> initializer) according to -fmax-stack-var-size.
>
> The patch passes all regression tests (on x86_64-redhat-linux),
> including the two additional tests of its own demonstrating the issue.
>
> ---
> Fritz Reese

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ping! Re: [PATCH, Fortran] PR71523 - Static variables given automatic initializers with -finit-* and -fmax-stack-var-size
  2016-07-15 20:32 Ping! Re: [PATCH, Fortran] PR71523 - Static variables given automatic initializers with -finit-* and -fmax-stack-var-size Fritz Reese
@ 2016-07-17 15:54 ` Jerry DeLisle
  2016-07-18 14:03   ` Fritz Reese
  0 siblings, 1 reply; 3+ messages in thread
From: Jerry DeLisle @ 2016-07-17 15:54 UTC (permalink / raw)
  To: Fritz Reese, fortran, Steve Kargl

On 07/15/2016 01:32 PM, Fritz Reese wrote:
> https://gcc.gnu.org/ml/fortran/2016-06/msg00032.html
>
> I have plenty more DEC extension patches ready to submit but I've been
> waiting on this one to get integrated to avoid bit rot. I'd like to
> get my DEC patches through before stage 1 closes up for gcc 7 (in
> about a month, right?). Can someone review/commit this (and the other
> DEC extensions when they come up) please?
>
> Thanks,
>
> ---
> Fritz Reese
>
>

This patch approved. I will commit this one and help with the others.

Jerry





> On Mon, Jun 13, 2016 at 12:46 PM, Fritz Reese <fritzoreese@gmail.com> wrote:
>> RE: https://gcc.gnu.org/ml/fortran/2016-06/msg00023.html
>>
>> On Thu, Jun 9, 2016 at 2:01 PM, Fritz Reese <fritzoreese@gmail.com> wrote:
>>> It looks like when -fautomatic and -finit-local-zero are set with
>>> -fmax-stack-var-size=X, an automatic initializer is generated even for
>>> variables larger than X which are given static storage, causing such
>>> static variables to have their value re-initialized upon each entry to
>>> their namespace.
>>> ...
>> <snip>
>>
>> After doing more research I noticed PR41860
>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41860) was very similar
>> to this issue, so I've decided this is a bug and created PR71523
>> (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71523). Here's a patch
>> for it.
>>
>> The bug seems to be due to an oversight - since the size of a variable
>> is not known at resolution time when initializer expressions are
>> applied, -finit-* is too greedy in the case that the variable is large
>> enough to be removed from the stack according to -fmax-stack-var-size.
>> This patch removes automatic initializers at translation time which
>> were inserted by -finit-* (and inserts the appropriate static
>> initializer) according to -fmax-stack-var-size.
>>
>> The patch passes all regression tests (on x86_64-redhat-linux),
>> including the two additional tests of its own demonstrating the issue.
>>
>> ---
>> Fritz Reese

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ping! Re: [PATCH, Fortran] PR71523 - Static variables given automatic initializers with -finit-* and -fmax-stack-var-size
  2016-07-17 15:54 ` Jerry DeLisle
@ 2016-07-18 14:03   ` Fritz Reese
  0 siblings, 0 replies; 3+ messages in thread
From: Fritz Reese @ 2016-07-18 14:03 UTC (permalink / raw)
  To: Jerry DeLisle; +Cc: fortran, Steve Kargl

Thank you!

---
Fritz Reese


On Sun, Jul 17, 2016 at 11:54 AM, Jerry DeLisle <jvdelisle@charter.net> wrote:
> On 07/15/2016 01:32 PM, Fritz Reese wrote:
>>
>> https://gcc.gnu.org/ml/fortran/2016-06/msg00032.html
>>
>> I have plenty more DEC extension patches ready to submit but I've been
>> waiting on this one to get integrated to avoid bit rot. I'd like to
>> get my DEC patches through before stage 1 closes up for gcc 7 (in
>> about a month, right?). Can someone review/commit this (and the other
>> DEC extensions when they come up) please?
>>
>> Thanks,
>>
>> ---
>> Fritz Reese
>>
>>
>
> This patch approved. I will commit this one and help with the others.
>
> Jerry
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-18 14:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 20:32 Ping! Re: [PATCH, Fortran] PR71523 - Static variables given automatic initializers with -finit-* and -fmax-stack-var-size Fritz Reese
2016-07-17 15:54 ` Jerry DeLisle
2016-07-18 14:03   ` Fritz Reese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).