Re: gcc-gnat for Linux/MIPS-32bit-be, and HPPA2
Carlo Pisani wrote on 07/22/2018 03:24 AM: hi guys got some deb files from an old Debian's archive(1), converted .deb into .tgz, and installed but it seems there is no gnat-gcc I don't know how Gnat works on Debian, but for sure it doesn't work like the version I have on my gentoo-x86 box where I have prepared this test file, hello.adb with Ada.Text_IO; use Ada.Text_IO; procedure Hello is begin Put_Line ("Hello WORLD!"); end Hello; that I can compile via "gnatmake hello.adb" gnat make -v hallo.ada GNATMAKE 4.3.5 "hello.ali" being checked ... gnatgcc -c -x ada hello.adb End of compilation gnatbind -x hello.ali gnatlink hello.ali as you can see it calls "gnatgcc" On HPPA: - "gnatgcc" is not existing out of the debian pagkage(1) - gnat make calls "gcc-4.3" - the installed gcc (provided by gentoo) can't compile ada-files - since the compiler was compiled with languages=C,C++,Fortran and idea? hints? I would say just get the source tarball of gcc 4.3.x from https://gcc.gnu.org/releases.html and build it yourself with the languages you want, ie. add gnat (ada) to the list. (Not sure, but I think by default it generates all languages, incl. ada, ie. gnat) For the HP platforms check also http://hpux.connect.org.uk/ See also https://wiki.gentoo.org/wiki/Project:Ada (1) http://snapshot.debian.org/archive/debian/20091008T120404Z/pool/main/g/gnat-4.3
Re: gcc-gnat for Linux/MIPS-32bit-be, and HPPA2
U.Mutlu wrote on 07/22/2018 11:20 AM: Carlo Pisani wrote on 07/22/2018 03:24 AM: hi guys got some deb files from an old Debian's archive(1), converted .deb into .tgz, and installed but it seems there is no gnat-gcc I don't know how Gnat works on Debian, but for sure it doesn't work like the version I have on my gentoo-x86 box where I have prepared this test file, hello.adb with Ada.Text_IO; use Ada.Text_IO; procedure Hello is begin Put_Line ("Hello WORLD!"); end Hello; that I can compile via "gnatmake hello.adb" gnat make -v hallo.ada GNATMAKE 4.3.5 "hello.ali" being checked ... gnatgcc -c -x ada hello.adb End of compilation gnatbind -x hello.ali gnatlink hello.ali as you can see it calls "gnatgcc" On HPPA: - "gnatgcc" is not existing out of the debian pagkage(1) - gnat make calls "gcc-4.3" - the installed gcc (provided by gentoo) can't compile ada-files - since the compiler was compiled with languages=C,C++,Fortran and idea? hints? I would say just get the source tarball of gcc 4.3.x from https://gcc.gnu.org/releases.html and build it yourself with the languages you want, ie. add gnat (ada) to the list. (Not sure, but I think by default it generates all languages, incl. ada, ie. gnat) For the HP platforms check also http://hpux.connect.org.uk/ See also https://wiki.gentoo.org/wiki/Project:Ada (1) http://snapshot.debian.org/archive/debian/20091008T120404Z/pool/main/g/gnat-4.3 Here's the dependency list under Debian 7 (wheezy): $ apt-cache depends gnat-4.9 gnat-4.9 Depends: gnat-4.9-base Depends: gcc-4.9 Depends: libgnat-4.9 Depends: libc6-dev Depends: libc6 Depends: libcloog-isl4 Depends: libgcc1 Depends: libgmp10 Depends: libgnatprj4.9 Depends: libgnatvsn4.9 Depends: libisl10 Depends: libmpc3 Depends: libmpfr4 Depends: zlib1g ... So, your version should be in the repo of a previous Debian version, possibly Debian 6 (squeeze) https://www.debian.org/releases/
Re: gcc-gnat for Linux/MIPS-32bit-be, and HPPA2
Le 22/07/2018 à 03:24, Carlo Pisani a écrit : hi guys got some deb files from an old Debian's archive(1), converted .deb into .tgz, and installed but it seems there is no gnat-gcc I don't know how Gnat works on Debian, but for sure it doesn't work like the version I have on my gentoo-x86 box where I have prepared this test file, hello.adb with Ada.Text_IO; use Ada.Text_IO; procedure Hello is begin Put_Line ("Hello WORLD!"); end Hello; that I can compile via "gnatmake hello.adb" gnat make -v hallo.ada GNATMAKE 4.3.5 "hello.ali" being checked ... gnatgcc -c -x ada hello.adb End of compilation gnatbind -x hello.ali gnatlink hello.ali as you can see it calls "gnatgcc" On HPPA: - "gnatgcc" is not existing out of the debian pagkage(1) - gnat make calls "gcc-4.3" - the installed gcc (provided by gentoo) can't compile ada-files - since the compiler was compiled with languages=C,C++,Fortran and idea? hints? (1) http://snapshot.debian.org/archive/debian/20091008T120404Z/pool/main/g/gnat-4.3 I have observed that, in Debian, the default version of gcc used for Ada is sometimes older than the version used for C/C++. In other words, the default gcc doesn't understand Ada. Therefore gnatgcc points to another version of gcc, which understands it. That might explain, at least in part, the difference you see. Didier
Re: gcc-gnat for Linux/MIPS-32bit-be, and HPPA2
On 22.07.2018 03:24, Carlo Pisani wrote: > hi guys > got some deb files from an old Debian's archive(1), converted .deb Debian stretch (9) comes with GCC 6, and gnat cross compilers available, same for Ubuntu 18.04 LTS (GCC 7). It may be better to start with more recent versions (packages are gnat-6-hppa-linux-gnu, gnat-6-mips-linux-gnu, and corresponding GCC 7 vesions).
Re: gcc-gnat for Linux/MIPS-32bit-be, and HPPA2
On Sun, Jul 22, 2018 at 03:24:48AM +0200, Carlo Pisani wrote:> > On HPPA: > - "gnatgcc" is not existing out of the debian pagkage(1) > - gnat make calls "gcc-4.3" > - the installed gcc (provided by gentoo) can't compile ada-files > - since the compiler was compiled with languages=C,C++,Fortran > > > and idea? hints? The latest gnat compiler for hppa on Debian is gnat-7: https://packages.debian.org/sid/gnat-7 The gcc-7 compile driver supports c,ada,c++,d,fortran,objc,obj-c++. Dave signature.asc Description: PGP signature
Re: O2 Agressive Optimisation by GCC
Allan , >>he might as well go traditional you mean using the locks ? Thank you ~Umesh On Sat, Jul 21, 2018 at 4:20 AM, Allan Sandfeld Jensen wrote: > On Samstag, 21. Juli 2018 00:21:48 CEST Jonathan Wakely wrote: >> On Fri, 20 Jul 2018 at 23:06, Allan Sandfeld Jensen wrote: >> > On Freitag, 20. Juli 2018 14:19:12 CEST Umesh Kalappa wrote: >> > > Hi All , >> > > >> > > We are looking at the C sample i.e >> > > >> > > extern int i,j; >> > > >> > > int test() >> > > { >> > > while(1) >> > > { i++; >> > > >> > > j=20; >> > > >> > > } >> > > return 0; >> > > } >> > > >> > > command used :(gcc 8.1.0) >> > > gcc -S test.c -O2 >> > > >> > > the generated asm for x86 >> > > >> > > .L2: >> > > jmp .L2 >> > > >> > > we understand that,the infinite loop is not deterministic ,compiler >> > > is free to treat as that as UB and do aggressive optimization ,but we >> > > need keep the side effects like j=20 untouched by optimization . >> > > >> > > Please note that using the volatile qualifier for i and j or empty >> > > asm("") in the while loop,will stop the optimizer ,but we don't want >> > > do that. >> > >> > But you need to do that! If you want changes to a variable to be >> > observable in another thread, you need to use either volatile, >> >> No, volatile doesn't work for that. >> > It does, but you shouldn't use for that due to many other reasons (though the > linux kernel still does) But if the guy wants to code primitive without using > system calls or atomics, he might as well go traditional > > 'Allan > >
Re: O2 Agressive Optimisation by GCC
Hi Richard, making i unsigned still the optimization is effective ,no luck. and yes test() is the threaded routine and since i and j are global ,we need the side effects take place like assignment etc ,that are observed by other threads . By making volatile or thread safe or atomic operations ,the optimization inhibited ,but still we didn't get why its valid optimization for UB and tried with -fno-strict-overflow too ,no luck here . Jakub and anyone can we inhibit these kind optimizations,that consider the UB and optimize . Thank you ~Umesh On Fri, Jul 20, 2018 at 11:47 PM, Richard Biener wrote: > On July 20, 2018 7:59:10 PM GMT+02:00, Martin Sebor wrote: >>On 07/20/2018 06:19 AM, Umesh Kalappa wrote: >>> Hi All , >>> >>> We are looking at the C sample i.e >>> >>> extern int i,j; >>> >>> int test() >>> { >>> while(1) >>> { i++; >>> j=20; >>> } >>> return 0; >>> } >>> >>> command used :(gcc 8.1.0) >>> gcc -S test.c -O2 >>> >>> the generated asm for x86 >>> >>> .L2: >>> jmp .L2 >>> >>> we understand that,the infinite loop is not deterministic ,compiler >>> is free to treat as that as UB and do aggressive optimization ,but we >>> need keep the side effects like j=20 untouched by optimization . >>> >>> Please note that using the volatile qualifier for i and j or empty >>> asm("") in the while loop,will stop the optimizer ,but we don't want >>> do that. >>> >>> Anyone from the community ,please share their insights why above >>> transformation is right ? >> >>The loop isn't necessarily undefined (and compilers don't look >>for undefined behavior as opportunities to optimize code), but > > The variable i overflows. > >>because it doesn't terminate it's not possible for a conforming >>C program to detect the side-effects in its body. The only way >>to detect it is to examine the object code as you did. > > I'm not sure we perform this kind of dead code elimination but yes, we could. > Make i unsigned and check whether that changes behavior. > >>Compilers are allowed (and expected) to transform source code >>into efficient object code as long as the transformations don't >>change the observable effects of the program. That's just what >>happens in this case. >> >>Martin >
Re: gcc-gnat for Linux/MIPS-32bit-be, and HPPA2
I think the OP is in need of the 4.3 version of gnat, found it at a Debian archive site, but lacks some dependencies (gcc and libs). Normally they too should be there around. The 4.3 versions of gnat/gcc/g++ can be found precompiled in the official Debian 5 (lenny) release for the various platforms. One can get the Debian 5 (lenny) also via the tool "debootstrap" into a chrooted subdirectory, and therein then use "apt-get install gnat" which will install it with all its dependencies (gcc & libs etc.). This works w/o problems at least on a x86_64 platform with i386 target. On his mips32be and hppa2 platform(s) that same procedure should work too. Here are the details: https://wiki.debian.org/Debootstrap
gcc-9-20180722 is now available
Snapshot gcc-9-20180722 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/9-20180722/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 9 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/trunk revision 262923 You'll find: gcc-9-20180722.tar.xzComplete GCC SHA256=35cce1da9244babd1984d9df90ef27a11c24d2b92a1264b4392f8a37aeb144f7 SHA1=72252527f3554346f178003deb08cffcc8ce1e33 Diffs from 9-20180715 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-9 link is updated and a message is sent to the gcc list. Please do not use a snapshot before it has been announced that way.
Re: O2 Agressive Optimisation by GCC
On Sonntag, 22. Juli 2018 17:01:29 CEST Umesh Kalappa wrote: > Allan , > > >>he might as well go traditional > > you mean using the locks ? > No I am meant relying on undefined behavior. In your case I would recommend using modern atomics, which is defined behavior, and modern and fast. I was just reminded of all the nasty and theoretically wrong ways we used to do stuff like that 20 years ago to implement fallback locks. For instance using - O0, asm-declarations, relying on non-inlined functions calls as memory- barriers, etc. All stuff that "worked", but relied on various degrees of undefined behavior. Still if you are curious, it might be fun playing with stuff like that, and try to figure for yourself why it works, just remember it is undefined behavior and therefore not recommended. 'Allan