Re: How to traverse all the local variables that declared in the current routine?

2020-12-09 Thread Qing Zhao via Gcc-patches
> On Dec 9, 2020, at 9:12 AM, Richard Biener wrote: > > On Wed, Dec 9, 2020 at 4:04 PM Qing Zhao > wrote: >> >> >> >> On Dec 9, 2020, at 2:23 AM, Richard Biener >> wrote: >> >> On Tue, Dec 8, 2020 at 8:54 PM Qing Zhao wrote: >> >> >> >> >> On Dec 8,

Re: How to traverse all the local variables that declared in the current routine?

2020-12-09 Thread Richard Biener via Gcc-patches
On Wed, Dec 9, 2020 at 4:04 PM Qing Zhao wrote: > > > > On Dec 9, 2020, at 2:23 AM, Richard Biener wrote: > > On Tue, Dec 8, 2020 at 8:54 PM Qing Zhao wrote: > > > > > On Dec 8, 2020, at 1:40 AM, Richard Biener wrote: > > On Mon, Dec 7, 2020 at 5:20 PM Qing Zhao wrote: > > > > > On Dec 7,

Re: How to traverse all the local variables that declared in the current routine?

2020-12-09 Thread Qing Zhao via Gcc-patches
> On Dec 9, 2020, at 2:23 AM, Richard Biener wrote: > > On Tue, Dec 8, 2020 at 8:54 PM Qing Zhao > wrote: >> >> >> >> On Dec 8, 2020, at 1:40 AM, Richard Biener > > wrote: >> >> On Mon, Dec 7, 2020 at 5:20 PM Qing Zhao >

Re: How to traverse all the local variables that declared in the current routine?

2020-12-09 Thread Richard Biener via Gcc-patches
On Tue, Dec 8, 2020 at 8:54 PM Qing Zhao wrote: > > > > On Dec 8, 2020, at 1:40 AM, Richard Biener wrote: > > On Mon, Dec 7, 2020 at 5:20 PM Qing Zhao wrote: > > > > > On Dec 7, 2020, at 1:12 AM, Richard Biener wrote: > > On Fri, Dec 4, 2020 at 5:19 PM Qing Zhao wrote: > > > > > On Dec 4,

Re: How to traverse all the local variables that declared in the current routine?

2020-12-08 Thread Qing Zhao via Gcc-patches
> On Dec 8, 2020, at 1:40 AM, Richard Biener wrote: > > On Mon, Dec 7, 2020 at 5:20 PM Qing Zhao > wrote: >> >> >> >> On Dec 7, 2020, at 1:12 AM, Richard Biener >> wrote: >> >> On Fri, Dec 4, 2020 at 5:19 PM Qing Zhao wrote: >> >> >> >> >> On Dec 4,

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Richard Biener via Gcc-patches
On Mon, Dec 7, 2020 at 5:20 PM Qing Zhao wrote: > > > > On Dec 7, 2020, at 1:12 AM, Richard Biener wrote: > > On Fri, Dec 4, 2020 at 5:19 PM Qing Zhao wrote: > > > > > On Dec 4, 2020, at 2:50 AM, Richard Biener wrote: > > On Thu, Dec 3, 2020 at 6:33 PM Richard Sandiford > wrote: > > > Richard

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Richard Biener via Gcc-patches
On Mon, Dec 7, 2020 at 7:34 PM Qing Zhao wrote: > > > > On Dec 7, 2020, at 12:05 PM, Richard Sandiford > wrote: > > Qing Zhao writes: > > On Dec 7, 2020, at 11:10 AM, Richard Sandiford > wrote: > > > Another issue is, in order to check whether an auto-variable has initializer, > I plan to

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Qing Zhao via Gcc-patches
> On Dec 7, 2020, at 12:05 PM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Dec 7, 2020, at 11:10 AM, Richard Sandiford >>> wrote: >> >> Another issue is, in order to check whether an auto-variable has >> initializer, I plan to add a

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Richard Sandiford via Gcc-patches
Qing Zhao writes: >> On Dec 7, 2020, at 11:10 AM, Richard Sandiford >> wrote: > > Another issue is, in order to check whether an auto-variable has > initializer, I plan to add a new bit in “decl_common” as: > /* In a VAR_DECL, this is DECL_IS_INITIALIZED. */ > unsigned

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Qing Zhao via Gcc-patches
> On Dec 7, 2020, at 11:10 AM, Richard Sandiford > wrote: Another issue is, in order to check whether an auto-variable has initializer, I plan to add a new bit in “decl_common” as: /* In a VAR_DECL, this is DECL_IS_INITIALIZED. */ unsigned decl_is_initialized :1;

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Richard Sandiford via Gcc-patches
Richard Biener writes: > On Thu, Dec 3, 2020 at 6:33 PM Richard Sandiford > wrote: >> >> Richard Biener via Gcc-patches writes: >> > On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: >> >> Another issue is, in order to check whether an auto-variable has >> >> initializer, I plan to add a new

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Richard Sandiford via Gcc-patches
Qing Zhao via Gcc-patches writes: >> On Dec 7, 2020, at 1:12 AM, Richard Biener >> wrote: >> >> On Fri, Dec 4, 2020 at 5:19 PM Qing Zhao > > wrote: >>> >>> >>> >>> On Dec 4, 2020, at 2:50 AM, Richard Biener >>> wrote: >>> >>> On Thu, Dec 3, 2020 at 6:33 PM

