Forward to the devel mail list.
---------- 已转发邮件 ----------
发件人: hushiwen <hushi...@ict.ac.cn>
日期: 2010年10月19日 上午1:22
主题: [Open64-user] A bug found when trying to build gcc using opencc
收件人: open64-user <open64-u...@lists.sourceforge.net>
Hi,all,
I come up with a bug,when trying to compile gcc using opencc(4.2.3,svn
trunck).
For the testcase like this:
struct foo{
int a;
int b;
};
int main()
{
struct foo *myfoo = malloc(sizeof(struct foo));
({ struct foo *const _myfoo = myfoo; _myfoo; })->b = 1;
}
The part of whirl after wgen(from .B) is:
U4STID 0 <2,2,_myfoo> T<54,anon_ptr.,4,C> {line: 10}
U4U4LDID 0 <2,2,_myfoo> T<54,anon_ptr.,4,C>
U4STID 0 <1,52,anon1> T<54,anon_ptr.,4,C> {line: 10}
I4INTCONST 1 (0x1)
U4U4LDID 0 <1,52,anon1> T<54,anon_ptr.,4,C>
I4ISTORE 4 T<54,anon_ptr.,4> <field_id:2> {line: 10}
Opencc will build a temp named anon1 to store the address of _myfoo,and put
anon1 in the global symtab.This will cause some nasty problems when the
function which has the expression like this recursively call itself.
I think anon1 is a local variable and should be put in the local symtab.
I wonder how to put anon1 in local symtab.
------------------------------
胡士文
Advanced Compiler Technology Laboratory
Key Laboratory of Computer System and Architecture
Institute of Computing Technology
Email:hushi...@ict.ac.cn <email%3ahushi...@ict.ac.cn>
2010-10-19
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Open64-user mailing list
open64-u...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-user
--
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel