vla-1.c (main): Use result of f1 to avoid optimizing it away if promoted to const.
authorRichard Guenther <rguenther@suse.de>
Wed, 16 Mar 2011 16:51:35 +0000 (16:51 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 16 Mar 2011 16:51:35 +0000 (16:51 +0000)
2011-03-16  Richard Guenther  <rguenther@suse.de>

* gcc.dg/guality/vla-1.c (main): Use result of f1 to avoid
optimizing it away if promoted to const.

From-SVN: r171050

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/guality/vla-1.c

index a9db0b7eb9d01ec409c0db7e92ba4be1c3881cea..c345d412ced3426317a7143a90d3114303e80a2a 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-16  Richard Guenther  <rguenther@suse.de>
+
+       * gcc.dg/guality/vla-1.c (main): Use result of f1 to avoid
+       optimizing it away if promoted to const.
+
 2011-03-16  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/48149
index 2db1c29caa6b33a110c0fa82d1f2c9075bdc71bb..651465428acabe6c283b42a20793fbfffebd86ba 100644 (file)
@@ -28,9 +28,10 @@ f2 (int i)
 int
 main ()
 {
+  volatile int j;
   int i = 5;
   asm volatile ("" : "=r" (i) : "0" (i));
-  f1 (i);
+  j = f1 (i);
   f2 (i);
   return 0;
 }