rose-compiler / rose

Developed at Lawrence Livermore National Laboratory (LLNL), ROSE is an open source compiler infrastructure to build source-to-source program transformation and analysis tools for large-scale C (C89 and C98), C++ (C++98 and C++11), UPC, Fortran (77/95/2003), OpenMP, Java, Python and PHP applications.
http://rosecompiler.org
Other
596 stars 132 forks source link

Bug in Unparser (unparser.C) #55

Open forflo opened 5 years ago

forflo commented 5 years ago

Hello everyone,

Before I start with the bug description: Thank you for your work on ROSEI It has been supporting me quite well the last months :+1:

Bug description

When I recently updated to the most recent version of ROSE, my code stopped working. The reason was a change in the implementation of Roses Unparser Class.

For your reference, please refer to this reproduction package that I have assembled for you. As you can see fail.cpp and success.cpp only differ in line 20. A call to set_current_source_file is missing in fail.cpp which causes

$ fail input.c

to fail.

Cause

The perpetrating code is located in /src/backend/unparser/unparser.C:

  // DQ (8/16/2018): This should have already been set.
     ROSE_ASSERT(info.get_current_source_file() != NULL);

  // DQ (8/16/2018): And if it should have already been set, then se should not reset it here!
  // DQ (1/10/2015): Set the current source file.
     info.set_current_source_file(file);

Is there a good reason for this behaviour? IMHO, the code would retain all it's semantics when both additions from DQ (8/16/2018): were reverted to the state of 2015...

Thanks & Best regards.

matzke1 commented 5 years ago

(Comment removed; wrong issue. This issue is hereby reopened.)

forflo commented 5 years ago

Sorry, but this bug report does not regard floating point semantics at all.

Perhaps you may want to place your comment below (https://github.com/rose-compiler/rose/issues/54).