Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Maarten Brock <sourceforge.brock@ds...>  20140108 09:22:28

> > > On Tue, 7 Jan 2014, Ben Shi wrote: > >> Hello, >> >> The dumped AST info for >> int add(int a, int b) >> { >> int s = 1; >> s += a + b; >> return s; >> } >> is >> >> > FUNCTION (_add=0x8b63770) type (int fixed) args (int fixed, int fixed) >> > (null):0:{ L1 B0 >> > (null):0: DECLARE SYMBOL (L1 B1 a=0x8b63138) type (int fixed) >> > (null):0: DECLARE SYMBOL (L1 B2 s=0x8b61b28) type (int fixed) >> > a.c:4: ASSIGN(=) (0x8b62cd0) type (int fixed) >> > a.c:4: SYMBOL (L1 B2 s=0x8b62970 @ 0x8b61b28) type (int fixed) >> > a.c:4: ADD (0x8b62c78) type (int fixed) >> > a.c:4: SYMBOL (L1 B2 s=0x8b622b0 @ 0x8b61b28) type (int fixed) >> > a.c:4: ADD (0x8b62918) type (int fixed) >> > a.c:4: SYMBOL (L1 B1 a=0x8b625b8 @ 0x8b61018) type (int fixed) >> > a.c:4: SYMBOL (L1 B1 b=0x8b628c0 @ 0x8b61398) type (int fixed) >> > a.c:5: RETURN (0x8b63030) type (int fixed) >> > a.c:5: SYMBOL (L1 B2 s=0x8b62fd8 @ 0x8b61b28) type (int fixed) >> > (null):0:} >> >> But how is s initialized to 1 ? Should there be an ASSIGN(=) for that ? >> >> Ben > > It appears that the dumped tree is missing a branch. The assignments are > under the BLOCK node on the left child, but ast_print() only recurses on > the right child. > > Erik When a branch is missing from the dump there is a big chance that this branch was not decorated (yet). I have no idea why astPrint() doesn't start decorating instead of skipping the tree branch. Maarten 
From: Ben Shi <powerstudio1st@16...>  20140107 11:58:32
Attachments:
Message as HTML

Hello, The dumped AST info for int add(int a, int b) { int s = 1; s += a + b; return s; } is > FUNCTION (_add=0x8b63770) type (int fixed) args (int fixed, int fixed) > (null):0:{ L1 B0 > (null):0: DECLARE SYMBOL (L1 B1 a=0x8b63138) type (int fixed) > (null):0: DECLARE SYMBOL (L1 B2 s=0x8b61b28) type (int fixed) > a.c:4: ASSIGN(=) (0x8b62cd0) type (int fixed) > a.c:4: SYMBOL (L1 B2 s=0x8b62970 @ 0x8b61b28) type (int fixed) > a.c:4: ADD (0x8b62c78) type (int fixed) > a.c:4: SYMBOL (L1 B2 s=0x8b622b0 @ 0x8b61b28) type (int fixed) > a.c:4: ADD (0x8b62918) type (int fixed) > a.c:4: SYMBOL (L1 B1 a=0x8b625b8 @ 0x8b61018) type (int fixed) > a.c:4: SYMBOL (L1 B1 b=0x8b628c0 @ 0x8b61398) type (int fixed) > a.c:5: RETURN (0x8b63030) type (int fixed) > a.c:5: SYMBOL (L1 B2 s=0x8b62fd8 @ 0x8b61b28) type (int fixed) > (null):0:} But how is s initialized to 1 ? Should there be an ASSIGN(=) for that ? Ben 
From: Philipp Klaus Krause <pkk@sp...>  20140107 12:17:46

