optimization/7232: Incorrect code generate for volatiles and -O2

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Mon Jul 8 06:06:00 GMT 2002


The following reply was made to PR optimization/7232; it has been noted by GNATS.

From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
To: svlu@enea.se
Cc: gcc-gnats@gcc.gnu.org,karm@enea.se,steby@enea.se
Subject: Re: optimization/7232: Incorrect code generate for volatiles
  and -O2
Date: Mon, 08 Jul 2002 15:04:55 +0200

 At 14:33 08.07.2002, svlu@enea.se wrote:
 
 > >Number:         7232
 > >Category:       optimization
 > >Synopsis:       Incorrect code generate for volatiles and -O2
 > >Confidential:   no
 > >Severity:       critical
 > >Priority:       medium
 > >Responsible:    unassigned
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Mon Jul 08 05:36:00 PDT 2002
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Sven Lundblad / OSE Systems
 > >Release:        gcc 3.1
 > >Organization:
 > >Environment:
 >Solaris hosted cross compiler for powerpc and mips
 > >Description:
 >When the code below is compiled with gcc 3.1 and -O2, for at
 >least powerpc and mips, the second load instruction is
 >incorrect during the next pointer update (the same value is
 >reloaded instead of follow the pointer). It seams to be
 >related to the use of the volatile keyword.
 >
 >If compiled with just -O it works fine.
 >
 >This is a regression from gcc 2.95 which worked fine.
 > >How-To-Repeat:
 >Compile the gcc_bug1.c file with -S -O2 and examine the
 >output.
 
 This is what the current gcc-3_1-branch does to your code at -O2, is the 
 bug still there?
 
          .file   "test.c"
          .section        ".text"
          .align 2
          .type   force_gcc_ppc_bug,@function
 force_gcc_ppc_bug:
          lis 11,ll@ha
          li 0,4660
          la 11,ll@l(11)
          lwz 10,8(11)
          lwz 9,8(11)
          stw 0,0(10)
          mr 3,10
          lwz 0,4(9)
          li 9,0
          stw 0,8(11)
          li 0,18
          stw 9,4(10)
          stb 0,42(10)
          blr
 .Lfe1:
          .size   force_gcc_ppc_bug,.Lfe1-force_gcc_ppc_bug
          .comm   ll,12,4
          .ident  "GCC: (GNU) 3.1.1 20020704 (prerelease)"
 
 Franz.
 



More information about the Gcc-prs mailing list