Skip to content

Commit 9c74b64

Browse files
committed
[QuadFP] Add missing FLANG_FALLTHROUGH; NFC
Fix quad-precision FP code which had caused -Wimplicit-fallthrough warnings.
1 parent ebd1143 commit 9c74b64

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

tools/flang1/flang1exe/ast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8868,11 +8868,13 @@ cngcon(INT oldval, int oldtyp, int newtyp)
88688868
switch (from) {
88698869
case TY_CMPLX:
88708870
oldval = CONVAL1G(oldval);
8871+
FLANG_FALLTHROUGH;
88718872
case TY_REAL:
88728873
xftoq(oldval, num);
88738874
break;
88748875
case TY_DCMPLX:
88758876
oldval = CONVAL1G(oldval);
8877+
FLANG_FALLTHROUGH;
88768878
case TY_DBLE:
88778879
num1[0] = CONVAL1G(oldval);
88788880
num1[1] = CONVAL2G(oldval);

tools/flang1/flang1exe/lowerexp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,7 @@ static int conv_quad_ilm(int ast, int ilm, int dtype)
10641064
case TY_SINT:
10651065
case TY_SLOG:
10661066
ilm = conv_int_ilm(ast, ilm, dtype);
1067+
FLANG_FALLTHROUGH;
10671068
case TY_LOG:
10681069
case TY_INT:
10691070
ilm = plower("oi", "QFLOAT", ilm);

tools/flang1/flang1exe/scan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4461,9 +4461,9 @@ alpha(void)
44614461
if (idlen == 8 && *cp == '(' && strncmp(id, "operator", 8) == 0) {
44624462
scmode = SCM_OPERATOR;
44634463
}
4464-
/* fall through */
4465-
fall_thru_scm_ident:
4464+
FLANG_FALLTHROUGH;
44664465
case SCM_IDENT: /* look only for identifiers */
4466+
fall_thru_scm_ident:
44674467
if (bind_state == B_RPAREN_FOUND) {
44684468
if ((strncmp(id, "result", 6) == 0))
44694469
bind_state = B_RESULT_FOUND;

tools/flang1/flang1exe/semutil.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -485,15 +485,14 @@ cngtyp2(SST *old, DTYPE newtyp, bool allowPolyExpr)
485485
case TY_DBLE:
486486
break;
487487
#ifdef TARGET_SUPPORTS_QUADFP
488-
/* fall thru ... */
489488
case TY_QUAD:
490489
break;
491490
#endif
492491
case TY_CHAR:
493492
case TY_NCHAR:
494493
case TY_STRUCT:
495494
case TY_DERIVED:
496-
/* fall thru ... */
495+
FLANG_FALLTHROUGH;
497496
default:
498497
goto type_error;
499498
}
@@ -524,15 +523,14 @@ cngtyp2(SST *old, DTYPE newtyp, bool allowPolyExpr)
524523
case TY_DBLE:
525524
break;
526525
#ifdef TARGET_SUPPORTS_QUADFP
527-
/* fall thru ... */
528526
case TY_QUAD:
529527
break;
530528
#endif
531529
case TY_CHAR:
532530
case TY_NCHAR:
533531
case TY_STRUCT:
534532
case TY_DERIVED:
535-
/* fall thru ... */
533+
FLANG_FALLTHROUGH;
536534
default:
537535
goto type_error;
538536
}
@@ -559,15 +557,14 @@ cngtyp2(SST *old, DTYPE newtyp, bool allowPolyExpr)
559557
case TY_DBLE:
560558
break;
561559
#ifdef TARGET_SUPPORTS_QUADFP
562-
/* fall thru ... */
563560
case TY_QUAD:
564561
break;
565562
#endif
566563
case TY_CHAR:
567564
case TY_NCHAR:
568565
case TY_STRUCT:
569566
case TY_DERIVED:
570-
/* fall thru ... */
567+
FLANG_FALLTHROUGH;
571568
default:
572569
goto type_error;
573570
}
@@ -595,15 +592,14 @@ cngtyp2(SST *old, DTYPE newtyp, bool allowPolyExpr)
595592
case TY_REAL:
596593
break;
597594
#ifdef TARGET_SUPPORTS_QUADFP
598-
/* fall thru to */
599595
case TY_QUAD:
600596
break;
601597
#endif
602598
case TY_CHAR:
603599
case TY_NCHAR:
604600
case TY_STRUCT:
605601
case TY_DERIVED:
606-
/* fall thru ... */
602+
FLANG_FALLTHROUGH;
607603
default:
608604
goto type_error;
609605
}
@@ -618,27 +614,27 @@ cngtyp2(SST *old, DTYPE newtyp, bool allowPolyExpr)
618614
case TY_SINT:
619615
cngtyp(old, DT_INT);
620616
SST_DTYPEP(old, DT_INT);
621-
/* fall thru ... */
617+
FLANG_FALLTHROUGH;
622618
case TY_LOG:
623619
case TY_INT:
624620
case TY_LOG8:
625621
case TY_INT8:
626622
break;
627623
case TY_DCMPLX:
628624
mkexpr1(old);
629-
/* fall thru to */
625+
FLANG_FALLTHROUGH;
630626
case TY_DBLE:
631627
break;
632628
case TY_CMPLX:
633629
mkexpr1(old);
634-
/* fall thru to */
630+
FLANG_FALLTHROUGH;
635631
case TY_REAL:
636632
break;
637633
case TY_CHAR:
638634
case TY_NCHAR:
639635
case TY_STRUCT:
640636
case TY_DERIVED:
641-
/* fall thru ... */
637+
FLANG_FALLTHROUGH;
642638
default:
643639
goto type_error;
644640
}
@@ -681,7 +677,7 @@ cngtyp2(SST *old, DTYPE newtyp, bool allowPolyExpr)
681677
case TY_NCHAR:
682678
case TY_STRUCT:
683679
case TY_DERIVED:
684-
/* fall thru ... */
680+
FLANG_FALLTHROUGH;
685681

