This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/26371] New: dead variable attributes
- From: "acahalan at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2006 21:20:42 -0000
- Subject: [Bug c/26371] New: dead variable attributes
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
A large project may have a configurable build to allow optional features. Fully
eliminating a feature may require #ifdef all over the place, making the code
ugly and unmaintainable. Example: you want an OS kernel to support an embedded
systems build that lacks the normal user ID handling.
If members of a struct could be marked as being useless, then the compiler's
dead code elimination could often take the place of adding #ifdef all over the
place.
Useful attributes would be something like this:
a. readas(x) When used as an rvalue, you get x.
b. nomem(x) Does not take up space. Address reads as x.
c. writeas(x) When used as an lvalue, store x.
d. nowrite Don't bother storing to this location.
(you'd never use more than one of the last three)
--
Summary: dead variable attributes
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: acahalan at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26371