public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/40734]  New: ICE on attempt to compile trivial Fortran program
@ 2009-07-13 17:19 al dot danial at ngc dot com
  2009-07-13 18:00 ` [Bug fortran/40734] " dfranke at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: al dot danial at ngc dot com @ 2009-07-13 17:19 UTC (permalink / raw)
  To: gcc-bugs

> gfortran -v -save-temps hello.f
Driving: gfortran -v -save-temps hello.f -lgfortranbegin -lgfortran -lm
-shared-libgcc
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.4.0/configure --with-gmp=/apps/gmp/4.2.2
--with-mpfr=/apps/mpfr/2.4.1 --prefix=/apps/gcc/4.4.0
--enable-languages=c,c++,fortran,java,objc,obj-c++
Thread model: posix
gcc version 4.4.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 /apps/gcc/4.4.0/libexec/gcc/i686-pc-linux-gnu/4.4.0/f951 hello.f -ffixed-form
-quiet -dumpbase hello.f -mtune=generic -auxbase hello -version
-fintrinsic-modules-path
/apps/gcc/4.4.0/lib/gcc/i686-pc-linux-gnu/4.4.0/finclude -o hello.s
GNU Fortran (GCC) version 4.4.0 (i686-pc-linux-gnu)
        compiled by GNU C version 4.4.0, GMP version 4.2.2, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129284
<built-in>:0: internal compiler error: Illegal instruction
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


The source file hello.f is

      program hi
      implicit none
      write(6,*) 'hello'
      end


-- 
           Summary: ICE on attempt to compile trivial Fortran program
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: al dot danial at ngc dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/40734] ICE on attempt to compile trivial Fortran program
  2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
@ 2009-07-13 18:00 ` dfranke at gcc dot gnu dot org
  2009-07-13 18:13 ` jvdelisle at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2009-07-13 18:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dfranke at gcc dot gnu dot org  2009-07-13 18:00 -------
Fortran reports are never anything but "normal". 

However, would you really expect that a compiler would be released that can't
handle code like the one quoted? I find it hard to believe, especially on a
platform as common as i686-pc-linux-gnu.

Does the C-compiler work? Something like ...

$> cat hello.c
#include <stdio.h>
int main() {
  printf("hello\n");
  return 0;
}

$> gcc hello.c && ./a.out

If not, I'd check configuration, compilation and installation.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
           Severity|blocker                     |normal
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/40734] ICE on attempt to compile trivial Fortran program
  2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
  2009-07-13 18:00 ` [Bug fortran/40734] " dfranke at gcc dot gnu dot org
@ 2009-07-13 18:13 ` jvdelisle at gcc dot gnu dot org
  2009-07-13 18:30 ` al dot danial at ngc dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2009-07-13 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2009-07-13 18:12 -------
Try compiling without these:


-lgfortranbegin -lgfortran 

Should not need to do this.  Lets see what it does.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/40734] ICE on attempt to compile trivial Fortran program
  2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
  2009-07-13 18:00 ` [Bug fortran/40734] " dfranke at gcc dot gnu dot org
  2009-07-13 18:13 ` jvdelisle at gcc dot gnu dot org
@ 2009-07-13 18:30 ` al dot danial at ngc dot com
  2009-07-13 18:33 ` al dot danial at ngc dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: al dot danial at ngc dot com @ 2009-07-13 18:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from al dot danial at ngc dot com  2009-07-13 18:30 -------
(In reply to comment #1)
> Fortran reports are never anything but "normal". 
> 
> However, would you really expect that a compiler would be released that can't
> handle code like the one quoted? I find it hard to believe, especially on a
> platform as common as i686-pc-linux-gnu.
> 
> Does the C-compiler work? Something like ...
> 
> $> cat hello.c
> #include <stdio.h>
> int main() {
>   printf("hello\n");
>   return 0;
> }
> 
> $> gcc hello.c && ./a.out
> 
> If not, I'd check configuration, compilation and installation.

The C compiler works fine.  Yes, I'm puzzled by the inability of gfortran to
work at all.  For what it's worth, I also built an x86_64 installation of 4.4.0
and on it gfortran works perfectly.  My build procedure on the i686 machine is
identical to the procedure for x86_64 (except for the obvious difference of
pointing to 32 bit libraries instead of 64 bit for GMP and MPFR).  I agree the
problem is most likely on my end however I'm at a loss to figure out why.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/40734] ICE on attempt to compile trivial Fortran program
  2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
                   ` (2 preceding siblings ...)
  2009-07-13 18:30 ` al dot danial at ngc dot com
@ 2009-07-13 18:33 ` al dot danial at ngc dot com
  2009-07-13 18:42 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: al dot danial at ngc dot com @ 2009-07-13 18:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from al dot danial at ngc dot com  2009-07-13 18:33 -------
(In reply to comment #2)
> Try compiling without these:
> 
> 
> -lgfortranbegin -lgfortran 
> 
> Should not need to do this.  Lets see what it does.

I don't specify either of these options (or any others for that matter).  The
ICE is triggered with

  gfortran hello.f

I'm not sure why the verbose invocation (gfortran -v -save-temps) claims I
supply these: -lgfortranbegin -lgfortran -lm -shared-libgcc


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/40734] ICE on attempt to compile trivial Fortran program
  2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
                   ` (3 preceding siblings ...)
  2009-07-13 18:33 ` al dot danial at ngc dot com
@ 2009-07-13 18:42 ` jakub at gcc dot gnu dot org
  2009-07-13 18:51 ` al dot danial at ngc dot com
  2009-07-13 21:13 ` al dot danial at ngc dot com
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-07-13 18:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2009-07-13 18:42 -------
My guess would be you have configured libgmp or libmpfr for a different CPU
than you really have.  Try
gdb --args /apps/gcc/4.4.0/libexec/gcc/i686-pc-linux-gnu/4.4.0/f951 hello.f
run
and see on which insn it crashed (disas $pc-32 $pc+32)?

Another possibility is the binary got corrupted.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/40734] ICE on attempt to compile trivial Fortran program
  2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
                   ` (4 preceding siblings ...)
  2009-07-13 18:42 ` jakub at gcc dot gnu dot org
