diff mbox

Fix MIPS port WRT sprintf and fallthru warnings

Message ID 8bdb9f24-e048-1151-5bf2-d372e311a551@redhat.com
State New
Headers show

Commit Message

Jeff Law Oct. 26, 2016, 8:19 p.m. UTC
The fallthrus in mips16_constant_cost are pretty obvious.  One buffer 
overflow in mips16_build_call_stub and one obvious fallthru comment 
adjustment in mips16_build_call_stub.

The usual stuff.  Installing.

jeff
commit c03f0de027e1079edd02e3494601c6def50dbac1
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Oct 26 20:16:57 2016 +0000

    	* config/mips/mips.c (mips16_constant_cost): Add missing
    	fallthru comments.
    	(mips16_build_call_stub): Increase buffer size.  Adjust
    	fallthru comment.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241597 138bc75d-0d04-0410-961f-82ee72b054a4

Comments

Matthew Fortune Oct. 26, 2016, 9:05 p.m. UTC | #1
Jeff Law <law@redhat.com> writes:
> The fallthrus in mips16_constant_cost are pretty obvious.  One buffer

> overflow in mips16_build_call_stub and one obvious fallthru comment

> adjustment in mips16_build_call_stub.

> 

> The usual stuff.  Installing.


Thanks Jeff.

Matthew
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 02a37f6..3e7704c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@ 
+2016-10-26  Jeff Law  <law@redhat.com>
+
+	* config/mips/mips.c (mips16_constant_cost): Add missing
+	fallthru comments.
+	(mips16_build_call_stub): Increase buffer size.  Adjust
+	fallthru comment.
+
 2016-10-26  David Malcolm  <dmalcolm@redhat.com>
 
 	* print-rtl.c (rtx_writer::print_rtx_operand_code_u): Print
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ebec68e..5c1a35a 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -3828,9 +3828,11 @@  mips16_constant_cost (int code, HOST_WIDE_INT x)
       /* Like LE, but reject the always-true case.  */
       if (x == -1)
 	return -1;
+      /* FALLTHRU */
     case LE:
       /* We add 1 to the immediate and use SLT.  */
       x += 1;
+      /* FALLTHRU */
     case XOR:
       /* We can use CMPI for an xor with an unsigned 16-bit X.  */
     case LT:
@@ -7439,7 +7441,7 @@  mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
   if (GET_CODE (fn) != SYMBOL_REF
       || !call_insn_operand (fn, VOIDmode))
     {
-      char buf[30];
+      char buf[32];
       rtx stub_fn, addr;
       rtx_insn *insn;
       bool lazy_p;
@@ -7635,7 +7637,7 @@  mips16_build_call_stub (rtx retval, rtx *fn_ptr, rtx args_size, int fp_code)
 	    case DCmode:
 	      mips_output_64bit_xfer ('f', GP_RETURN + (8 / UNITS_PER_WORD),
 				      FP_REG_FIRST + 2);
-	      /* Fall though.  */
+	      /* FALLTHRU */
  	    case DFmode:
 	    case V2SFmode:
 	      gcc_assert (TARGET_PAIRED_SINGLE_FLOAT