From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,d6180a4accedcc42 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1094ba,d6180a4accedcc42 X-Google-Attributes: gid1094ba,public X-Google-Thread: fee84,86b52dc0e0192a3e X-Google-Attributes: gidfee84,public From: siopis@astro.ufl.edu (Christos Siopis) Subject: f77 and cc optimization problem on osf v3.2 Date: 1995/07/03 Message-ID: <3t85a0$1na@no-names.nerdc.ufl.edu>#1/1 X-Deja-AN: 105520529 distribution: world references: <3srrb4$qhe@usenet.ucs.indiana.edu> to: lionel@quark.enet.dec.com, siopis organization: Univ. of Florida Astronomy Dept. newsgroups: comp.unix.osf.osf1,comp.lang.fortran,comp.sys.dec Hi, Recently there was a thread on a bug of OSF's cc compiler, regarding the -O3 optimization option. I have a problem with the *Fortran* compiler that I suspect can be traced back to cc's bug. Here is my problem: ---------------- % f77 -v nbmod.f /usr/lib/cmplrs/fort/decfort -o /tmp/forAAAaanbea.o nbmod.f /usr/bin/cc -v /usr/lib/cmplrs/fort/for_main.o /tmp/forAAAaanbea.o -O4 -lUfor -lfor -lFutil -lm -lots /usr/lib/cmplrs/cc/ld -g0 -O4 -call_shared /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/fort/for_main.o /tmp/forAAAaanbea.o -lUfor -lfor -lFutil -lm -lots -lc Assertion failed: 0, file ../../../../../../src/usr/ccs/lib/libmld/ cmrlc_produce.c, line 864 0.2u 0.0s 0:00 30% 0+7k 18+8io 1pf+0w Fatal error in: /usr/lib/cmplrs/cc/ld IOT/Abort trap fort: Severe: Failed while trying to link. ---------------- I have no idea what the assertion failure means and I could not locate any ../../../blabla/cmrlc_produce.c file (could it probably be missing?) What does cmrlc_produce.c do? The default optimization parameter for DEC OSF f77 is -O4, which is actually passed down to the cc compiler. When I compiled the program with -O0 and -O1 there was no problem. When I compiled with -O2 though, it would *not* work. So it seems my problem starts with -O2, not -O3. One solution suggested was to use the -migrate option, but that did not work either: ---------------- % f77 -migrate -v nbmod.f /usr/lib/cmplrs/fort/decfort -o /tmp/forAAAaalzra.o nbmod.f /usr/bin/cc -migrate -v /usr/lib/cmplrs/fort/for_main.o /tmp/forAAAaalzra.o -O4 -lUfor -lfor -lFutil -lm -lots /usr/lib/cmplrs/cc/ld -g0 -O4 -std0 -call_shared /usr/lib/cmplrs/cc/crt0.o /usr/lib/cmplrs/fort/for_main.o /tmp/forAAAaalzra.o -lUfor -lfor -lFutil -lm -lots -lots -lc Assertion failed: 0, file ../../../../../../src/usr/ccs/lib/libmld/ cmrlc_produce.c, line 864 0.2u 0.0s 0:00 42% 0+7k 5+9io 0pf+0w Fatal error in: /usr/lib/cmplrs/cc/ld IOT/Abort trap fort: Severe: Failed while trying to link. ---------------- This is interesting, because according to the documentation, -migrate forces the compiler to use the DEC C (instead of the DEC OSF/1 C) compilation environment, which uses "other" optimizations. One difference between my case and the cc bug reported by Bill Wang is that I cannot even link, whereas he *could* link, but he would get different results from the optimized and the non-optimized executables. I have compiled the source code successfully on Ultrix, AIX, VMS and SunOS. I will have to use my Alpha for runs that could take several weeks at a time, and optimization could be crucial (I have had execution time decreased by more than a factor of 2 between -O1 and -O4 on one occasion). So using -O1 would not really be a satisfactory solution (unless there was a way to know that -O4 would not significantly improve performance). Any help would be appreciated. Please cc: your post to me personally. -- ********************************************************************* * Christos Siopis | Internet: siopis@astro.ufl.edu * * Graduate Student | BITNET : siopis@ufcc * * P.O. Box 112055 | * * Department of Astronomy | Voice : (904) 374-6833 * * University of Florida | (904) 392-0123 * * Gainesville, FL 32611-2055 | * * U.S.A. | FAX : (904) 392-5089 * *********************************************************************