Don't allow non-stack memory writes in the prologue for nios2.
authorSandra Loosemore <sandra@codesourcery.com>
Thu, 30 Jul 2015 20:26:03 +0000 (13:26 -0700)
committerSandra Loosemore <sandra@codesourcery.com>
Thu, 30 Jul 2015 20:26:03 +0000 (13:26 -0700)
2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>

gdb/
* nios2-tdep.c (nios2_analyze_prologue): Do what the comment
already says and disallow non-stack memory writes in the prologue.

gdb/ChangeLog
gdb/nios2-tdep.c

index 120148a..b52367e 100644 (file)
@@ -1,5 +1,10 @@
 2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>
 
+       * nios2-tdep.c (nios2_analyze_prologue): Do what the comment
+       already says and disallow non-stack memory writes in the prologue.
+
+2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>
+
        * nios2-tdep.c (nios2_analyze_prologue): Update comments to
        reflect how current GCC emits stack overflow checks.  Match
        both trap and break instructions for backward compatbility.
index 1c5dcde..12056b5 100644 (file)
@@ -935,9 +935,7 @@ nios2_analyze_prologue (struct gdbarch *gdbarch, const CORE_ADDR start_pc,
          if (orig > 0
              && (value[rb].offset == 0
                  || (orig == NIOS2_EA_REGNUM && value[rb].offset == -4))
-             && ((value[ra].reg == NIOS2_SP_REGNUM
-                  && cache->reg_saved[orig].basereg != NIOS2_SP_REGNUM)
-                 || cache->reg_saved[orig].basereg == -1))
+             && value[ra].reg == NIOS2_SP_REGNUM)
            {
              if (pc < current_pc)
                {