After spending hours to find the cause of the segmentation fault i found out 
that the problem coausing source is the gcc/config/i386/djgpp-stdint.h wich 
uses the identifier "signed" to declare signed types. 

Reading the top of the c_common_nodes_and_builins() function in c-common.c it 
tells:
  /* `signed' is the same as `int'.  FIXME: the declarations of "signed",
     "unsigned long", "long long unsigned" and "unsigned short" were in C++
     but not C.  Are the conditionals here needed?  */

So there is no need to declare "signed [char|int|long]" when char, int and long 
are already signed types. The identifier_global_value() function returns 0 if 
the type name is not registered causing a segmentation fault in TREE_TYPE() 
when calling it with nil.

Solution:
remove all keywords "signed" in djgpp-stdint.h

I've provided a patch for gcc-4.7.2 wich will probalby apply on other versions 
too.

------------------------[djcpp-4.7.2.patch]-----------------------------

--- a/gcc/config/i386/djgpp-stdint.h 2013-01-13 15:06:51.567593797 +0100
+++ b/gcc/config/i386/djgpp-stdint.h 2013-01-13 15:31:24.614591760 +0100
@@ -21,10 +21,10 @@

 /* Exact-width integer types */

-#define INT8_TYPE "signed char"
-#define INT16_TYPE "signed short int"
-#define INT32_TYPE "signed long int"
-#define INT64_TYPE "signed long long int"
+#define INT8_TYPE "char"
+#define INT16_TYPE "short int"
+#define INT32_TYPE "long int"
+#define INT64_TYPE "long long int"

 #define UINT8_TYPE "unsigned char"
 #define UINT16_TYPE "short unsigned int"
@@ -33,10 +33,10 @@

 /* Minimum-width integer types */

-#define INT_LEAST8_TYPE "signed char"
-#define INT_LEAST16_TYPE "signed short int"
-#define INT_LEAST32_TYPE "signed int"
-#define INT_LEAST64_TYPE "signed long long int"
+#define INT_LEAST8_TYPE "char"
+#define INT_LEAST16_TYPE "short int"
+#define INT_LEAST32_TYPE "int"
+#define INT_LEAST64_TYPE "long long int"

 #define UINT_LEAST8_TYPE "unsigned char"
 #define UINT_LEAST16_TYPE "short unsigned int"
@@ -45,10 +45,10 @@

 /* Fastest minimum-width integer types */

-#define INT_FAST8_TYPE "signed char"
-#define INT_FAST16_TYPE "signed int"
-#define INT_FAST32_TYPE "signed int"
-#define INT_FAST64_TYPE "long long signed int"
+#define INT_FAST8_TYPE "char"
+#define INT_FAST16_TYPE "int"
+#define INT_FAST32_TYPE "int"
+#define INT_FAST64_TYPE "long int"

 #define UINT_FAST8_TYPE "unsigned char"
 #define UINT_FAST16_TYPE "unsigned int"
----------------------------[END OF PATCH]-------------------------


Reply via email to