Re: How to traverse all the local variables that declared in the current routine?

2020-12-07 Thread Qing Zhao via Gcc-patches
> On Dec 7, 2020, at 1:12 AM, Richard Biener wrote: > > On Fri, Dec 4, 2020 at 5:19 PM Qing Zhao > wrote: >> >> >> >> On Dec 4, 2020, at 2:50 AM, Richard Biener >> wrote: >> >> On Thu, Dec 3, 2020 at 6:33 PM Richard Sandiford >> wrote: >> >> >> Richard

Re: How to traverse all the local variables that declared in the current routine?

2020-12-06 Thread Richard Biener via Gcc-patches
On Fri, Dec 4, 2020 at 5:19 PM Qing Zhao wrote: > > > > On Dec 4, 2020, at 2:50 AM, Richard Biener wrote: > > On Thu, Dec 3, 2020 at 6:33 PM Richard Sandiford > wrote: > > > Richard Biener via Gcc-patches writes: > > On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: > > Another issue is, in

Re: How to traverse all the local variables that declared in the current routine?

2020-12-04 Thread Qing Zhao via Gcc-patches
> On Dec 4, 2020, at 2:50 AM, Richard Biener wrote: > > On Thu, Dec 3, 2020 at 6:33 PM Richard Sandiford > mailto:richard.sandif...@arm.com>> wrote: >> >> Richard Biener via Gcc-patches writes: >>> On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: Another issue is, in order to check

Re: How to traverse all the local variables that declared in the current routine?

2020-12-04 Thread Richard Biener via Gcc-patches
On Thu, Dec 3, 2020 at 6:33 PM Richard Sandiford wrote: > > Richard Biener via Gcc-patches writes: > > On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: > >> Another issue is, in order to check whether an auto-variable has > >> initializer, I plan to add a new bit in “decl_common” as: > >> /*

Re: How to traverse all the local variables that declared in the current routine?

2020-12-03 Thread Qing Zhao via Gcc-patches
Hi, Richard, Thanks a lot for your suggestion. Actually, I like this idea. My understanding of your suggestion is: 1. During gimplification phase: For each auto-variable that does not have an explicit initializer, insert the following initializer for it: X = DEFERRED_INIT (X, INIT) In

Re: How to traverse all the local variables that declared in the current routine?

2020-12-03 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: >> Another issue is, in order to check whether an auto-variable has >> initializer, I plan to add a new bit in “decl_common” as: >> /* In a VAR_DECL, this is DECL_IS_INITIALIZED. */ >> unsigned

Re: How to traverse all the local variables that declared in the current routine?

2020-12-03 Thread Richard Sandiford via Gcc-patches
Richard Biener via Gcc-patches writes: > On December 3, 2020 5:07:28 PM GMT+01:00, Qing Zhao > wrote: >> >> >>> On Dec 3, 2020, at 2:45 AM, Richard Biener >> wrote: >>> >>> On Wed, Dec 2, 2020 at 4:36 PM Qing Zhao >> wrote: On Dec 2, 2020, at

