This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/13382] New: Type information for const pointer disappears during optimisation.
- From: "richard dot hutchinson at asa dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Dec 2003 13:00:19 -0000
- Subject: [Bug c/13382] New: Type information for const pointer disappears during optimisation.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compiling the source code
static const struct
{
int aMember;
} *const aPointer = 0;
int main()
{
int anInt = (aPointer == 0) ? 0 : aPointer->aMember;
return 0;
}
with the command line
gcc -o prog -O prog.c
generates the following error output:
testgcc.c: In function `main':
testgcc.c:15: error: request for member `aMember' in something not a structure
or union
This does not happen if the -O switch is omitted.
This behaviour does not occur with gcc 2.95.3 (the only other Solaris version I
have to hand).
--
Summary: Type information for const pointer disappears during
optimisation.
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: richard dot hutchinson at asa dot co dot uk
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: sparc-sun-solaris2.8
GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13382