1 /* PR tree-optimization/44547 - -Wuninitialized reports false warning 2 in nested switch statements 3 { dg-do compile } 4 { dg-options "-O1 -Wall" } */ 5 test_O1(int argc)6__attribute__ ((noipa)) int test_O1 (int argc) 7 { 8 switch( argc ) 9 { 10 case 1: 11 case 2: 12 case 4: 13 { 14 int n; 15 switch( argc ) 16 { 17 case 1: 18 case 2: 19 case 4: 20 n = argc; 21 break; 22 } 23 24 return n; 25 26 break; 27 } 28 } 29 30 return 0; 31 } 32 33 34 #pragma GCC optimize ("2") 35 test_O2(int argc)36__attribute__ ((noipa)) int test_O2 (int argc) 37 { 38 switch( argc ) 39 { 40 case 1: 41 case 2: 42 case 4: 43 { 44 int n; 45 switch( argc ) 46 { 47 case 1: 48 case 2: 49 case 4: 50 n = argc; 51 break; 52 } 53 54 return n; 55 56 break; 57 } 58 } 59 60 return 0; 61 } 62