public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix frv port WRT fallthru
@ 2016-10-26 16:17 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2016-10-26 16:17 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]


We will return garbage from comparison_string in the event of an error 
in an ASM due to unintentional fallthru.  My first through was to have 
output_operand_lossage declared as non-returning, but returning in the 
case of a user ASM is what it's designed to do AFAICT.

So we just avoid the fallthru and return an empty string after issuing 
the error.

Installing on the trunk.

Jeff

[-- Attachment #2: P --]
[-- Type: text/plain, Size: 1221 bytes --]

commit ff166102929f47c8bffb5aa8699066d9fafa8bb2
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Oct 26 16:15:38 2016 +0000

    	* config/frv/frv.c (comparison_string): Do not fall through after
    	an error.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241576 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index afa4562..53d751d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
 2016-10-26  Jeff Law  <law@redhat.com>
 
+	* config/frv/frv.c (comparison_string): Do not fall through after
+	an error.
+
 	* config/iq2000/iq2000.c (iq2000_function_arg): Adjust fallthru
 	comment.
 	(expand_one_builtin): Add missing break.
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 352bcff..50899a7 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -2688,7 +2688,7 @@ comparison_string (enum rtx_code code, rtx op0)
   bool is_nz_p = GET_MODE (op0) == CC_NZmode;
   switch (code)
     {
-    default:  output_operand_lossage ("bad condition code");
+    default:  output_operand_lossage ("bad condition code"); return "";
     case EQ:  return "eq";
     case NE:  return "ne";
     case LT:  return is_nz_p ? "n" : "lt";

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-26 16:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-26 16:17 Fix frv port WRT fallthru Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).