BEGIN PGP SIGNED MESSAGE Hash: SHA1 Am 07.01.2014 12:58, schrieb Ben Shi: > Hello, > > The dumped AST info for int add(int a, int b) { int s = 1; s += a + > b; return s; } is > >> FUNCTION (_add=0x8b63770) type (int fixed) args (int fixed, int >> fixed) (null):0:{ L1 B0 (null):0: DECLARE SYMBOL (L1 B1 >> a=0x8b63138) type (int fixed) (null):0: DECLARE SYMBOL (L1 B2 >> s=0x8b61b28) type (int fixed) a.c:4: ASSIGN(=) (0x8b62cd0) type >> (int fixed) a.c:4: SYMBOL (L1 B2 s=0x8b62970 @ 0x8b61b28) type >> (int fixed) a.c:4: ADD (0x8b62c78) type (int fixed) a.c:4: >> SYMBOL (L1 B2 s=0x8b622b0 @ 0x8b61b28) type (int fixed) a.c:4: >> ADD (0x8b62918) type (int fixed) a.c:4: SYMBOL (L1 B1 >> a=0x8b625b8 @ 0x8b61018) type (int fixed) a.c:4: SYMBOL >> (L1 B1 b=0x8b628c0 @ 0x8b61398) type (int fixed) a.c:5: RETURN >> (0x8b63030) type (int fixed) a.c:5: SYMBOL (L1 B2 s=0x8b62fd8 >> @ 0x8b61b28) type (int fixed) (null):0:} > > But how is s initialized to 1 ? Should there be an ASSIGN(=) for > that ? > > Ben Looks to me as if s = 1; s += a + b; has already been replaced by s = 1 + (a + b); Philipp BEGIN PGP SIGNATURE Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove  http://www.enigmail.net/ iEYEARECAAYFAlLL8FwACgkQbtUV+xsoLprycACfd6yvx+EICd80aT8ZSyrFr75V yBwAoKl2ASJO5wMMwKY1zCNVjQx4QR2a =4O4U END PGP SIGNATURE 
From: Ben Shi <powerstudio1st@16...>  20140107 12:57:09

the ast looks like s = s + a + b, and there is an explicit init inst generated for s = 1. in the .asm file, which is simething like mov rx, #1  发自我的网易邮箱手机智能版 在 20140107 20:17:35，"Philipp Klaus Krause" <pkk@...> 写道： >BEGIN PGP SIGNED MESSAGE >Hash: SHA1 > >Am 07.01.2014 12:58, schrieb Ben Shi: >> Hello, >> >> The dumped AST info for int add(int a, int b) { int s = 1; s += a + >> b; return s; } is >> >>> FUNCTION (_add=0x8b63770) type (int fixed) args (int fixed, int >>> fixed) (null):0:{ L1 B0 (null):0: DECLARE SYMBOL (L1 B1 >>> a=0x8b63138) type (int fixed) (null):0: DECLARE SYMBOL (L1 B2 >>> s=0x8b61b28) type (int fixed) a.c:4: ASSIGN(=) (0x8b62cd0) type >>> (int fixed) a.c:4: SYMBOL (L1 B2 s=0x8b62970 @ 0x8b61b28) type >>> (int fixed) a.c:4: ADD (0x8b62c78) type (int fixed) a.c:4: >>> SYMBOL (L1 B2 s=0x8b622b0 @ 0x8b61b28) type (int fixed) a.c:4: >>> ADD (0x8b62918) type (int fixed) a.c:4: SYMBOL (L1 B1 >>> a=0x8b625b8 @ 0x8b61018) type (int fixed) a.c:4: SYMBOL >>> (L1 B1 b=0x8b628c0 @ 0x8b61398) type (int fixed) a.c:5: RETURN >>> (0x8b63030) type (int fixed) a.c:5: SYMBOL (L1 B2 s=0x8b62fd8 >>> @ 0x8b61b28) type (int fixed) (null):0:} >> >> But how is s initialized to 1 ? Should there be an ASSIGN(=) for >> that ? >> >> Ben > >Looks to me as if > >s = 1; >s += a + b; > >has already been replaced by > >s = 1 + (a + b); > >Philipp > > >BEGIN PGP SIGNATURE >Version: GnuPG v1.4.15 (GNU/Linux) >Comment: Using GnuPG with Icedove  http://www.enigmail.net/ > >iEYEARECAAYFAlLL8FwACgkQbtUV+xsoLprycACfd6yvx+EICd80aT8ZSyrFr75V >yBwAoKl2ASJO5wMMwKY1zCNVjQx4QR2a >=4O4U >END PGP SIGNATURE > > >Rapidly troubleshoot problems before they affect your business. Most IT >organizations don't have a clear picture of how application performance >affects their revenue. With AppDynamics, you get 100% visibility into your >Java,.NET, & PHP application. Start your 15day FREE TRIAL of AppDynamics Pro! >http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk >_______________________________________________ >sdccdevel mailing list >sdccdevel@... >https://lists.sourceforge.net/lists/listinfo/sdccdevel the ast 
From: Philipp Klaus Krause <pkk@sp...>  20140107 13:01:13

