public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6730] rs6000: Fix bootstrap
@ 2022-01-19 11:25 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-01-19 11:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7f3915b83ed37516a2ff84eb3a6a6e37d3fc9a15

commit r12-6730-g7f3915b83ed37516a2ff84eb3a6a6e37d3fc9a15
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jan 19 12:22:02 2022 +0100

    rs6000: Fix bootstrap
    
    > On 18/01/2022 22:42, Segher Boessenkool wrote:
    > > > +    default:
    > > > +      break;
    > > Please don't do that.  You can do
    > >
    > >    default:
    > >      break;
    > >      break;
    > >      /* And just to make sure:  */
    > >      break;
    > >      break;
    > >
    > > and it will do exactly the same as not having a default at all.  Not
    > > having such useless code is by far the most readable, so please don't
    > > include a default case at all.
    >
    > I removed the default case. I hope this is what you wanted.
    
    Unfortunately the removal of default: break; breaks bootstrap:
    ../../gcc/config/rs6000/rs6000.cc: In function ‘const char* rs6000_machine_from_flags()’:
    ../../gcc/config/rs6000/rs6000.cc:5940:10: error: enumeration value ‘PROCESSOR_PPC601’ not handled in switch [-Werror=switch]
     5940 |   switch (rs6000_cpu)
          |          ^
    ../../gcc/config/rs6000/rs6000.cc:5940:10: error: enumeration value ‘PROCESSOR_PPC603’ not handled in switch [-Werror=switch]
    ...
    default: break; is needed to tell the -Wswitch warning that it is intentional
    that not all enumerators are handled in the switch.
    
    2022-01-19  Jakub Jelinek  <jakub@redhat.com>
    
            * config/rs6000/rs6000.cc (rs6000_machine_from_flags): Add default:.

Diff:
---
 gcc/config/rs6000/rs6000.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 2a338a222c1..d37775ece84 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -5958,6 +5958,9 @@ rs6000_machine_from_flags (void)
 
     case PROCESSOR_PPCE6500:
       return "e6500";
+
+    default:
+      break;
     }
 
   HOST_WIDE_INT flags = rs6000_isa_flags;


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

only message in thread, other threads:[~2022-01-19 11:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 11:25 [gcc r12-6730] rs6000: Fix bootstrap Jakub Jelinek

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).