Hi ,shin.
I didn’t change warn_uninit_optimization, just change the warning info.
The followed information will be reported.
"le1.c", line 2: Warning: Variable ptr in function foo might be
uninitialized
发件人: Shin-Ming Liu [mailto:shinm...@gmail.com]
发送时间: 2012年7月16日 11:52
收件人: shenrfen
抄送: Sun Chan; liwei.zh...@simplnano.com;
open64-devel@lists.sourceforge.net
主题: Re: 答复: 答复: [Open64-devel] 答复: Code review request : Add
Location info for ST(New feature)
To echo Sun's question,
What would you do this:
void * foo(bool cond) {
void * ptr;
if (cond) {
ptr = bar_alloc ();
printf ("%x", ptr); // reference of i of any form
}
return ptr;
}
On Sun, Jul 15, 2012 at 8:12 PM, shenrfen <shenr...@gmail.com> wrote:
Hi, shin.
For this case, If I am the programmer
I would like to change it as followed way.
int foo(bool cond){
int i = 0;
if (cond) {
i = bar ();
printf ("%d", i); // reference of i of any form
}
return i;
}
But not
int foo(bool cond){
int i;
if (cond) {
i = bar ();
printf ("%d", i); // reference of i of any form
} else {
i = 0;
}
return i;
}
发件人: Shin-Ming Liu [mailto:shinm...@gmail.com]
发送时间: 2012年7月16日 11:02
收件人: shenrfen
抄送: Sun Chan; liwei.zh...@simplnano.com;
open64-devel@lists.sourceforge.net
主题: Re: 答复: [Open64-devel] 答复: Code review request : Add Location info
for ST(New feature)
for the following example, I contend reporting at the line it is used is
more reasonable.
int foo(bool cond){
int i;
if (cond) {
i = bar ();
printf ("%d", i); // reference of i of any form
}
return i;
}
If I make the program even more complicated, I want to see the compiler to
report exactly where the reference is.
Shin
On Sun, Jul 15, 2012 at 7:55 PM, shenrfen <shenr...@gmail.com> wrote:
Hi, shin.
Thx for you review.
Yes.
The location info is where the ST is declared.
In this case, it is line 3.
“Initialize” should be immediate followed with declaration in my opinion.
So I report Line 3.
发件人: Shin-Ming Liu [mailto:shinm...@gmail.com]
发送时间: 2012年7月16日 10:50
收件人: shenrfen
抄送: Sun Chan; liwei.zh...@simplnano.com;
open64-devel@lists.sourceforge.net
主题: Re: [Open64-devel] 答复: Code review request : Add Location info for
ST(New feature)
Do you report the unitialized variable defined at line 3, with your change?
It is more reasonable to report the issue the warning at line 4, where the
return statement is referencing it.
- Shin
On Sun, Jul 15, 2012 at 7:28 PM, shenrfen <shenr...@gmail.com> wrote:
Hi, sun
Sorry for later reply.
There is an optimization called warn_uninitized_var in WOPT phase.
Test case: 1.c
int main()
{
int z;
return z;
}
CMD:
opencc 1.c -WOPT:warn_uninit=1
Building output:
"1.c": Warning: Variable z in main might be used uninitialized
Error:
There is missing line number of variable, Which is difficult to locate
variable.
And If there is “.h” file in source code, The file name is also
error.
So I add “SRCPOS location” field for ST.
发件人: Sun Chan [mailto:sun.c...@gmail.com]
发送时间: 2012年7月15日 9:02
收件人: shenrfen
抄送: open64-devel@lists.sourceforge.net; wendong.w...@simplnano.com; liwei.
zh...@simplnano.com
主题: Re: Code review request : Add Location info for ST(New feature)
can you explain why the new field? Why? What problem are you solving?
Sun
On Thu, Jul 12, 2012 at 6:21 PM, shenrfen <shenr...@gmail.com> wrote:
Hi, all.
I would like add location info for Symbol tab.
Could you please give a review?
Any question please let me know.
Any suggestion is welcome.
Thx very much.
Class ST {
...
SRCPOS location; // location where define symbol
}
Main work:
(1) Add location info for ST at wgen phase
(2) Remap location info at inline phase
a) Remap Global st is the technical difficulties
(3) Remap location info at IPA phase
(4) Fix bug when �CIPA:dst=on
a) Add abstract_dst info for DST_INLINED_SUBROUTINE
DST_INFO_IDX abstract_origin; /* The abstract version of this
instance */
+ DST_TYPE abstract_dst; /* dst where abstract_origin is located
*/
….
} DST_INLINED_SUBROUTINE;
New option:
(1) Trace_IPA_Remap_Symtab_File_Num ( �CWj,-tt19:0x200000 )
(2) �CIPA:dst=on/off (dst merge is done at inline phase)
a) In previous version, this option is disable.
The followed tests have been done:
(1) there was only one dst finally, all function has been inlined
(2) there was more than one dst finally, some function cannot be inline
(3) more than 4 level inline(global st and local st)
(4) all function is in one file & only one function in one file & middle
case
(5) Inline = on/off
(6) Nucleus Os can be passed, All local st and global st are checked.
Best Regards
RuifenShen
----------------------------------------------------------------------------
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel