This is a resend of an earlier patch I sent to fix a problem I have
with the open64 build on IA64.   My original email did not get any
replies.

This is a patch to osprey/common/ipfec_targ_info/gen/itanium_gen.cxx.
The calls to EKAPI_MapResource, which uses varargs, have a -1 to
terminate the argument list but the argument type for this argument is
kapi_ut_t, an enum.  Apparently, GCC 4.1 is using a signed int as the
underlying type for this enum but GCC 4.3 is using an unsigned int as
the underlying type (I believe the standard allows for either).  Thus,
with GCC 4.3, when we map the -1 to a kapi_ut_t we get a large positive
value instead of -1 and EKAPI_MapResource looks at the next argument
(which we didn't pass).  My fix for this is to actually pass the next
argument, also -1, because the next argument type is int (kapi_cutport_t)
and a -1 here causes the loop in EKAPI_MapResource to correctly stop and
everything works.

I tested it on IA64 and it allows me to build open64 on IA64 using
GCC 4.3.

Can a gatekeeper please review this patch and OK it for checkin?

Steve Ellcey
s...@cup.hp.com



Index: osprey/common/ipfec_targ_info/gen/itanium_gen.cxx
===================================================================
--- osprey/common/ipfec_targ_info/gen/itanium_gen.cxx   (revision 3055)
+++ osprey/common/ipfec_targ_info/gen/itanium_gen.cxx   (working copy)
@@ -109,57 +109,57 @@ void Itanium_Generator(void *pknobs, GEN
                       kapi_utM, 0,
                       kapi_utM, 1,
                       kapi_utM, 2,
-                      kapi_utM, 3, -1);
+                      kapi_utM, 3, -1, -1);
     EKAPI_MapResource(pknobs, "memory", 0,
                       kapi_utM, 0,
                       kapi_utM, 1,
                       kapi_utM, 2,
-                      kapi_utM, 3, -1);
+                      kapi_utM, 3, -1, -1);
     EKAPI_MapResource(pknobs, "memory_ld", 0,
                       kapi_utM, 0,
-                      kapi_utM, 1, -1);
+                      kapi_utM, 1, -1, -1);
     EKAPI_MapResource(pknobs, "memory_st", 0,
                       kapi_utM, 2,
-                      kapi_utM, 3, -1);
+                      kapi_utM, 3, -1, -1);
     EKAPI_MapResource(pknobs, "memory0", 0,
-                      kapi_utM, 0, -1);
+                      kapi_utM, 0, -1, -1);
     EKAPI_MapResource(pknobs, "memory2", 0,
-                      kapi_utM, 2, -1);
+                      kapi_utM, 2, -1, -1);
 
     } else {/* Itanium */
     EKAPI_MapResource(pknobs, "integer_or_memory", 0, 
                       kapi_utI, 0,
                       kapi_utI, 1,
                       kapi_utM, 0,
-                      kapi_utM, 1, -1);
+                      kapi_utM, 1, -1, -1);
     EKAPI_MapResource(pknobs, "memory", 0,
                       kapi_utM, 0,
-                      kapi_utM, 1, -1);
+                      kapi_utM, 1, -1, -1);
     EKAPI_MapResource(pknobs, "memory0", 0,
-                      kapi_utM, 0, -1);
+                      kapi_utM, 0, -1, -1);
     }
     EKAPI_MapResource(pknobs, "floating-point", 0,
                       kapi_utF, 0,
-                      kapi_utF, 1, -1); 
+                      kapi_utF, 1, -1, -1); 
     EKAPI_MapResource(pknobs, "floating-point0", 0,
-                      kapi_utF, 0, -1);                  
+                      kapi_utF, 0, -1, -1);                  
     EKAPI_MapResource(pknobs, "integer", 0,
                       kapi_utI, 0,
-                      kapi_utI, 1, -1); 
+                      kapi_utI, 1, -1, -1); 
     EKAPI_MapResource(pknobs, "integer0", 0,
-                      kapi_utI, 0, -1);                      
+                      kapi_utI, 0, -1, -1);                      
     EKAPI_MapResource(pknobs, "branch", 0,
                       kapi_utB, 0,
                       kapi_utB, 1,
-                      kapi_utB, 2, -1); 
+                      kapi_utB, 2, -1, -1); 
     EKAPI_MapResource(pknobs, "B0_or_B1", 0,
                       kapi_utB, 0,
-                      kapi_utB, 1, -1);
+                      kapi_utB, 1, -1, -1);
     EKAPI_MapResource(pknobs, "B0_or_B2", 0,
                       kapi_utB, 0,
-                      kapi_utB, 2, -1);
+                      kapi_utB, 2, -1, -1);
     EKAPI_MapResource(pknobs, "B2", 0,
-                      kapi_utB, 2, -1);
+                      kapi_utB, 2, -1, -1);
     
     
    // EKAPI_MapResource(pknobs, "");


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to