From 8849d5034c5ab5c2e6f3fc17209504576e7c6dd4 Mon Sep 17 00:00:00 2001
From: Richard Sandiford <richard.sandiford@arm.com>
Date: Mon, 8 Jul 2019 06:21:11 +0000
Subject: [PATCH] Add a build config for bootstrapping at -Og

Although BOOT_CFLAGS can be used to bootstrap with -Og, having a
dedicated build config is sometimes more convenient.

2019-07-08  Richard Sandiford  <richard.sandiford@arm.com>

config/
	* bootstrap-Og.mk: New file.

gcc/
	* doc/install.texi (bootstrap-Og): Document.

From-SVN: r273193
---
 config/ChangeLog       | 4 ++++
 config/bootstrap-Og.mk | 1 +
 gcc/ChangeLog          | 4 ++++
 gcc/doc/install.texi   | 1 +
 4 files changed, 10 insertions(+)
 create mode 100644 config/bootstrap-Og.mk

diff --git a/config/ChangeLog b/config/ChangeLog
index 63f4325314f2..5a06cdeea818 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2019-07-08  Richard Sandiford  <richard.sandiford@arm.com>
+
+	* bootstrap-Og.mk: New file.
+
 2019-06-25  Kwok Cheung Yeung  <kcy@codesourcery.com>
             Andrew Stubbs  <ams@codesourcery.com>
 
diff --git a/config/bootstrap-Og.mk b/config/bootstrap-Og.mk
new file mode 100644
index 000000000000..9057afbe354d
--- /dev/null
+++ b/config/bootstrap-Og.mk
@@ -0,0 +1 @@
+BOOT_CFLAGS := -Og $(filter-out -O%, $(BOOT_CFLAGS))
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96ae53aa8b03..145b7b206c68 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2019-07-08  Richard Sandiford  <richard.sandiford@arm.com>
+
+	* doc/install.texi (bootstrap-Og): Document.
+
 2019-07-08  Richard Sandiford  <richard.sandiford@arm.com>
 
 	* config/riscv/pic.md (*local_pic_load_s<mode>)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 852aa8f6dae2..2598713c1989 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2535,6 +2535,7 @@ Removes any @option{-O}-started option from @code{BOOT_CFLAGS}, and adds
 @samp{BOOT_CFLAGS='-g -O1'}.
 
 @item @samp{bootstrap-O3}
+@itemx @samp{bootstrap-Og}
 Analogous to @code{bootstrap-O1}.
 
 @item @samp{bootstrap-lto}
-- 
GitLab