NULL_TREE as RETURN_EXPR, but the "return" statement has an argument ...

Matthieu Moy Matthieu.Moy@imag.fr
Fri Oct 10 15:06:00 GMT 2003


Hi,

I have a strange behavior of GCC : The source code is the following :

  tlm_status write(ADDRESS_TYPE addr_in,
                   DATA_TYPE * source,
                   int number,
                   int port_id ,
                   basic_metadata& metadata) {
    m_value = *source;
    tlm_status response;
    response.set_ok();
    return response;
  }

and the  tree generated by GCC  has an empty RETURN_EXPR  for the last
line. 

If I change it to 

  tlm_status write(ADDRESS_TYPE addr_in,
                   DATA_TYPE * source,
                   int number,
                   int port_id ,
                   basic_metadata& metadata) {
    m_value = *source;
    tlm_status response;
    response.set_ok();
    return (cout << "hello", response);
  }

Then, I get the tree for the expression (cout << "hello", response). 

Do you have an  explanation for this ? If so, it  would be nice to add
it to the GCC internals manual.

Thanks for your help. 

-- 
Matthieu



More information about the Gcc mailing list