@ 2009-07-13 18:51 ` al dot danial at ngc dot com
  2009-07-13 21:13 ` al dot danial at ngc dot com
  6 siblings, 0 replies; 8+ messages in thread
From: al dot danial at ngc dot com @ 2009-07-13 18:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from al dot danial at ngc dot com  2009-07-13 18:51 -------
(In reply to comment #5)
> My guess would be you have configured libgmp or libmpfr for a different CPU
> than you really have.  Try
> gdb --args /apps/gcc/4.4.0/libexec/gcc/i686-pc-linux-gnu/4.4.0/f951 hello.f
> run
> and see on which insn it crashed (disas $pc-32 $pc+32)?
> 
> Another possibility is the binary got corrupted.

>  gdb --args /apps/gcc/4.4.0/libexec/gcc/i686-pc-linux-gnu/4.4.0/f951 hello.f
GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) run
Starting program: /apps/gcc/4.4.0/libexec/gcc/i686-pc-linux-gnu/4.4.0/f951
hello.f

Program received signal SIGILL, Illegal instruction.
0x009c0cb9 in __gmpn_submul_1 () from /apps/gmp/4.2.2/lib/libgmp.so.3

(gdb) where
#0  0x009c0cb9 in __gmpn_submul_1 () from /apps/gmp/4.2.2/lib/libgmp.so.3
#1  0x009cd5a2 in __gmpn_sb_divrem_mn () from /apps/gmp/4.2.2/lib/libgmp.so.3
#2  0x00000000 in ?? ()

(gdb) disas $pc-32 $pc+32
Dump of assembler code from 0x9c0c99 to 0x9c0cd9:
0x009c0c99 <__gmpn_submul_1+2>: leave
0x009c0c9a <__gmpn_submul_1+3>: mov    0x8(%esp),%eax
0x009c0c9e <__gmpn_submul_1+7>: pcmpeqd %mm0,%mm0
0x009c0ca1 <__gmpn_submul_1+10>:        movd   0x10(%esp),%mm7
0x009c0ca6 <__gmpn_submul_1+15>:        pcmpeqd %mm6,%mm6
0x009c0ca9 <__gmpn_submul_1+18>:        mov    0x4(%esp),%edx
0x009c0cad <__gmpn_submul_1+22>:        psrlq  $0x20,%mm0
0x009c0cb1 <__gmpn_submul_1+26>:        mov    0xc(%esp),%ecx
0x009c0cb5 <__gmpn_submul_1+30>:        psllq  $0x20,%mm6
0x009c0cb9 <__gmpn_submul_1+34>:        psubq  %mm0,%mm6
0x009c0cbc <__gmpn_submul_1+37>:        psubq  %mm1,%mm0
0x009c0cbf <__gmpn_submul_1+40>:        movd   (%eax),%mm1
0x009c0cc2 <__gmpn_submul_1+43>:        lea    0x4(%eax),%eax
0x009c0cc5 <__gmpn_submul_1+46>:        movd   (%edx),%mm2
0x009c0cc8 <__gmpn_submul_1+49>:        paddq  %mm6,%mm2
0x009c0ccb <__gmpn_submul_1+52>:        pmuludq %mm7,%mm1
0x009c0cce <__gmpn_submul_1+55>:        psubq  %mm1,%mm2
0x009c0cd1 <__gmpn_submul_1+58>:        paddq  %mm2,%mm0
0x009c0cd4 <__gmpn_submul_1+61>:        sub    $0x1,%ecx
0x009c0cd7 <__gmpn_submul_1+64>:        movd   %mm0,(%edx)
End of assembler dump.
(gdb)

yeah, something with GMP.  I'll rebuild it, then rebuild GCC 4.4.0, report what
happens.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/40734] ICE on attempt to compile trivial Fortran program
  2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
                   ` (5 preceding siblings ...)
  2009-07-13 18:51 ` al dot danial at ngc dot com
@ 2009-07-13 21:13 ` al dot danial at ngc dot com
  6 siblings, 0 replies; 8+ messages in thread
From: al dot danial at ngc dot com @ 2009-07-13 21:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from al dot danial at ngc dot com  2009-07-13 21:13 -------
One more data point:  the build machine runs CentOS 4.3 and on it gfortran
works fine (!).  The ICE happens on a CentOS 4.4 box (using the identical GCC
4.4.0/GMP 4.2.2/MPFR 2.4.1 bits from a shared NFS mount).

I'll mark this as an invalid GCC bug.  Still baffled by the root cause of the
problem though...


-- 

al dot danial at ngc dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40734


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-07-13 21:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-13 17:19 [Bug fortran/40734] New: ICE on attempt to compile trivial Fortran program al dot danial at ngc dot com
2009-07-13 18:00 ` [Bug fortran/40734] " dfranke at gcc dot gnu dot org
2009-07-13 18:13 ` jvdelisle at gcc dot gnu dot org
2009-07-13 18:30 ` al dot danial at ngc dot com
2009-07-13 18:33 ` al dot danial at ngc dot com
2009-07-13 18:42 ` jakub at gcc dot gnu dot org
2009-07-13 18:51 ` al dot danial at ngc dot com
2009-07-13 21:13 ` al dot danial at ngc dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).