Ticket #1244 (closed todo: fixed)

Opened 5 years ago

Last modified 5 years ago

compilers/imcc/cfg.c: emit warning in propagate_need()

Reported by: jkeenan Owned by:
Priority: normal Milestone:
Component: imcc Version: 1.7.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

This ticket moves to the the Trac system an issue previously discussed in the RT system as  RT #48286.

 890 /*
 891 
 892 =item C<static void propagate_need(Basic_block *bb, const SymReg *r, int i)>
 893 
 894 Follows the uses of the given symbol through all of the basic blocks of the
 895 unit.
 896 
 897 =cut
 898 
 899 */
 900 
 901 static void
 902 propagate_need(ARGMOD(Basic_block *bb), ARGIN(const SymReg *r), int i)
 903 {
 904     ASSERT_ARGS(propagate_need)
 905     Edge        *edge;
 906     Life_range  *l;
 907     Basic_block *pred;
...
 924             if (! (l->flags & LF_def)) {
 925                 l->flags    |= LF_lv_in;
 926                 l->first_ins = pred->start;
 927                 l->last_ins  = pred->end;
 928 
 929                 /* we arrived at block 0
 930                  *
 931                  * emit a warning if -w looking at some Perl 6 examples where
 932                  * this warning is emitted, there seems always to be a code
 933                  * path where the var is not initialized, so this might even be
 934                  * correct :)
 935                  *
 936                  * RT #48286 subroutines
 937                  */
 938 #if 0
 939                 if (pred->index == 0) {
 940                     Instruction *ins = r->life_info[i]->first_ins;
 941                     int bbi = ins->bbindex;
 942                     for (; ins && ins->bbindex == bbi; ins = ins->next)
 943                         if (instruction_reads(ins, r))
 943                         if (instruction_reads(ins, r))
 944                             break;
 945                     IMCC_warning("propagate_need",
 946                             "'%s' might be used uninitialized in %s:%d\n",
 947                             r->name, function, ins->line);
 948                 }
 949 #endif
 950                 propagate_need(pred, r, i);
 951             }
 952         }
 953     }
 954 }

In the original RT, Paul Cochrane commented: "Unfortunately, I don't know what subroutines have to do with this, however the code which follows is commented out and it reports a warning if a variable (in perl6) is uninitialised when the -w flag is used. This looks like some repair is in order."

Change History

Changed 5 years ago by plobsing

  • status changed from new to closed
  • resolution set to fixed

'propagate_need' died along with the graph colouring register allocator

Note: See TracTickets for help on using tickets.