From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1ea992d578e9f621 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!i3g2000hsf.googlegroups.com!not-for-mail From: Vadim Godunko Newsgroups: comp.lang.ada Subject: Re: Restricted or no run time in Ada Date: Fri, 4 Jan 2008 05:53:31 -0800 (PST) Organization: http://groups.google.com Message-ID: <51fe0365-f0fd-4e09-9ce1-fd4b39976cab@i3g2000hsf.googlegroups.com> References: <1199450765.7932.2.camel@K72> NNTP-Posting-Host: 87.117.10.113 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1199454811 32431 127.0.0.1 (4 Jan 2008 13:53:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 4 Jan 2008 13:53:31 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i3g2000hsf.googlegroups.com; posting-host=87.117.10.113; posting-account=niG3UgoAAAD7iQ3takWjEn_gw6D9X3ww User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4) Gecko/20070601 SeaMonkey/1.1.2,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19195 Date: 2008-01-04T05:53:31-08:00 List-Id: On Jan 4, 3:46 pm, Georg Bauhaus wrote: > > Have you instructed GNAT to not perform any kind of > optimization? > > Is this an option using Gela? (For example, to verify > close correspondence of source and object code.) I have following assembler code, produced by GNAT GPL 2007 and GCC GNAT 4.3.0 with size optimization and Ada semantic (don't forget enable overflow checking!): $ gcc -c -gnato -O2 test.adb $ objdump --disassemble test.o test.o: file format elf32-i386 Disassembly of section .text: 00000000 <_ada_test>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 53 push %ebx 4: 83 ec 14 sub $0x14,%esp 7: 8b 45 08 mov 0x8(%ebp),%eax a: 89 c2 mov %eax,%edx c: 89 c1 mov %eax,%ecx e: c1 fa 1f sar $0x1f,%edx 11: 83 c1 01 add $0x1,%ecx 14: 89 d3 mov %edx,%ebx 16: 89 c8 mov %ecx,%eax 18: 83 d3 00 adc $0x0,%ebx 1b: 05 00 00 00 80 add $0x80000000,%eax 20: 89 da mov %ebx,%edx 22: 83 d2 00 adc $0x0,%edx 25: 83 fa 00 cmp $0x0,%edx 28: 76 16 jbe 40 <_ada_test+0x40> 2a: c7 44 24 04 03 00 00 movl $0x3,0x4(%esp) 31: 00 32: c7 04 24 00 00 00 00 movl $0x0,(%esp) 39: e8 fc ff ff ff call 3a <_ada_test+0x3a> 3e: 66 90 xchg %ax,%ax 40: 89 c8 mov %ecx,%eax 42: 83 c4 14 add $0x14,%esp 45: 5b pop %ebx 46: 5d pop %ebp 47: c3 ret