Prevent segfault with -bprofilegenerate=true for empty input files.
authorManuel Mohr <manuel.mohr@kit.edu>
Wed, 7 Dec 2011 16:30:29 +0000 (17:30 +0100)
committerManuel Mohr <manuel.mohr@kit.edu>
Wed, 7 Dec 2011 16:48:45 +0000 (17:48 +0100)
ir/be/bemain.c

index cd01bca..45917af 100644 (file)
@@ -557,7 +557,7 @@ static void be_main_loop(FILE *file_handle, const char *cup_name)
                                prof_filename);
                }
        }
-       if (be_options.opt_profile_generate) {
+       if (num_birgs > 0 && be_options.opt_profile_generate) {
                ir_graph *prof_init_irg
                        = ir_profile_instrument(prof_filename);
                initialize_birg(&birgs[num_birgs], prof_init_irg, &env);