BEGIN PGP SIGNED MESSAGE Hash: SHA1 Am 07.01.2014 13:56, schrieb Ben Shi: > the ast looks like s = s + a + b, > > and there is an explicit init inst generated for s = 1. in the .asm > file, which is simething like mov rx, #1 Yes. Upon a closer look I see it. Sorry. I'm not familiar enough with the frontend stuff yet. Philipp BEGIN PGP SIGNATURE Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove  http://www.enigmail.net/ iEYEARECAAYFAlLL+owACgkQbtUV+xsoLpoBgQCgl806+MBTMx8WKwbLVpJWTqO0 RHQAoLrcUYAETJHetwBUvnf5GhfuhMb/ =6/2F END PGP SIGNATURE 
From: Ben Shi <powerstudio1st@16...>  20140108 03:01:01
Attachments:
Message as HTML

As far as my investigation, the initialization of local variables locates at: createFunction > processBlockVars > gatherAutoInit in SDCCast.c And in the function gatherAutoInit, local static variables are lifted to global initialization, only local auto variables are initialized at the function entry. Is that right? Ben 在2014年01月07 21时01分，"Philipp Klaus Krause"<pkk@...>写道： BEGIN PGP SIGNED MESSAGE Hash: SHA1 Am 07.01.2014 13:56, schrieb Ben Shi: > the ast looks like s = s + a + b, > > and there is an explicit init inst generated for s = 1. in the .asm > file, which is simething like mov rx, #1 Yes. Upon a closer look I see it. Sorry. I'm not familiar enough with the frontend stuff yet. Philipp BEGIN PGP SIGNATURE Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove  http://www.enigmail.net/ iEYEARECAAYFAlLL+owACgkQbtUV+xsoLpoBgQCgl806+MBTMx8WKwbLVpJWTqO0 RHQAoLrcUYAETJHetwBUvnf5GhfuhMb/ =6/2F END PGP SIGNATURE  Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ sdccdevel mailing list sdccdevel@... https://lists.sourceforge.net/lists/listinfo/sdccdevel 
From: Erik Petrich <epetrich@iv...>  20140108 04:37:53

On Tue, 7 Jan 2014, Ben Shi wrote: > Hello, > > The dumped AST info for > int add(int a, int b) > { > int s = 1; > s += a + b; > return s; > } > is > > > FUNCTION (_add=0x8b63770) type (int fixed) args (int fixed, int fixed) > > (null):0:{ L1 B0 > > (null):0: DECLARE SYMBOL (L1 B1 a=0x8b63138) type (int fixed) > > (null):0: DECLARE SYMBOL (L1 B2 s=0x8b61b28) type (int fixed) > > a.c:4: ASSIGN(=) (0x8b62cd0) type (int fixed) > > a.c:4: SYMBOL (L1 B2 s=0x8b62970 @ 0x8b61b28) type (int fixed) > > a.c:4: ADD (0x8b62c78) type (int fixed) > > a.c:4: SYMBOL (L1 B2 s=0x8b622b0 @ 0x8b61b28) type (int fixed) > > a.c:4: ADD (0x8b62918) type (int fixed) > > a.c:4: SYMBOL (L1 B1 a=0x8b625b8 @ 0x8b61018) type (int fixed) > > a.c:4: SYMBOL (L1 B1 b=0x8b628c0 @ 0x8b61398) type (int fixed) > > a.c:5: RETURN (0x8b63030) type (int fixed) > > a.c:5: SYMBOL (L1 B2 s=0x8b62fd8 @ 0x8b61b28) type (int fixed) > > (null):0:} > > But how is s initialized to 1 ? Should there be an ASSIGN(=) for that ? > > Ben It appears that the dumped tree is missing a branch. The assignments are under the BLOCK node on the left child, but ast_print() only recurses on the right child. Erik 
From: Maarten Brock <sourceforge.brock@ds...>  20140108 09:22:28

