+2019-07-29 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-cfg.c (execute_fixup_cfg): Don't delete stores to write-only
+ variables for -Og.
+
2019-07-29 Richard Sandiford <richard.sandiford@arm.com>
* doc/sourcebuild.texi (check-function-bodies): Document.
+2019-07-29 Richard Sandiford <richard.sandiford@arm.com>
+
+ * c-c++-common/guality/Og-static-wo-1.c: New test.
+ * g++.dg/guality/guality.exp: Separate the c-c++-common tests into
+ "Og" and "general" tests. Run the latter at -O0 and -Og only.
+ * gcc.dg/guality/guality.exp: Likewise.
+
2019-07-29 Richard Sandiford <richard.sandiford@arm.com>
* lib/scanasm.exp (parse_function_bodies, check_function_body)
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+#include "../../gcc.dg/nop.h"
+
+static int x = 0;
+
+int
+main (void)
+{
+ asm volatile (NOP); /* { dg-final { gdb-test . "x" "0" } } */
+ x = 1;
+ asm volatile (NOP); /* { dg-final { gdb-test . "x" "1" } } */
+ return 0;
+}
return 0;
}
"]} {
- gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "" ""
- gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/guality/*.c]] "" ""
+ set general [list]
+ set Og [list]
+ foreach file [lsort [glob $srcdir/c-c++-common/guality/*.c]] {
+ switch -glob -- [file tail $file] {
+ Og-* { lappend Og $file }
+ * { lappend general $file }
+ }
+ }
+
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "" ""
+ gcc-dg-runtest $general "" ""
+ set-torture-options \
+ [list "-O0" "-Og"] \
+ [list {}] \
+ [list "-Og -flto"]
+ gcc-dg-runtest $Og "" ""
}
if [info exists guality_gdb_name] {
return 0;
}
"]} {
- gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "" ""
- gcc-dg-runtest [lsort [glob $srcdir/c-c++-common/guality/*.c]] "" "-Wc++-compat"
+ set general [list]
+ set Og [list]
+ foreach file [lsort [glob $srcdir/c-c++-common/guality/*.c]] {
+ switch -glob -- [file tail $file] {
+ Og-* { lappend Og $file }
+ * { lappend general $file }
+ }
+ }
+
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "" ""
+ gcc-dg-runtest $general "" "-Wc++-compat"
+ set-torture-options \
+ [list "-O0" "-Og"] \
+ [list {}] \
+ [list "-Og -flto"]
+ gcc-dg-runtest $Og "" "-Wc++-compat"
}
if [info exists guality_gdb_name] {
Keep access when store has side effect, i.e. in case when source
is volatile. */
if (gimple_store_p (stmt)
- && !gimple_has_side_effects (stmt))
+ && !gimple_has_side_effects (stmt)
+ && !optimize_debug)
{
tree lhs = get_base_address (gimple_get_lhs (stmt));