www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/18/19:00:48

From: elvenforst AT aol DOT com (ElvenForst)
Newsgroups: comp.os.msdos.djgpp
Subject: Allegro and Linux
Lines: 15
NNTP-Posting-Host: ladder01.news.aol.com
Date: 18 Sep 1998 22:52:28 GMT
Organization: AOL http://www.aol.com
Message-ID: <19980918185228.08730.00001225@ng-fc2.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

To all,

I have just about had it up to -here- with Windows, and it's time for me to
delete it off of my hard drive.  I've done lots of work with Linux and I'm
thinking of installing it back on my computer.  But, I don't want to give up
Allegro!  Does Allegro work under Linux?  I saw some Linux stuff in allegro.h
so I thought that is might, but I want to be SURE.  I don't want to have to
re-write any of my software if it can be helped.  Has anyone tried this?

Also, if I can do it, I'm developing software that will eventually be used in
DOS.  Can I develop the software under Linux (and Allegro) and then be able to
compile it with DJGPP at a later point in time?

--Richard Ellwood

   tmp = rcv();	
   if (tmp)
      return (tmp);
   tmp = x;
   return (y - tmp);
}

"GCC -O2 -S test.c"  (version 2.7.2.1) gave me the following:

_test:
	pushl %ebp
	movl %esp,%ebp
	subl $4,%esp
	pushl %ebx
	movb 8(%ebp),%bl
	movb 12(%ebp),%cl
	movb %cl,-4(%ebp)
	call _rcv
	movl %eax,%edx
	testl %edx,%edx
	jne L2
	movsbl %bl,%edx
	movsbl -4(%ebp),%eax
	subl %edx,%eax
	jmp L3
	.align 2,0x90
L2:
	movl %edx,%eax
L3:
	movl -8(%ebp),%ebx
	leave
	ret

  What happened?  I really did have the "-O2".  I can make tiny
changes in the above code and suddenly get decent output.  What
about the above code makes the optimizer go insane?

BTW: I also tried -fomit-frame-pointer on my live code and it
doesn't help.  I guess I misunderstood the documentation.  I
thought it meant it omitted the frame pointer based on some
cutoff for how much it was used.  In my code it omitted it
always, which makes most routines slightly better and some
routines very much worse.
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019