Menu

#2587 regression test for.c misbehaves

closed-fixed
None
Front-end
5
2017-03-14
2017-02-20
No

When I run the regression tests for.c generates a warning:
warning 85: in function testFor unreferenced local variable : 'i'
It is unclear which i that is. But when I look at the generated asm I see that the for loop variable i is assigned 43 after the call to g42(). And when I change the loop to count 2 iterations (and adapt the g42 assertion accordingly), I see it fails because it ran the loop only once.

Discussion

  • Erik Petrich

    Erik Petrich - 2017-03-14
    • status: open --> closed-fixed
    • assigned_to: Erik Petrich
    • Category: other --> Front-end
     
  • Erik Petrich

    Erik Petrich - 2017-03-14

    Need to process the declaration before the for loop body so that the variable binds with the proper declaration.
    Fixed in [r9853]

     

    Last edit: Maarten Brock 2017-05-14

Log in to post a comment.