> > > On Tue, 7 Jan 2014, Ben Shi wrote: > >> Hello, >> >> The dumped AST info for >> int add(int a, int b) >> { >> int s = 1; >> s += a + b; >> return s; >> } >> is >> >> > FUNCTION (_add=0x8b63770) type (int fixed) args (int fixed, int fixed) >> > (null):0:{ L1 B0 >> > (null):0: DECLARE SYMBOL (L1 B1 a=0x8b63138) type (int fixed) >> > (null):0: DECLARE SYMBOL (L1 B2 s=0x8b61b28) type (int fixed) >> > a.c:4: ASSIGN(=) (0x8b62cd0) type (int fixed) >> > a.c:4: SYMBOL (L1 B2 s=0x8b62970 @ 0x8b61b28) type (int fixed) >> > a.c:4: ADD (0x8b62c78) type (int fixed) >> > a.c:4: SYMBOL (L1 B2 s=0x8b622b0 @ 0x8b61b28) type (int fixed) >> > a.c:4: ADD (0x8b62918) type (int fixed) >> > a.c:4: SYMBOL (L1 B1 a=0x8b625b8 @ 0x8b61018) type (int fixed) >> > a.c:4: SYMBOL (L1 B1 b=0x8b628c0 @ 0x8b61398) type (int fixed) >> > a.c:5: RETURN (0x8b63030) type (int fixed) >> > a.c:5: SYMBOL (L1 B2 s=0x8b62fd8 @ 0x8b61b28) type (int fixed) >> > (null):0:} >> >> But how is s initialized to 1 ? Should there be an ASSIGN(=) for that ? >> >> Ben > > It appears that the dumped tree is missing a branch. The assignments are > under the BLOCK node on the left child, but ast_print() only recurses on > the right child. > > Erik When a branch is missing from the dump there is a big chance that this branch was not decorated (yet). I have no idea why astPrint() doesn't start decorating instead of skipping the tree branch. Maarten 
From: Erik Petrich <epetrich@iv...>  20140108 19:40:59

On Wed, 8 Jan 2014, Maarten Brock wrote: >> It appears that the dumped tree is missing a branch. The assignments are >> under the BLOCK node on the left child, but ast_print() only recurses on >> the right child. >> >> Erik > > When a branch is missing from the dump there is a big chance that this > branch was not decorated (yet). I have no idea why astPrint() doesn't > start decorating instead of skipping the tree branch. > > Maarten Since the only use of ast_print() is for debugging, I think it would be counterproductive for it to try to fix (and thus hide) a bug. I think a better change would be to highlight undecorated branches rather than silently skipping them. Erik 
From: Maarten Brock <sourceforge.brock@ds...>  20140110 08:43:04

> > > On Wed, 8 Jan 2014, Maarten Brock wrote: > >>> It appears that the dumped tree is missing a branch. The assignments >>> are >>> under the BLOCK node on the left child, but ast_print() only recurses >>> on >>> the right child. >>> >>> Erik >> >> When a branch is missing from the dump there is a big chance that this >> branch was not decorated (yet). I have no idea why astPrint() doesn't >> start decorating instead of skipping the tree branch. >> >> Maarten > > Since the only use of ast_print() is for debugging, I think it would be > counterproductive for it to try to fix (and thus hide) a bug. I think a > better change would be to highlight undecorated branches rather than > silently skipping them. > > Erik Todays snapshot will also print the right branch of a GOTO and it will warn about undecorated branches. Maarten 
From: Ben Shi <powerstudio1st@16...>  20140110 09:11:53

great , thanks to maarten  发自我的网易邮箱手机智能版 在 20140110 16:42:56，"Maarten Brock" <sourceforge.brock@...> 写道： >> >> >> On Wed, 8 Jan 2014, Maarten Brock wrote: >> >>>> It appears that the dumped tree is missing a branch. The assignments >>>> are >>>> under the BLOCK node on the left child, but ast_print() only recurses >>>> on >>>> the right child. >>>> >>>> Erik >>> >>> When a branch is missing from the dump there is a big chance that this >>> branch was not decorated (yet). I have no idea why astPrint() doesn't >>> start decorating instead of skipping the tree branch. >>> >>> Maarten >> >> Since the only use of ast_print() is for debugging, I think it would be >> counterproductive for it to try to fix (and thus hide) a bug. I think a >> better change would be to highlight undecorated branches rather than >> silently skipping them. >> >> Erik > >Todays snapshot will also print the right branch of a GOTO and it will >warn about undecorated branches. > >Maarten > > >CenturyLink Cloud: The Leader in Enterprise Cloud Services. >Learn Why More Businesses Are Choosing CenturyLink Cloud For >Critical Workloads, Development Environments & Everything In Between. >Get a Quote or Start a Free Trial Today. >http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk >_______________________________________________ >sdccdevel mailing list >sdccdevel@... >https://lists.sourceforge.net/lists/listinfo/sdccdevel 
Sign up for the SourceForge newsletter:
No, thanks