686682
default:
687683
goto type_error;
@@ -723,7 +719,7 @@ cngtyp2(SST *old, DTYPE newtyp, bool allowPolyExpr)
723719
case TY_NCHAR:
724720
case TY_STRUCT:
725721
case TY_DERIVED:
726-
/* fall thru ... */
722+
FLANG_FALLTHROUGH;
727723

728724
default:
729725
goto type_error;
@@ -1160,7 +1156,7 @@ mkexpr1(SST *stkptr)
11601156
if (sptr == intast_sym[I_N_PES])
11611157
return ref_pd(stkptr, ITEM_END);
11621158
#endif
1163-
/* fall thru */
1159+
FLANG_FALLTHROUGH;
11641160
case ST_INTRIN:
11651161
case ST_GENERIC:
11661162
if (sem.dinit_data) {
@@ -1482,8 +1478,8 @@ mklvalue(SST *stkptr, int stmt_type)
14821478
else
14831479
setimplicit(sptr);
14841480
}
1485-
// fall through
14861481
FLANG_FALLTHROUGH;
1482+
14871483
case ST_PROC: /* Function/intrinsic reference used as an lvalue */
14881484
if (stmt_type == 3) {
14891485
SST_ASTP(stkptr, mk_id(sptr));

tools/flang2/flang2exe/semutil0.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,11 +726,13 @@ cngcon(INT oldval, DTYPE oldtyp, DTYPE newtyp)
726726
switch (from) {
727727
case TY_CMPLX:
728728
oldval = CONVAL1G(oldval);
729+
FLANG_FALLTHROUGH;
729730
case TY_REAL:
730731
xftoq(oldval, num);
731732
break;
732733
case TY_DCMPLX:
733734
oldval = CONVAL1G(oldval);
735+
FLANG_FALLTHROUGH;
734736
case TY_DBLE:
735737
num1[0] = CONVAL1G(oldval);
736738
num1[1] = CONVAL2G(oldval);

0 commit comments

Comments
 (0)