Re: How to traverse all the local variables that declared in the current routine?

2020-12-03 Thread Qing Zhao via Gcc-patches
> On Dec 3, 2020, at 10:36 AM, Richard Biener > wrote: > > On December 3, 2020 5:07:28 PM GMT+01:00, Qing Zhao > wrote: >> >> of uninitialized analysis in the later stage. >>> >>> I don't see how the issue can be resolved, you can't get both, uninit >>>

Re: How to traverse all the local variables that declared in the current routine?

2020-12-03 Thread Richard Biener via Gcc-patches
On December 3, 2020 5:07:28 PM GMT+01:00, Qing Zhao wrote: > > >> On Dec 3, 2020, at 2:45 AM, Richard Biener > wrote: >> >> On Wed, Dec 2, 2020 at 4:36 PM Qing Zhao > wrote: >>> >>> >>> >>> On Dec 2, 2020, at 2:45 AM, Richard Biener > wrote: >>> >>> On Tue, Dec

Re: How to traverse all the local variables that declared in the current routine?

2020-12-03 Thread Qing Zhao via Gcc-patches
> On Dec 3, 2020, at 2:45 AM, Richard Biener wrote: > > On Wed, Dec 2, 2020 at 4:36 PM Qing Zhao > wrote: >> >> >> >> On Dec 2, 2020, at 2:45 AM, Richard Biener >> wrote: >> >> On Tue, Dec 1, 2020 at 8:49 PM Qing Zhao wrote: >> >> >> Hi, Richard, >> >>

Re: How to traverse all the local variables that declared in the current routine?

2020-12-03 Thread Richard Biener via Gcc-patches
On Wed, Dec 2, 2020 at 4:36 PM Qing Zhao wrote: > > > > On Dec 2, 2020, at 2:45 AM, Richard Biener wrote: > > On Tue, Dec 1, 2020 at 8:49 PM Qing Zhao wrote: > > > Hi, Richard, > > Could you please comment on the following approach: > > Instead of adding the zero-initializer quite late at the

Re: How to traverse all the local variables that declared in the current routine?

2020-12-02 Thread Qing Zhao via Gcc-patches
> On Dec 2, 2020, at 2:45 AM, Richard Biener wrote: > > On Tue, Dec 1, 2020 at 8:49 PM Qing Zhao wrote: >> >> Hi, Richard, >> >> Could you please comment on the following approach: >> >> Instead of adding the zero-initializer quite late at the pass “pass_expand”, >> we can add it as

Re: How to traverse all the local variables that declared in the current routine?

2020-12-02 Thread Richard Biener via Gcc-patches
On Tue, Dec 1, 2020 at 8:49 PM Qing Zhao wrote: > > Hi, Richard, > > Could you please comment on the following approach: > > Instead of adding the zero-initializer quite late at the pass “pass_expand”, > we can add it as early as during gimplification. > However, we will mark these new added

Re: How to traverse all the local variables that declared in the current routine?

2020-12-01 Thread Qing Zhao via Gcc-patches
Hi, Richard, Could you please comment on the following approach: Instead of adding the zero-initializer quite late at the pass “pass_expand”, we can add it as early as during gimplification. However, we will mark these new added zero-initializers as “artificial”. And passing this

Re: How to traverse all the local variables that declared in the current routine?

2020-11-30 Thread Qing Zhao via Gcc-patches
On Nov 30, 2020, at 11:18 AM, Martin Sebor wrote: Does gcc provide an iterator to traverse all the local variables that are declared in the current routine? If not, what’s the best way to traverse the local variables? >>> >>> Depends on what for.

Re: How to traverse all the local variables that declared in the current routine?

2020-11-30 Thread Martin Sebor via Gcc-patches
On 11/30/20 9:23 AM, Qing Zhao wrote: Hi, Martin, Thanks a lot for your suggestion. On Nov 25, 2020, at 6:08 PM, Martin Sebor > wrote: On 11/24/20 9:54 AM, Qing Zhao via Gcc-patches wrote: On Nov 24, 2020, at 9:55 AM, Richard Biener

