public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/21125] New: gfortran - bus error printing warning message
@ 2005-04-20 15:03 dir at lanl dot gov
  2005-04-20 15:08 ` [Bug fortran/21125] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: dir at lanl dot gov @ 2005-04-20 15:03 UTC (permalink / raw)
  To: gcc-bugs

I get a bus error when I try to compile this program. If you look at the trace
back, translate_common was making a call to gfc_warning with this statement -

	      gfc_warning ("Padding of %d bytes required before '%s' in "
			   "COMMON '%s' at %L", offset, s->sym->name,
			   common->name, &common->where);
	    }

offset is declared by -

  HOST_WIDE_INT offset;

on the Macintosh, the program is crashing because HOST_WIDE_INT is 8 bytes and
the %d format is only skipping 4 bytes throwing off the address for the later
arguments. Cast statements are needed on the calls with the "long int" to
gfc_warning or a new "%ld" option needs to be added to gfc_warning.



[dranta:~/tests/gfortran] dir% gfortran -c tex3d.f
tex3d.f: In function 'MAIN__':
tex3d.f:9: internal compiler error: Segmentation Fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[dranta:~/tests/gfortran] dir% cat tex3d.f
      PROGRAM GAP3D
C     IMPLICIT DOUBLE PRECISION (A-H,O-Z)
      DOUBLE PRECISION NINE,NINETH,MILLON
      COMMON /FLTNUM/ ZERO,ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,
     1   NINE,TEN,HALF,THIRD,FOURTH,FIFTH,SIXTH,SEVNTH,EIGHTH,NINETH,
     2   TENTH,HUNDRD,THOU,MILLON
C
C
      END


Thread 0 Crashed:
0   f951 	0x00014d40 error_print + 0x120 (error.c:435)
1   f951 	0x00014d30 error_print + 0x110 (error.c:435)
2   f951 	0x00015b3c gfc_warning + 0xbc (error.c:541)
3   f951 	0x0005c810 translate_common + 0x214 (trans-common.c:874)
4   f951 	0x0004d834 gfc_traverse_symtree + 0x28 (symbol.c:2283)
5   f951 	0x0005c9dc gfc_trans_common + 0x80 (trans-common.c:967)
6   f951 	0x00061ab4 gfc_generate_function_code + 0xc0 (trans-decl.c:2212)
7   f951 	0x00053850 gfc_generate_code + 0xc8 (trans.c:678)
8   f951 	0x00038b8c gfc_parse_file + 0x2c4 (parse.c:2637)
9   f951 	0x0004ed68 gfc_be_parse_file + 0x20 (f95-lang.c:264)
10  f951 	0x0034b8e4 compile_file + 0x70 (toplev.c:1004)
11  f951 	0x0034d894 do_compile + 0xac (toplev.c:2122)
12  f951 	0x0034d918 toplev_main + 0x58 (toplev.c:2154)
13  f951 	0x00001ae0 _start + 0x188 (crt.c:267)
14  dyld 	0x8fe1a558 _dyld_start + 0x64

-- 
           Summary: gfortran - bus error printing warning message
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dir at lanl dot gov
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: powerpc-apple-darwin7.8.0


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


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

* [Bug fortran/21125] gfortran - bus error printing warning message
  2005-04-20 15:03 [Bug fortran/21125] New: gfortran - bus error printing warning message dir at lanl dot gov
@ 2005-04-20 15:08 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-20 15:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-20 15:08 -------


*** This bug has been marked as a duplicate of 20059 ***

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


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


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

end of thread, other threads:[~2005-04-20 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-20 15:03 [Bug fortran/21125] New: gfortran - bus error printing warning message dir at lanl dot gov
2005-04-20 15:08 ` [Bug fortran/21125] " pinskia at gcc dot gnu dot org

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).