Is it possible to delete a blog from the "I read these blogs" list?
bcc 4.5 generating bad code
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > C/C++ Programming > bcc 4.5 generating bad code 20 April 2004 20:19:49

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

bcc 4.5 generating bad code

Paul 20 April 2004 20:19:49
 
I have run into a problem with bcc 4.5 producing bad code.
The file is rather large, ~15,000 lines. We are compiling
with the -Z, Enable register load suppression optimization,
option turned on. The exact same function call produces
bad code where the second parameter to the function has
the wrong thing pushed on the stack.

The correctly compiled code looks like this:

?debugL 11415
lesbx,dword ptr [bp+6]
movax,word ptr es:[­bx+3]
addax,2055
pushword ptr es:[­bx+5]
pushax
lesbx,dword ptr es:[­bx+3]
pushword ptr es:[­bx+2034]
pushword ptr es:[­bx+2032]
moval,byte ptr es:[­bx+2031]
pushax
pushword ptr [bp+8]
pushword ptr [bp+6]
pushcs
callnear ptr @Object@CreateRespo­nse$quculnuc


The exact same function call 20 lines later in the file
produces this:

?debugL 11435
lesbx,dword ptr [bp+6]
movax,word ptr es:[­bx+3]
addax,2055
pushword ptr es:[­bx+5]
pushax
pushdx
pushbx
lesbx,dword ptr [bp+6]
lesbx,dword ptr es:[­bx+3]
moval,byte ptr es:[­bx+2031]
pushax
pushword ptr [bp+8]
pushword ptr [bp+6]
pushcs
callnear ptr @Object@CreateRespo­nse$quculnuc

I have discovered that moving the function causing problems
to the top of the source file eliminates the bad code generation.
Also compiling without the -Z option produces larger but correct
code.

Any ideas? Thanks.
Add comment
Bruce Salzman 20 April 2004 20:19:49 permanent link ]
 
I have run into a problem with bcc 4.5 producing bad code.> The file is rather large, ~15,000 lines. We are compiling> with the -Z, Enable register load suppression optimization,> option turned on. The exact same function call produces> bad code where the second parameter to the function has> the wrong thing pushed on the stack.

15,000 lines!?! There are many reasons (besides potential tool
instabilities) to avoid files sizes that large! I would suggest breaking
it into managable pieces to see if it cures the problem (let alone
preserve your sanity).

Regards,
Bruce
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > C/C++ Programming > bcc 4.5 generating bad code 20 April 2004 20:19:49

see also:
[ jboss-Feature Requests-1071301 ] Make…
[JBossCache] - Possible newbie question…
jboss-4.0 build.217 Build Successful
пройди тесты:
see also:
ia gangster

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .