Patch to fix Fortran on IA64 HP-UX

Steve Ellcey sje@cup.hp.com
Mon Apr 21 19:12:00 GMT 2008


I have been unable to compile Fortran programs on IA64 HP-UX for a
while, it started with the patch:

2007-08-22  Kai Tietz  <kai.tietz@onevision.com>

        * f95-lang.c: (gfc_init_decl_processing): Choose sizetype by using
        Pmode.

On IA64 HP-UX this patch caused most fortran programs to fail to
compiled in 32 bit mode because Pmode is always 64 bits while ptr_mode
is either 32 or 64 bits depending on the compiler flags.  This patch
allows me to compile fortran programs again on IA64 HP-UX.  I am not
sure why this doesn't cause problems on other 32/64 bit platforms.
Maybe because they don't have 'long long' or because their 'long long'
type is the same as 'long'?

Tested on IA64 HP-UX and Linux and on HPPA HP-UX.

OK for checkin?

Steve Ellcey
sje@cup.hp.com


2008-04-21  Steve Ellcey  <sje@cup.hp.com>

	* f95-lang.c (gfc_init_decl_processing): use ptr_mode instead of Pmode.


Index: f95-lang.c
===================================================================
--- f95-lang.c	(revision 134500)
+++ f95-lang.c	(working copy)
@@ -563,9 +563,9 @@ gfc_init_decl_processing (void)
   /* x86_64 minw32 has a sizetype of "unsigned long long", most other hosts
      have a sizetype of "unsigned long". Therefore choose the correct size
      in mostly target independent way.  */
-  if (TYPE_MODE (long_unsigned_type_node) == Pmode)
+  if (TYPE_MODE (long_unsigned_type_node) == ptr_mode)
     set_sizetype (long_unsigned_type_node);
-  else if (TYPE_MODE (long_long_unsigned_type_node) == Pmode)
+  else if (TYPE_MODE (long_long_unsigned_type_node) == ptr_mode)
     set_sizetype (long_long_unsigned_type_node);
   else
     set_sizetype (long_unsigned_type_node);



More information about the Fortran mailing list