patches/gcc/4.2.3/300-fortran-signed-TImode.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 03 09:50:16 2009 +0000 (2009-05-03)
branchnewlib
changeset 1366 5e5d1e6f55d3
parent 677 3505660ff419
permissions -rw-r--r--
Update the newlib devel branch with stuff from /trunk@1498.

-------- diffstat follows --------
/devel/newlib/configure | 336 176 160 0 +++++++------
/devel/newlib/Makefile.in | 12 3 9 0 -
/devel/newlib/scripts/build/kernel/linux.sh | 2 1 1 0
/devel/newlib/scripts/build/internals.sh | 1 0 1 0 -
/devel/newlib/scripts/build/libc/eglibc.sh | 1 0 1 0 -
/devel/newlib/scripts/build/mpfr.sh | 2 1 1 0
/devel/newlib/scripts/functions | 111 5 106 0 ----
/devel/newlib/scripts/config.guess | 7 5 2 0 +
/devel/newlib/scripts/config.sub | 3 2 1 0 +
/devel/newlib/scripts/saveSample.sh.in | 4 2 2 0
/devel/newlib/docs/overview.txt | 8 6 2 0 +
/devel/newlib/samples/armeb-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/sh4-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/x86_64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-elf/crosstool.config | 12 3 9 0 -
/devel/newlib/samples/armeb-unknown-eabi/crosstool.config | 2 0 2 0 -
/devel/newlib/samples/arm-unknown-linux-gnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/ia64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/x86_64-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/armeb-unknown-linux-gnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-e500v2-linux-gnuspe/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/i686-nptl-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/mips-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-iphone-linux-gnueabi/crosstool.config | 8 4 4 0
/devel/newlib/samples/armeb-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown_nofpu-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/i586-geode-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-unknown-linux-uclibc/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/mips-unknown-elf/crosstool.config | 2 0 2 0 -
/devel/newlib/samples/powerpc-405-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/arm-unknown-eabi/crosstool.config | 12 3 9 0 -
/devel/newlib/samples/mipsel-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc64-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/alphaev56-unknown-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/samples/powerpc-860-linux-gnu/crosstool.config | 14 5 9 0 -
/devel/newlib/config/kernel/linux.in | 108 2 106 0 ----
/devel/newlib/config/global/ct-behave.in | 22 13 9 0 +
/devel/newlib/config/global/download.in | 210 15 195 0 +-------
/devel/newlib/config/libc/glibc.in | 7 7 0 0 +
/devel/newlib/config/libc/glibc-eglibc.in-common | 15 14 1 0 +
45 files changed, 382 insertions(+), 839 deletions(-)
yann@677
     1
Fix building gfortran for ARM.
yann@677
     2
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01010.html
yann@677
     3
----
yann@677
     4
yann@677
     5
The patch below fixes a crash building libgfortran on arm-linux-gnueabi.
yann@677
     6
yann@677
     7
This target doesn't really have a 128-bit integer type, however it does use 
yann@677
     8
TImode to represent the return value of certain special ABI defined library 
yann@677
     9
functions. This results in type_for_size(TImode) being called.
yann@677
    10
yann@677
    11
Because TImode deosn't correspond to any gfortran integer kind 
yann@677
    12
gfc_type_for_size returns NULL and we segfault shortly after.
yann@677
    13
yann@677
    14
The patch below fixes this by making gfc_type_for_size handle TImode in the 
yann@677
    15
same way as the C frontend.
yann@677
    16
yann@677
    17
Tested on x86_64-linux and arm-linux-gnueabi.
yann@677
    18
Applied to trunk.
yann@677
    19
yann@677
    20
Paul
yann@677
    21
yann@677
    22
2007-05-15  Paul Brook  <paul@codesourcery.com>
yann@677
    23
yann@677
    24
    gcc/fortran/
yann@677
    25
    * trans-types.c (gfc_type_for_size): Handle signed TImode.
yann@677
    26
yann@677
    27
diff -durN gcc-4.2.3.old/gcc/fortran/trans-types.c gcc-4.2.3/gcc/fortran/trans-types.c
yann@677
    28
--- gcc-4.2.3.old/gcc/fortran/trans-types.c	2007-08-31 10:27:50.000000000 +0200
yann@677
    29
+++ gcc-4.2.3/gcc/fortran/trans-types.c	2008-07-17 09:54:20.000000000 +0200
yann@677
    30
@@ -1799,6 +1799,13 @@
yann@677
    31
 	  if (type && bits == TYPE_PRECISION (type))
yann@677
    32
 	    return type;
yann@677
    33
 	}
yann@677
    34
+
yann@677
    35
+	/* Handle TImode as a special case because it is used by some backends
yann@677
    36
+	   (eg. ARM) even though it is not available for normal use.  */
yann@677
    37
+#if HOST_BITS_PER_WIDE_INT >= 64
yann@677
    38
+	if (bits == TYPE_PRECISION (intTI_type_node))
yann@677
    39
+	  return intTI_type_node;
yann@677
    40
+#endif
yann@677
    41
     }
yann@677
    42
   else
yann@677
    43
     {