This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/13382] New: Type information for const pointer disappears during optimisation.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]