Re: How to traverse all the local variables that declared in the current routine?

2020-11-30 Thread Qing Zhao via Gcc-patches
Hi, Martin, Thanks a lot for your suggestion. > On Nov 25, 2020, at 6:08 PM, Martin Sebor wrote: > > On 11/24/20 9:54 AM, Qing Zhao via Gcc-patches wrote: >>> On Nov 24, 2020, at 9:55 AM, Richard Biener >>> wrote: >>> >>> On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote:

Re: How to traverse all the local variables that declared in the current routine?

2020-11-25 Thread Martin Sebor via Gcc-patches
On 11/24/20 9:54 AM, Qing Zhao via Gcc-patches wrote: On Nov 24, 2020, at 9:55 AM, Richard Biener wrote: On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: On Nov 24, 2020, at 1:32 AM, Richard Biener wrote: On Tue, Nov 24, 2020 at 12:05 AM Qing Zhao via Gcc-patches wrote: Hi, Does

Re: How to traverse all the local variables that declared in the current routine?

2020-11-25 Thread Qing Zhao via Gcc-patches
> On Nov 25, 2020, at 3:11 AM, Richard Biener > wrote: >> >> >> Hi, >> >> Does gcc provide an iterator to traverse all the local variables that are >> declared in the current routine? >> >> If not, what’s the best way to traverse the local variables? >> >> >> Depends on what for.

Re: How to traverse all the local variables that declared in the current routine?

2020-11-25 Thread Richard Biener via Gcc-patches
On Tue, Nov 24, 2020 at 5:54 PM Qing Zhao wrote: > > > > On Nov 24, 2020, at 9:55 AM, Richard Biener > wrote: > > On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: > > > > > On Nov 24, 2020, at 1:32 AM, Richard Biener > wrote: > > On Tue, Nov 24, 2020 at 12:05 AM Qing Zhao via Gcc-patches >

Re: How to traverse all the local variables that declared in the current routine?

2020-11-24 Thread Qing Zhao via Gcc-patches
> On Nov 24, 2020, at 9:55 AM, Richard Biener > wrote: > > On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: >> >> >> >>> On Nov 24, 2020, at 1:32 AM, Richard Biener >>> wrote: >>> >>> On Tue, Nov 24, 2020 at 12:05 AM Qing Zhao via Gcc-patches >>> wrote: Hi, Does

Re: How to traverse all the local variables that declared in the current routine?

2020-11-24 Thread Richard Biener via Gcc-patches
On Tue, Nov 24, 2020 at 4:47 PM Qing Zhao wrote: > > > > > On Nov 24, 2020, at 1:32 AM, Richard Biener > > wrote: > > > > On Tue, Nov 24, 2020 at 12:05 AM Qing Zhao via Gcc-patches > > wrote: > >> > >> Hi, > >> > >> Does gcc provide an iterator to traverse all the local variables that are >

Re: How to traverse all the local variables that declared in the current routine?

2020-11-24 Thread Qing Zhao via Gcc-patches
> On Nov 24, 2020, at 1:32 AM, Richard Biener > wrote: > > On Tue, Nov 24, 2020 at 12:05 AM Qing Zhao via Gcc-patches > wrote: >> >> Hi, >> >> Does gcc provide an iterator to traverse all the local variables that are >> declared in the current routine? >> >> If not, what’s the best way

Re: How to traverse all the local variables that declared in the current routine?

2020-11-23 Thread Richard Biener via Gcc-patches
On Tue, Nov 24, 2020 at 12:05 AM Qing Zhao via Gcc-patches wrote: > > Hi, > > Does gcc provide an iterator to traverse all the local variables that are > declared in the current routine? > > If not, what’s the best way to traverse the local variables? Depends on what for. There's the source

How to traverse all the local variables that declared in the current routine?

2020-11-23 Thread Qing Zhao via Gcc-patches
Hi, Does gcc provide an iterator to traverse all the local variables that are declared in the current routine? If not, what’s the best way to traverse the local variables? Thanks. Qing