This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Storage for uninitialized objects (PR 24626)
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 14 Jan 2006 23:17:11 -0500 (EST)
- Subject: Storage for uninitialized objects (PR 24626)
I have a question about storage for uninitialized objects.
I made the mistake of looking at the code being generated for
testcase #2 in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24626.
I noticed that reload used the same register r3 for the variables
"call_result" and "node" after the call to after_node_func ().
This appears to occur because "node" is an uninitialized variable.
It seems to me that automatic variables with similar storage
duration should be allocated different storage. This would ensure
that the same value of "node" is passed in the calls to after_node_func
and T. With the current code, different values might be passed, and T
could detect the difference in values in a way that doesn't invoke
undefined behavior.
Am I wrong about this? The main reason I'm concerned about this
is that there have been quite a few optimization issues in GCC 4.0
that have been difficult to debug on the PA-RISC port.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)