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



--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-26 
14:37:48 UTC ---

I disagree.  You can't see <optimized out> for aggregate var in memory which

actually has been allocated on the stack, VTA doesn't value track those (and

can't really), there you just have a variable with description where in memory

it is and whatever is on the stack there is what you get.



As for the other testcase, that is just a testcase problem you've introduced by

removing the volatile from the asm.  Without volatile the compiler is free to

schedule the second asm before the first one (and does for e.g. -m32 -O2), but

at that point y obviously isn't initialized.  If volatile can't be used there,

you'd need something like:



@@ -2,6 +2,9 @@

 /* { dg-do run } */

 /* { dg-options "-g" } */



+#include "../nop.h"

+

+int a;

 int __attribute__((noinline))

 foo (int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7)

 {

@@ -9,9 +12,9 @@ foo (int arg1, int arg2, int arg3, int a

   int __attribute__ ((aligned(32))) y;



   y = 2;

-  asm ("" : "=m" (y) : "m" (y));

+  asm (NOP : "=m" (y), "=m" (a) : "m" (y));

   x[0] = 25;

-  asm ("" : "=m" (x[0]) : "m" (x[0]));

+  asm (NOP : "=m" (x[0]) : "m" (x[0]), "m" (a));

   return y + x[0];

 }



plus adjust line numbers in gdb-test lines.  The "" -> NOP change is desirable

in any way, as the test wants to stop on the inline asm, if the inline asm is

empty, it stops on the following insn rather than on the inline asm.

Reply via email to