Changeset 617


Ignore:
Timestamp:
Aug 16, 2003, 10:07:31 PM (22 years ago)
Author:
zap
Message:

Attribute compatibility checking logic enhanced even more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gcc/gcc/config/i386/i386.c

    • Property cvs2svn:cvs-rev changed from 1.8 to 1.9
    r616 r617  
    12971297};
    12981298
     1299
     1300
     1301
     1302
     1303
     1304
     1305
     1306
     1307
     1308
     1309
     1310
     1311
     1312
     1313
     1314
     1315
     1316
     1317
     1318
     1319
     1320
     1321
     1322
     1323
     1324
     1325
     1326
     1327
    12991328/* Check if we don't have incompatible calling conversion attributes */
    13001329int
     
    13241353
    13251354  for (i = 0; ix86_attribute_table [i].name; i++)
    1326     if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type)))
     1355    if ((ix86_attribute_codes [i] & IX86_ATTR_TYPE_CALLCONV)
     1356     && lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type)))
    13271357      {
    13281358        /* Warn if we have another calling convention attribute and it is
     
    15261556     tree type2;
    15271557{
    1528   unsigned i;
    1529   unsigned char cc1 = 0, cc2 = 0;
    1530   /* WARNING! Keep in sync with ix86_attribute_table!!! */
    1531   unsigned char attrcode [] =
    1532   {
    1533     0x10, // stdcall
    1534     0x20, // cdecl
    1535     0x30, // regparm
    1536 #ifdef TARGET_DLLIMPORT_DECL_ATTRIBUTES
    1537     0x40, // dllimport
    1538     0x50, // dllexport
    1539     0x60, // shared
    1540 #endif
    1541 #ifdef TARGET_SYSTEM_DECL_ATTRIBUTES
    1542     0x21, // system is compatible with cdecl
    1543 #endif
    1544 #ifdef TARGET_OPTLINK_DECL_ATTRIBUTES
    1545     0x70, // optlink
    1546 #endif
    1547   };
     1558  unsigned i, cc1 = 0, cc2 = 0;
    15481559
    15491560  /* The following calling conventions have meaning only for functions */
     
    15601571
    15611572  for (i = 0; ix86_attribute_table [i].name; i++)
    1562     {
    1563       if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type1)))
    1564         cc1 = attrcode [i];
    1565       if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type2)))
    1566         cc2 = attrcode [i];
    1567     }
     1573    if (ix86_attribute_codes [i] & IX86_ATTR_TYPE_CALLCONV)
     1574      {
     1575        if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type1)))
     1576          cc1 = ix86_attribute_codes [i];
     1577        if (lookup_attribute (ix86_attribute_table [i].name, TYPE_ATTRIBUTES (type2)))
     1578          cc2 = ix86_attribute_codes [i];
     1579      }
    15681580
    15691581  if (!cc1)
    1570     cc1 = TARGET_RTD ? 0x10 : 0x20;
     1582    cc1 = ;
    15711583  if (!cc2)
    1572     cc2 = TARGET_RTD ? 0x10 : 0x20;
     1584    cc2 = ;
    15731585
    15741586  /* If calling conventions are the same, its okay */
     
    15771589
    15781590  /* If they are not compatible, return 0 */
    1579   if ((cc1 ^ cc2) & 0xf0)
     1591  if ((cc1 ^ cc2) & )
    15801592    return 0;
    15811593
Note: See TracChangeset for help on using the changeset viewer.