------- Comment #2 from jakub at gcc dot gnu dot org  2010-07-23 07:42 -------
This isn't a mere debug info quality regression, a movl $2, (%esp) is now
optimized away, eventhough it is needed by asm volatile following it.

Here is a testcase that at -O1 -m32 now fails at runtime, while it worked well
before:

/* PR debug/36728 */
/* { dg-do run } */
/* { dg-options "-O1" } */

int __attribute__((noinline))
foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)
{
  char x[30];
  int __attribute__ ((aligned(32))) y;

  y = 2;
  asm volatile ("cmpl $2, %0; je 1f; hlt; 1:" : "=m" (y) : "m" (y));
  x[0] = 25;
  asm volatile ("" : "=m" (x[0]) : "m" (x[0]));
  return y;
}

int
main ()
{
  int l = 0;
  asm volatile ("" : "=r" (l) : "0" (l));
  foo (l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, l + 30);
  return 0;
}

The diff is:
@@ -7,7 +7,6 @@ foo:
        movl    %esp, %ebp
        andl    $-32, %esp
        subl    $64, %esp
-       movl    $2, (%esp)
 #APP
 # 12 "PP.c" 1
        cmpl $2, (%esp); je 1f; hlt; 1:


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-23 07:42:27
               date|                            |


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

Reply via email to