Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1239048

wrong error messages of flow analysis for long list of parameter assignments

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.4

      Description

      The Java compiler produces wrong error messages for the correct Java
      program. The effect appears only when the number of parameters and assignments
      is more than 63 ( 2**6-1 ??? :-) ).

      > /usr/local/java/1.0/bin/javac clss021.java
      clss021.java:70: Statement not reached.
      int f(int x , int p00, int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p60, int p61) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^
      clss021.java:132: Variable p61 may not have been initialized.
         p61 += p60;
         ^
      clss021.java:134: Statement not reached.
         return p61;
         ^
      clss021.java:134: Variable p61 may not have been initialized.
         return p61;
                ^
      4 errors


      ---------------------------------clss021.java------------------------
      // Ident: @(#)clss021.java 1.1 96/01/14
      // Copyright 14 Jan 1996 Sun Microsystems, Inc. All Rights Reserved

      class clss021_a {
      int f(int x , int p00, int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p60) {
         p00 += x;
         p01 += p00;
         p02 += p01;
         p03 += p02;
         p04 += p03;
         p05 += p04;
         p06 += p05;
         p07 += p06;
         p08 += p07;
         p09 += p08;
         p10 += p09;
         p11 += p10;
         p12 += p11;
         p13 += p12;
         p14 += p13;
         p15 += p14;
         p16 += p15;
         p17 += p16;
         p18 += p17;
         p19 += p18;
         p20 += p19;
         p21 += p20;
         p22 += p21;
         p23 += p22;
         p24 += p23;
         p25 += p24;
         p26 += p25;
         p27 += p26;
         p28 += p27;
         p29 += p28;
         p30 += p29;
         p31 += p30;
         p32 += p31;
         p33 += p32;
         p34 += p33;
         p35 += p34;
         p36 += p35;
         p37 += p36;
         p38 += p37;
         p39 += p38;
         p40 += p39;
         p41 += p40;
         p42 += p41;
         p43 += p42;
         p44 += p43;
         p45 += p44;
         p46 += p45;
         p47 += p46;
         p48 += p47;
         p49 += p48;
         p50 += p49;
         p51 += p50;
         p52 += p51;
         p53 += p52;
         p54 += p53;
         p55 += p54;
         p56 += p55;
         p57 += p56;
         p58 += p57;
         p59 += p58;
         p60 += p59;
         return p60;
      }

      int f(int x , int p00, int p01, int p02, int p03, int p04, int p05, int p06, int p07, int p08, int p09, int p10, int p11, int p12, int p13, int p14, int p15, int p16, int p17, int p18, int p19, int p20, int p21, int p22, int p23, int p24, int p25, int p26, int p27, int p28, int p29, int p30, int p31, int p32, int p33, int p34, int p35, int p36, int p37, int p38, int p39, int p40, int p41, int p42, int p43, int p44, int p45, int p46, int p47, int p48, int p49, int p50, int p51, int p52, int p53, int p54, int p55, int p56, int p57, int p58, int p59, int p60, int p61) {
         p00 += x;
         p01 += p00;
         p02 += p01;
         p03 += p02;
         p04 += p03;
         p05 += p04;
         p06 += p05;
         p07 += p06;
         p08 += p07;
         p09 += p08;
         p10 += p09;
         p11 += p10;
         p12 += p11;
         p13 += p12;
         p14 += p13;
         p15 += p14;
         p16 += p15;
         p17 += p16;
         p18 += p17;
         p19 += p18;
         p20 += p19;
         p21 += p20;
         p22 += p21;
         p23 += p22;
         p24 += p23;
         p25 += p24;
         p26 += p25;
         p27 += p26;
         p28 += p27;
         p29 += p28;
         p30 += p29;
         p31 += p30;
         p32 += p31;
         p33 += p32;
         p34 += p33;
         p35 += p34;
         p36 += p35;
         p37 += p36;
         p38 += p37;
         p39 += p38;
         p40 += p39;
         p41 += p40;
         p42 += p41;
         p43 += p42;
         p44 += p43;
         p45 += p44;
         p46 += p45;
         p47 += p46;
         p48 += p47;
         p49 += p48;
         p50 += p49;
         p51 += p50;
         p52 += p51;
         p53 += p52;
         p54 += p53;
         p55 += p54;
         p56 += p55;
         p57 += p56;
         p58 += p57;
         p59 += p58;
         p60 += p59;
         p61 += p60;

         return p61;
      }

      void test60() {
            int sum, correct_sum = 60*61/2;
            sum = f(0 , 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60);
            if (sum != correct_sum) {
             System.out.println("Error: sum != correct_sum : " + sum + " != " + correct_sum);
            }
      }
      void test61() {
            int sum, correct_sum = 61*62/2;
            sum = f(0 , 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61);
            if (sum != correct_sum) {
             System.out.println("Error: sum != correct_sum : " + sum + " != " + correct_sum);
            }
      }
      }

      public class clss021 {
        public static void main(String args[]) {
         clss021_a x = new clss021_a();
         x.test60();
         x.test61();
        }
      }

          
      ---------------------------------------------------------------------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fyellinsunw Frank Yellin (Inactive)
                Reporter:
                leosunw Leo Leo (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: