https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98653

            Bug ID: 98653
           Summary: unused code found in function analyze_functions:1194
           Product: gcc
           Version: new-ra
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ashimida at linux dot alibaba.com
  Target Milestone: ---

In function "analyze_functions"[1]:1194, the value of "changed" should always
be "true" and the fprintf will output nothing. codes in line [1194,1195] should
be deleted.



1173   while (changed)
1174     {
1175       changed = false;
1176       process_function_and_variable_attributes (first_analyzed,
1177                                                 first_analyzed_var);
1178 
1179       /* First identify the trivially needed symbols.  */
1180       for (node = symtab->first_symbol ();
1181            node != first_analyzed
1182            && node != first_analyzed_var; node = node->next)
1183         {
1184           /* Convert COMDAT group designators to IDENTIFIER_NODEs.  */
1185           node->get_comdat_group_id ();
1186           if (node->needed_p ())
1187             {
1188               enqueue_node (node);
1189               if (!changed && symtab->dump_file)
1190                 fprintf (symtab->dump_file, "Trivially needed symbols:");
1191               changed = true;
1192               if (symtab->dump_file)
1193                 fprintf (symtab->dump_file, " %s", node->dump_asm_name
());
1194               if (!changed && symtab->dump_file)
1195                 fprintf (symtab->dump_file, "\n");
1196             }
1197           if (node == first_analyzed
1198               || node == first_analyzed_var)
1199             break;
1200         }

[1]:https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/cgraphunit.c;h=cf64e56ab951a0a757e507f59c236523b003a6be;hb=HEAD
  • [Bug other/98653] New: unus... ashimida at linux dot alibaba.com via Gcc-bugs

Reply via email to