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 optimization/15248] New: Reload may generate stores to read-only memory


Under certain circumstances, the reload pass may generate stores to read-only
memory, thus producing executables that will segfault at run time.

The pattern is the following: a REG_EQUAL note in a set of a pseudo containing a
MEM/u is promoted by local-alloc to a REG_EQUIV note; during reload, the pseudo
doesn't get a hard reg so is replaced by its equivalent memory location as the
destination of the set.

This had affected the 3.3 branch (PR opt/13634, opt/13472, opt/14529) and the
3.4 branch (PR opt/15112), and was fixed by not recording MEM/u as equivalent
memory locations for pseudos altogether.

More sophisticated solutions can probably be devised so as to avoid the
unnecessary spills to the frame that are currently produced.

-- 
           Summary: Reload may generate stores to read-only memory
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ebotcazou at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: *-*-*
  GCC host triplet: *-*-*
GCC target triplet: *-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15248


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