OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 12:50 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Optimization problem with DJGPP
PostPosted: Tue Aug 28, 2001 11:00 pm 
Hello

When I switch on optimization with DJGPP
(gcc -c -O test.c), the code produced doesn't
work.
When I compile my kernel without optimization
it works, but with, it doesn't.

I tried to compare both assembly dumps with
objdump -D test.o > test.lst (about 16Mb
of dump !)
Obviously, it hangs when the first or
the second function call
occur - it depends on sth I didn't
find even after hours. Is there a
problem with the stack ?

NB: all this is in PMODE.

thanks to explain


Top
  
 
 Post subject: RE:Optimization problem with DJGPP
PostPosted: Wed Aug 29, 2001 11:00 pm 
>On 2001-08-29 04:59:26, CHIPOUNOV Vitaly wrote:
>When I switch on optimization with DJGPP
>(gcc -c -O test.c), the code produced doesn't
>work.

Do you use inline assembly (__asm__ statements)?
Maybe they are not correct.

Sometimes you must use the 'volatile' keyword
when you do something the compiler doesn't expect.

Do you get warning messages when you compile?
Do you read them and understand them? You
should enable all the warnings (gcc -Wall -W ...)

I have not yet found a bug in DJGPP, so I don't
think that is the problem.


Top
  
 
 Post subject: RE:Optimization problem with DJGPP
PostPosted: Wed Aug 29, 2001 11:00 pm 
>On 2001-08-30 00:15:09, Chris Giese wrote:
>>On 2001-08-29 04:59:26, CHIPOUNOV Vitaly wrote:
>>When I switch on optimization with DJGPP
>>(gcc -c -O test.c), the code produced doesn't
>>work.
>
>Do you use inline assembly (__asm__ statements)?
>Maybe they are not correct.
>>>The only inline assembly I use is for system
purpose (load cr3, cr0...) and to get
the params from the stack like with printf
to use multiple args.

>
>Sometimes you must use the 'volatile' keyword
>when you do something the compiler doesn't expect.
>
>Do you get warning messages when you compile?
>>>Yes the only are "Conflict with builtin strcmp"
I have implemented my own strcmp and it tells me
that. But it doesn't affect my code.

>Do you read them and understand them? You
>should enable all the warnings (gcc -Wall -W ...)
>>>I understand them (thank god) but i'll try with
-Wall.
>
>I have not yet found a bug in DJGPP, so I don't
>think that is the problem.
>>I hope there isn't any


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot], SemrushBot [Bot] and 125 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group