Re: Prevent -Og from deleting stores to write-only variables

2019-07-08 Thread Richard Sandiford
Jakub Jelinek writes: > On Sun, Jul 07, 2019 at 10:41:43AM +0100, Richard Sandiford wrote: >> gcc/testsuite/ >> * c-c++-common/guality/Og-static-wo-1.c: New test. >> * g++.dg/guality/guality.exp: Separate the c-c++-common tests into >> "Og" and "general" tests. Run the latter at -O

Re: Prevent -Og from deleting stores to write-only variables

2019-07-07 Thread Jakub Jelinek
On Sun, Jul 07, 2019 at 10:41:43AM +0100, Richard Sandiford wrote: > gcc/testsuite/ > * c-c++-common/guality/Og-static-wo-1.c: New test. > * g++.dg/guality/guality.exp: Separate the c-c++-common tests into > "Og" and "general" tests. Run the latter at -O0 and -Og only. Do we rea

Re: Prevent -Og from deleting stores to write-only variables

2019-07-07 Thread Jeff Law
On 7/7/19 3:41 AM, Richard Sandiford wrote: > This patch prevents -Og from deleting stores to write-only variables, > so that the values are still available when debugging. This seems > more convenient than forcing users to use __attribute__((used)) > (probably conditionally, if it's not something

Prevent -Og from deleting stores to write-only variables

2019-07-07 Thread Richard Sandiford
This patch prevents -Og from deleting stores to write-only variables, so that the values are still available when debugging. This seems more convenient than forcing users to use __attribute__((used)) (probably conditionally, if it's not something they want in release builds). Tested on aarch64-li