This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs-980315 powerpc-ibm-aix4.1.4.0 warning fixes ...


Kaveh R. Ghazi writes:
|  > From: Michael Meissner <meissner@cygnus.com>
|  > 
|  > David Edelsohn writes:
|  > | 	I cannot comment on the correctness for SVR4 functions affected
|  > | and was leaving that to Mike.
|  > 
|  > I obviously lost the patch in the swamp I call an inbox.  When was it
|  > sent, or can you send it again to me.
| 
| 	You can find it at http://www.cygnus.com/ml/egcs/1998-Mar/0679.html

The part of rs6000.h that adds the declaration for:

extern enum direction function_arg_padding ();

is wrong, since it depends on the compiler supporting unknown tags to
enums, which is a GCC extension.  I have fixed this by making the
function an integer function.  I also included system.h as Jeff
pointed out and committed the fixes (including collect2.c and
dbxout.c).

Here is the patch that I committed:

Wed Mar 25 16:09:01 1998  Michael Meissner  <meissner@cygnus.com>

	* rs6000.h (FUNCTION_ARG_PADDING): Cast result to be enum
	direction.
	(function_arg_padding): Declare.

	* rs6000.c: Include system.h.
	(function_arg_padding): Change return type to int, cast enum's to
	int.

	(From Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>)
	* collect2.c (scan_prog_file): Add explicit braces to avoid
	ambiguous `else'.
 
	* dbxout.c (dbxout_type_fields): Add braces around empty body in
	an if-statement.
	(dbxout_type): Likewise.
 
	* rs6000.c (rs6000_override_options): Change type of `i', `j' and
	`ptt_size' from int to size_t.
	(rs6000_file_start): Likewise for `i'.
	(rs6000_replace_regno): Add default case in enumeration switch.
	(output_epilog): Remove unused variable `i'.
	(rs6000_longcall_ref): Remove unused variables `len', `p', `reg1'
	and `reg2'.
 
	* rs6000.h (ADDITIONAL_REGISTER_NAMES): Add missing braces around
	initializer.
	(get_issue_rate, non_logical_cint_operand): Add prototype.
	(rs6000_output_load_toc_table): Ditto.
 
	* rs6000.md (udivmodsi4): Add explicit braces to avoid ambiguous
	`else'.
 
*** gcc/config/rs6000/rs6000.h.~1~	Wed Mar 25 16:07:46 1998
--- gcc/config/rs6000/rs6000.h	Wed Mar 25 14:40:06 1998
*************** typedef struct rs6000_args
*** 1468,1474 ****
     padding.  */
  
  #define FUNCTION_ARG_PADDING(MODE, TYPE) \
!   function_arg_padding (MODE, TYPE)
  
  /* If defined, a C expression that gives the alignment boundary, in bits,
     of an argument with the specified mode and type.  If it is not defined,
--- 1468,1474 ----
     padding.  */
  
  #define FUNCTION_ARG_PADDING(MODE, TYPE) \
!   (enum direction) function_arg_padding (MODE, TYPE)
  
  /* If defined, a C expression that gives the alignment boundary, in bits,
     of an argument with the specified mode and type.  If it is not defined,
*************** extern char rs6000_reg_names[][8];	/* re
*** 2755,2780 ****
  /* Table of additional register names to use in user input.  */
  
  #define ADDITIONAL_REGISTER_NAMES \
!  {"r0",    0, "r1",    1, "r2",    2, "r3",    3,	\
!   "r4",    4, "r5",    5, "r6",    6, "r7",    7,	\
!   "r8",    8, "r9",    9, "r10",  10, "r11",  11,	\
!   "r12",  12, "r13",  13, "r14",  14, "r15",  15,	\
!   "r16",  16, "r17",  17, "r18",  18, "r19",  19,	\
!   "r20",  20, "r21",  21, "r22",  22, "r23",  23,	\
!   "r24",  24, "r25",  25, "r26",  26, "r27",  27,	\
!   "r28",  28, "r29",  29, "r30",  30, "r31",  31,	\
!   "fr0",  32, "fr1",  33, "fr2",  34, "fr3",  35,	\
!   "fr4",  36, "fr5",  37, "fr6",  38, "fr7",  39,	\
!   "fr8",  40, "fr9",  41, "fr10", 42, "fr11", 43,	\
!   "fr12", 44, "fr13", 45, "fr14", 46, "fr15", 47,	\
!   "fr16", 48, "fr17", 49, "fr18", 50, "fr19", 51,	\
!   "fr20", 52, "fr21", 53, "fr22", 54, "fr23", 55,	\
!   "fr24", 56, "fr25", 57, "fr26", 58, "fr27", 59,	\
!   "fr28", 60, "fr29", 61, "fr30", 62, "fr31", 63,	\
!   /* no additional names for: mq, lr, ctr, ap */	\
!   "cr0",  68, "cr1",  69, "cr2",  70, "cr3",  71,	\
!   "cr4",  72, "cr5",  73, "cr6",  74, "cr7",  75,	\
!   "cc",   68, "sp",    1, "toc",   2 }
  
  /* How to renumber registers for dbx and gdb.  */
  
--- 2755,2780 ----
  /* Table of additional register names to use in user input.  */
  
  #define ADDITIONAL_REGISTER_NAMES \
!  {{"r0",    0}, {"r1",    1}, {"r2",    2}, {"r3",    3},	\
!   {"r4",    4}, {"r5",    5}, {"r6",    6}, {"r7",    7},	\
!   {"r8",    8}, {"r9",    9}, {"r10",  10}, {"r11",  11},	\
!   {"r12",  12}, {"r13",  13}, {"r14",  14}, {"r15",  15},	\
!   {"r16",  16}, {"r17",  17}, {"r18",  18}, {"r19",  19},	\
!   {"r20",  20}, {"r21",  21}, {"r22",  22}, {"r23",  23},	\
!   {"r24",  24}, {"r25",  25}, {"r26",  26}, {"r27",  27},	\
!   {"r28",  28}, {"r29",  29}, {"r30",  30}, {"r31",  31},	\
!   {"fr0",  32}, {"fr1",  33}, {"fr2",  34}, {"fr3",  35},	\
!   {"fr4",  36}, {"fr5",  37}, {"fr6",  38}, {"fr7",  39},	\
!   {"fr8",  40}, {"fr9",  41}, {"fr10", 42}, {"fr11", 43},	\
!   {"fr12", 44}, {"fr13", 45}, {"fr14", 46}, {"fr15", 47},	\
!   {"fr16", 48}, {"fr17", 49}, {"fr18", 50}, {"fr19", 51},	\
!   {"fr20", 52}, {"fr21", 53}, {"fr22", 54}, {"fr23", 55},	\
!   {"fr24", 56}, {"fr25", 57}, {"fr26", 58}, {"fr27", 59},	\
!   {"fr28", 60}, {"fr29", 61}, {"fr30", 62}, {"fr31", 63},	\
!   /* no additional names for: mq, lr, ctr, ap */		\
!   {"cr0",  68}, {"cr1",  69}, {"cr2",  70}, {"cr3",  71},	\
!   {"cr4",  72}, {"cr5",  73}, {"cr6",  74}, {"cr7",  75},	\
!   {"cc",   68}, {"sp",    1}, {"toc",   2} }
  
  /* How to renumber registers for dbx and gdb.  */
  
*************** extern struct rtx_def *rs6000_float_cons
*** 3101,3106 ****
--- 3101,3107 ----
  extern struct rtx_def *rs6000_immed_double_const ();
  extern struct rtx_def *rs6000_got_register ();
  extern int direct_return ();
+ extern int get_issue_rate ();
  extern int any_operand ();
  extern int short_cint_operand ();
  extern int u_short_cint_operand ();
*************** extern int offsettable_addr_operand ();
*** 3120,3125 ****
--- 3121,3127 ----
  extern int mem_or_easy_const_operand ();
  extern int add_operand ();
  extern int non_add_cint_operand ();
+ extern int non_logical_cint_operand ();
  extern int logical_operand ();
  extern int non_logical_operand ();
  extern int mask_constant ();
*************** extern int rs6000_adjust_cost ();
*** 3175,3186 ****
--- 3177,3190 ----
  extern void rs6000_trampoline_template ();
  extern int rs6000_trampoline_size ();
  extern void rs6000_initialize_trampoline ();
+ extern void rs6000_output_load_toc_table ();
  extern int rs6000_comp_type_attributes ();
  extern int rs6000_valid_decl_attribute_p ();
  extern int rs6000_valid_type_attribute_p ();
  extern void rs6000_set_default_type_attributes ();
  extern struct rtx_def *rs6000_dll_import_ref ();
  extern struct rtx_def *rs6000_longcall_ref ();
+ extern int function_arg_padding ();
  
  /* See nonlocal_goto_receiver for when this must be set.  */
  
*** gcc/config/rs6000/rs6000.c.~1~	Wed Mar 25 16:07:42 1998
--- gcc/config/rs6000/rs6000.c	Wed Mar 25 14:42:33 1998
*************** Boston, MA 02111-1307, USA.  */
*** 22,27 ****
--- 22,28 ----
  #include <stdio.h>
  #include <ctype.h>
  #include "config.h"
+ #include "system.h"
  #include "rtl.h"
  #include "regs.h"
  #include "hard-reg-set.h"
*************** void
*** 157,163 ****
  rs6000_override_options (default_cpu)
       char *default_cpu;
  {
!   int i, j;
    struct rs6000_cpu_select *ptr;
  
    /* Simplify the entries below by making a mask for any POWER
--- 158,164 ----
  rs6000_override_options (default_cpu)
       char *default_cpu;
  {
!   size_t i, j;
    struct rs6000_cpu_select *ptr;
  
    /* Simplify the entries below by making a mask for any POWER
*************** rs6000_override_options (default_cpu)
*** 241,247 ****
  	    MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
  	    POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}};
  
!   int ptt_size = sizeof (processor_target_table) / sizeof (struct ptt);
  
    int multiple = TARGET_MULTIPLE;	/* save current -mmultiple/-mno-multiple status */
    int string   = TARGET_STRING;		/* save current -mstring/-mno-string status */
--- 242,248 ----
  	    MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
  	    POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}};
  
!   size_t ptt_size = sizeof (processor_target_table) / sizeof (struct ptt);
  
    int multiple = TARGET_MULTIPLE;	/* save current -mmultiple/-mno-multiple status */
    int string   = TARGET_STRING;		/* save current -mstring/-mno-string status */
*************** rs6000_file_start (file, default_cpu)
*** 337,343 ****
       FILE *file;
       char *default_cpu;
  {
!   int i;
    char buffer[80];
    char *start = buffer;
    struct rs6000_cpu_select *ptr;
--- 338,344 ----
       FILE *file;
       char *default_cpu;
  {
!   size_t i;
    char buffer[80];
    char *start = buffer;
    struct rs6000_cpu_select *ptr;
*************** init_cumulative_args (cum, fntype, libna
*** 1187,1208 ****
     For the AIX ABI structs are always stored left shifted in their
     argument slot.  */
  
! enum direction
  function_arg_padding (mode, type)
       enum machine_mode mode;
       tree type;
  {
    if (type != 0 && AGGREGATE_TYPE_P (type))
!     return upward;
  
    /* This is the default definition.  */
    return (! BYTES_BIG_ENDIAN
!           ? upward
            : ((mode == BLKmode
                ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
                   && int_size_in_bytes (type) < (PARM_BOUNDARY / BITS_PER_UNIT))
                : GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)
!              ? downward : upward));
  }
  
  /* If defined, a C expression that gives the alignment boundary, in bits,
--- 1188,1209 ----
     For the AIX ABI structs are always stored left shifted in their
     argument slot.  */
  
! int
  function_arg_padding (mode, type)
       enum machine_mode mode;
       tree type;
  {
    if (type != 0 && AGGREGATE_TYPE_P (type))
!     return (int)upward;
  
    /* This is the default definition.  */
    return (! BYTES_BIG_ENDIAN
!           ? (int)upward
            : ((mode == BLKmode
                ? (type && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
                   && int_size_in_bytes (type) < (PARM_BOUNDARY / BITS_PER_UNIT))
                : GET_MODE_BITSIZE (mode) < PARM_BOUNDARY)
!              ? (int)downward : (int)upward));
  }
  
  /* If defined, a C expression that gives the alignment boundary, in bits,
*************** rs6000_replace_regno (x, from, reg)
*** 2221,2226 ****
--- 2222,2230 ----
  	}
  
        return x;
+ 
+     default:
+       break;
      }
  
    fmt = GET_RTX_FORMAT (GET_CODE (x));
*************** output_epilog (file, size)
*** 3875,3881 ****
    rtx insn = get_last_insn ();
    int sp_reg = 1;
    int sp_offset = 0;
-   int i;
  
    /* If the last insn was a BARRIER, we don't have to write anything except
       the trace table.  */
--- 3879,3884 ----
*************** rs6000_longcall_ref (call_ref)
*** 4946,4954 ****
       rtx call_ref;
  {
    char *call_name;
-   int len;
-   char *p;
-   rtx reg1, reg2;
    tree node;
  
    if (GET_CODE (call_ref) != SYMBOL_REF)
--- 4949,4954 ----
*** gcc/config/rs6000/rs6000.md.~1~	Wed Mar 25 16:07:49 1998
--- gcc/config/rs6000/rs6000.md	Wed Mar 25 14:39:09 1998
***************
*** 1602,1618 ****
    rtx label = 0;
  
    if (! TARGET_POWER)
!     if (! TARGET_POWERPC)
!       {
! 	emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
! 	emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
! 	emit_insn (gen_divus_call ());
! 	emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
! 	emit_move_insn (operands[3], gen_rtx (REG, SImode, 4));
! 	DONE;
!       }
!     else
!       FAIL;
  
    if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 0)
      {
--- 1602,1620 ----
    rtx label = 0;
  
    if (! TARGET_POWER)
!     {
!       if (! TARGET_POWERPC)
!         {
! 	  emit_move_insn (gen_rtx (REG, SImode, 3), operands[1]);
! 	  emit_move_insn (gen_rtx (REG, SImode, 4), operands[2]);
! 	  emit_insn (gen_divus_call ());
! 	  emit_move_insn (operands[0], gen_rtx (REG, SImode, 3));
! 	  emit_move_insn (operands[3], gen_rtx (REG, SImode, 4));
! 	  DONE;
!         }
!       else
!         FAIL;
!     }
  
    if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 0)
      {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]