The attached change works around a problem that results in wrong code on hppa1.1-*-hpux*. The wrong code causes a bootstrap error. The problem does not occur when generating PA2.0 code, or on linux because the generation of auto increment/decrement instructions is disabled. The comment in the code indicates
that this was done on PA2.0 because it is not profitable.

The real problem seems to be in reload. It appears to handle spills for auto increment/decrements insns incorrectly, sometimes generating the reload insns in the wrong order. I couldn't see any way to correct this in the PA backend
as the insns are emitted independently.

So, I decided to disable the generation of auto increment/decrement insns until after reload.

Tested on hppa2.0-hp-hpux11.11, hppa64-hp-hpux11.11 and hppa-unknown- linux-gnu. Bootstrap tested
on hppa1.1-hp-hpux11.11.  Committed to trunk and 4.8.

Dave
--
John David Anglin       dave.ang...@bell.net


2013-09-20  John David Anglin  <dang...@gcc.gnu.org>

        PR middle-end/56791
        * config/pa/pa.c (pa_option_override): Disable auto increment and
        decrement instructions until reload is completed.

Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c      (revision 202481)
+++ config/pa/pa.c      (working copy)
@@ -513,6 +513,12 @@
       write_symbols = NO_DEBUG;
     }
 
+#ifdef AUTO_INC_DEC
+  /* FIXME: Disable auto increment and decrement processing until reload
+     is completed.  See PR middle-end 56791.  */
+  flag_auto_inc_dec = reload_completed;
+#endif
+
   /* We only support the "big PIC" model now.  And we always generate PIC
      code when in 64bit mode.  */
   if (flag_pic == 1 || TARGET_64BIT)

Reply via email to