Re: [OE-core] [PATCH] gcc: backport patch to fix ICE in MIPS64 target in G++

2018-03-15 Thread Mark Hatle
On 3/15/18 11:36 AM, Khem Raj wrote:
> On Thu, Mar 15, 2018 at 9:45 AM, Mark Hatle  wrote:
>> Backport a patch to fix an ICE when compiling for MIPS64.
>>
> 
> has it been tested with gcc tests and submitting upstream for a potential
> backport into gcc-7-branch ?

Yes, it resolves some issues with gcc tests.

I found a reference when I submitted this last time (a month or so ago) that it
has been suggested for a backport and nothing happened.. but I don't remember
where it was.

--Mark

>> Signed-off-by: Mark Hatle 
>> ---
>>  meta/recipes-devtools/gcc/gcc-7.3.inc  |   1 +
>>  .../gcc-7.3/0001-PR-rtl-optimization-83030.patch   | 272 
>> +
>>  2 files changed, 273 insertions(+)
>>  create mode 100644 
>> meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
>>
>> diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc 
>> b/meta/recipes-devtools/gcc/gcc-7.3.inc
>> index d56d2c5..b0cba27 100644
>> --- a/meta/recipes-devtools/gcc/gcc-7.3.inc
>> +++ b/meta/recipes-devtools/gcc/gcc-7.3.inc
>> @@ -78,6 +78,7 @@ SRC_URI = "\
>>  "
>>  BACKPORTS = "\
>> file://0001-Fix-internal-compiler-error-in-testcase.patch \
>> +   file://0001-PR-rtl-optimization-83030.patch \
>>  "
>>
>>  SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2"
>> diff --git 
>> a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch 
>> b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
>> new file mode 100644
>> index 000..71f7988
>> --- /dev/null
>> +++ b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
>> @@ -0,0 +1,272 @@
>> +From f5c4a9440f15ccf6775659910a2014a5494ee86e Mon Sep 17 00:00:00 2001
>> +From: ebotcazou 
>> +Date: Wed, 22 Nov 2017 21:43:22 +
>> +Subject: [PATCH]   PR rtl-optimization/83030   * doc/rtl.texi (Flags
>> + in an RTL Expression): Alphabetize, add entry for CROSSING_JUMP_P 
>> and
>> + mention usage of 'jump' for JUMP_INSNs.   (Insns): Delete entry for
>> + REG_CROSSING_JUMP in register notes.  * bb-reorder.c
>> + (update_crossing_jump_flags): Do not test whether the 
>> CROSSING_JUMP_P flag
>> + is already set before setting it. * cfgrtl.c 
>> (fixup_partition_crossing):
>> + Likewise. * reorg.c (relax_delay_slots): Do not consider a
>> + CROSSING_JUMP_P insn  as useless.
>> +
>> +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255083 
>> 138bc75d-0d04-0410-961f-82ee72b054a4
>> +
>> +Upstream-Status: Backport
>> +
>> +This patch removes changes to Changelog from the original upstream patch.
>> +This will help us avoid conflicts.
>> +
>> +Original backport to GCC 7.x by Amruta Pawar 
>> +
>> +Signed-off-by: Mark Hatle 
>> +
>> +---
>> + gcc/bb-reorder.c |   5 +--
>> + gcc/cfgrtl.c |   3 +-
>> + gcc/doc/rtl.texi | 129 
>> ---
>> + gcc/reorg.c  |   7 +--
>> + 5 files changed, 84 insertions(+), 72 deletions(-)
>> +
>> +diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
>> +index 55e6dc6..794283c 100644
>> +--- a/gcc/bb-reorder.c
>>  b/gcc/bb-reorder.c
>> +@@ -2236,10 +2236,7 @@ update_crossing_jump_flags (void)
>> + FOR_EACH_EDGE (e, ei, bb->succs)
>> +   if (e->flags & EDGE_CROSSING)
>> +   {
>> +-if (JUMP_P (BB_END (bb))
>> +-/* Some flags were added during fix_up_fall_thru_edges, via
>> +-   force_nonfallthru_and_redirect.  */
>> +-&& !CROSSING_JUMP_P (BB_END (bb)))
>> ++if (JUMP_P (BB_END (bb)))
>> +   CROSSING_JUMP_P (BB_END (bb)) = 1;
>> + break;
>> +   }
>> +diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
>> +index d6e5ac0..a2ad075 100644
>> +--- a/gcc/cfgrtl.c
>>  b/gcc/cfgrtl.c
>> +@@ -1334,8 +1334,7 @@ fixup_partition_crossing (edge e)
>> +   if (BB_PARTITION (e->src) != BB_PARTITION (e->dest))
>> + {
>> +   e->flags |= EDGE_CROSSING;
>> +-  if (JUMP_P (BB_END (e->src))
>> +-&& !CROSSING_JUMP_P (BB_END (e->src)))
>> ++  if (JUMP_P (BB_END (e->src)))
>> +   CROSSING_JUMP_P (BB_END (e->src)) = 1;
>> + }
>> +   else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
>> +diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
>> +index 21524f5..a58eedc 100644
>> +--- a/gcc/doc/rtl.texi
>>  b/gcc/doc/rtl.texi
>> +@@ -565,6 +565,16 @@ that are used in certain types of expression.  Most 
>> often they
>> + are accessed with the following macros, which expand into lvalues.
>> +
>> + @table @code
>> ++@findex CROSSING_JUMP_P
>> ++@cindex @code{jump_insn} and @samp{/j}
>> ++@item CROSSING_JUMP_P (@var{x})
>> ++Nonzero in a @code{jump_insn} if it crosses between hot and cold sections,
>> ++which could potentially be very far apart in the executable.  The presence
>> ++of this flag indicates to other optimizations that this branching 
>> instruction
>> ++should not be ``collapsed'' into a simpler branching construct.  It is used
>> ++when the optimization to partition basic blocks into h

Re: [OE-core] [PATCH] gcc: backport patch to fix ICE in MIPS64 target in G++

2018-03-15 Thread Khem Raj
On Thu, Mar 15, 2018 at 9:45 AM, Mark Hatle  wrote:
> Backport a patch to fix an ICE when compiling for MIPS64.
>

has it been tested with gcc tests and submitting upstream for a potential
backport into gcc-7-branch ?

> Signed-off-by: Mark Hatle 
> ---
>  meta/recipes-devtools/gcc/gcc-7.3.inc  |   1 +
>  .../gcc-7.3/0001-PR-rtl-optimization-83030.patch   | 272 
> +
>  2 files changed, 273 insertions(+)
>  create mode 100644 
> meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc 
> b/meta/recipes-devtools/gcc/gcc-7.3.inc
> index d56d2c5..b0cba27 100644
> --- a/meta/recipes-devtools/gcc/gcc-7.3.inc
> +++ b/meta/recipes-devtools/gcc/gcc-7.3.inc
> @@ -78,6 +78,7 @@ SRC_URI = "\
>  "
>  BACKPORTS = "\
> file://0001-Fix-internal-compiler-error-in-testcase.patch \
> +   file://0001-PR-rtl-optimization-83030.patch \
>  "
>
>  SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2"
> diff --git 
> a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch 
> b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
> new file mode 100644
> index 000..71f7988
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
> @@ -0,0 +1,272 @@
> +From f5c4a9440f15ccf6775659910a2014a5494ee86e Mon Sep 17 00:00:00 2001
> +From: ebotcazou 
> +Date: Wed, 22 Nov 2017 21:43:22 +
> +Subject: [PATCH]   PR rtl-optimization/83030   * doc/rtl.texi (Flags
> + in an RTL Expression): Alphabetize, add entry for CROSSING_JUMP_P 
> and
> + mention usage of 'jump' for JUMP_INSNs.   (Insns): Delete entry for
> + REG_CROSSING_JUMP in register notes.  * bb-reorder.c
> + (update_crossing_jump_flags): Do not test whether the 
> CROSSING_JUMP_P flag
> + is already set before setting it. * cfgrtl.c (fixup_partition_crossing):
> + Likewise. * reorg.c (relax_delay_slots): Do not consider a
> + CROSSING_JUMP_P insn  as useless.
> +
> +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255083 
> 138bc75d-0d04-0410-961f-82ee72b054a4
> +
> +Upstream-Status: Backport
> +
> +This patch removes changes to Changelog from the original upstream patch.
> +This will help us avoid conflicts.
> +
> +Original backport to GCC 7.x by Amruta Pawar 
> +
> +Signed-off-by: Mark Hatle 
> +
> +---
> + gcc/bb-reorder.c |   5 +--
> + gcc/cfgrtl.c |   3 +-
> + gcc/doc/rtl.texi | 129 
> ---
> + gcc/reorg.c  |   7 +--
> + 5 files changed, 84 insertions(+), 72 deletions(-)
> +
> +diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
> +index 55e6dc6..794283c 100644
> +--- a/gcc/bb-reorder.c
>  b/gcc/bb-reorder.c
> +@@ -2236,10 +2236,7 @@ update_crossing_jump_flags (void)
> + FOR_EACH_EDGE (e, ei, bb->succs)
> +   if (e->flags & EDGE_CROSSING)
> +   {
> +-if (JUMP_P (BB_END (bb))
> +-/* Some flags were added during fix_up_fall_thru_edges, via
> +-   force_nonfallthru_and_redirect.  */
> +-&& !CROSSING_JUMP_P (BB_END (bb)))
> ++if (JUMP_P (BB_END (bb)))
> +   CROSSING_JUMP_P (BB_END (bb)) = 1;
> + break;
> +   }
> +diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
> +index d6e5ac0..a2ad075 100644
> +--- a/gcc/cfgrtl.c
>  b/gcc/cfgrtl.c
> +@@ -1334,8 +1334,7 @@ fixup_partition_crossing (edge e)
> +   if (BB_PARTITION (e->src) != BB_PARTITION (e->dest))
> + {
> +   e->flags |= EDGE_CROSSING;
> +-  if (JUMP_P (BB_END (e->src))
> +-&& !CROSSING_JUMP_P (BB_END (e->src)))
> ++  if (JUMP_P (BB_END (e->src)))
> +   CROSSING_JUMP_P (BB_END (e->src)) = 1;
> + }
> +   else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
> +diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
> +index 21524f5..a58eedc 100644
> +--- a/gcc/doc/rtl.texi
>  b/gcc/doc/rtl.texi
> +@@ -565,6 +565,16 @@ that are used in certain types of expression.  Most 
> often they
> + are accessed with the following macros, which expand into lvalues.
> +
> + @table @code
> ++@findex CROSSING_JUMP_P
> ++@cindex @code{jump_insn} and @samp{/j}
> ++@item CROSSING_JUMP_P (@var{x})
> ++Nonzero in a @code{jump_insn} if it crosses between hot and cold sections,
> ++which could potentially be very far apart in the executable.  The presence
> ++of this flag indicates to other optimizations that this branching 
> instruction
> ++should not be ``collapsed'' into a simpler branching construct.  It is used
> ++when the optimization to partition basic blocks into hot and cold sections
> ++is turned on.
> ++
> + @findex CONSTANT_POOL_ADDRESS_P
> + @cindex @code{symbol_ref} and @samp{/u}
> + @cindex @code{unchanging}, in @code{symbol_ref}
> +@@ -577,37 +587,6 @@ In either case GCC assumes these addresses can be 
> addressed directly,
> + perhaps with the help of base registers.
> + Stored in the @code{unchanging} field and printed as @samp{/u}.
> +

[OE-core] [PATCH] gcc: backport patch to fix ICE in MIPS64 target in G++

2018-03-15 Thread Mark Hatle
Backport a patch to fix an ICE when compiling for MIPS64.

Signed-off-by: Mark Hatle 
---
 meta/recipes-devtools/gcc/gcc-7.3.inc  |   1 +
 .../gcc-7.3/0001-PR-rtl-optimization-83030.patch   | 272 +
 2 files changed, 273 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch

diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc 
b/meta/recipes-devtools/gcc/gcc-7.3.inc
index d56d2c5..b0cba27 100644
--- a/meta/recipes-devtools/gcc/gcc-7.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-7.3.inc
@@ -78,6 +78,7 @@ SRC_URI = "\
 "
 BACKPORTS = "\
file://0001-Fix-internal-compiler-error-in-testcase.patch \
+   file://0001-PR-rtl-optimization-83030.patch \
 "
 
 SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2"
diff --git 
a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch 
b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
new file mode 100644
index 000..71f7988
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
@@ -0,0 +1,272 @@
+From f5c4a9440f15ccf6775659910a2014a5494ee86e Mon Sep 17 00:00:00 2001
+From: ebotcazou 
+Date: Wed, 22 Nov 2017 21:43:22 +
+Subject: [PATCH]   PR rtl-optimization/83030   * doc/rtl.texi (Flags
+ in an RTL Expression): Alphabetize, add entry for CROSSING_JUMP_P and
+ mention usage of 'jump' for JUMP_INSNs.   (Insns): Delete entry for
+ REG_CROSSING_JUMP in register notes.  * bb-reorder.c
+ (update_crossing_jump_flags): Do not test whether the CROSSING_JUMP_P 
flag
+ is already set before setting it. * cfgrtl.c (fixup_partition_crossing):
+ Likewise. * reorg.c (relax_delay_slots): Do not consider a
+ CROSSING_JUMP_P insn  as useless.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255083 
138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+
+This patch removes changes to Changelog from the original upstream patch.
+This will help us avoid conflicts.
+
+Original backport to GCC 7.x by Amruta Pawar 
+
+Signed-off-by: Mark Hatle 
+
+---
+ gcc/bb-reorder.c |   5 +--
+ gcc/cfgrtl.c |   3 +-
+ gcc/doc/rtl.texi | 129 ---
+ gcc/reorg.c  |   7 +--
+ 5 files changed, 84 insertions(+), 72 deletions(-)
+
+diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
+index 55e6dc6..794283c 100644
+--- a/gcc/bb-reorder.c
 b/gcc/bb-reorder.c
+@@ -2236,10 +2236,7 @@ update_crossing_jump_flags (void)
+ FOR_EACH_EDGE (e, ei, bb->succs)
+   if (e->flags & EDGE_CROSSING)
+   {
+-if (JUMP_P (BB_END (bb))
+-/* Some flags were added during fix_up_fall_thru_edges, via
+-   force_nonfallthru_and_redirect.  */
+-&& !CROSSING_JUMP_P (BB_END (bb)))
++if (JUMP_P (BB_END (bb)))
+   CROSSING_JUMP_P (BB_END (bb)) = 1;
+ break;
+   }
+diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
+index d6e5ac0..a2ad075 100644
+--- a/gcc/cfgrtl.c
 b/gcc/cfgrtl.c
+@@ -1334,8 +1334,7 @@ fixup_partition_crossing (edge e)
+   if (BB_PARTITION (e->src) != BB_PARTITION (e->dest))
+ {
+   e->flags |= EDGE_CROSSING;
+-  if (JUMP_P (BB_END (e->src))
+-&& !CROSSING_JUMP_P (BB_END (e->src)))
++  if (JUMP_P (BB_END (e->src)))
+   CROSSING_JUMP_P (BB_END (e->src)) = 1;
+ }
+   else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
+diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
+index 21524f5..a58eedc 100644
+--- a/gcc/doc/rtl.texi
 b/gcc/doc/rtl.texi
+@@ -565,6 +565,16 @@ that are used in certain types of expression.  Most often 
they
+ are accessed with the following macros, which expand into lvalues.
+ 
+ @table @code
++@findex CROSSING_JUMP_P
++@cindex @code{jump_insn} and @samp{/j}
++@item CROSSING_JUMP_P (@var{x})
++Nonzero in a @code{jump_insn} if it crosses between hot and cold sections,
++which could potentially be very far apart in the executable.  The presence
++of this flag indicates to other optimizations that this branching instruction
++should not be ``collapsed'' into a simpler branching construct.  It is used
++when the optimization to partition basic blocks into hot and cold sections
++is turned on.
++
+ @findex CONSTANT_POOL_ADDRESS_P
+ @cindex @code{symbol_ref} and @samp{/u}
+ @cindex @code{unchanging}, in @code{symbol_ref}
+@@ -577,37 +587,6 @@ In either case GCC assumes these addresses can be 
addressed directly,
+ perhaps with the help of base registers.
+ Stored in the @code{unchanging} field and printed as @samp{/u}.
+ 
+-@findex RTL_CONST_CALL_P
+-@cindex @code{call_insn} and @samp{/u}
+-@cindex @code{unchanging}, in @code{call_insn}
+-@item RTL_CONST_CALL_P (@var{x})
+-In a @code{call_insn} indicates that the insn represents a call to a
+-const function.  Stored in the @code{unchanging} field and printed as
+-@samp{/u}.
+-
+-@findex RTL_PURE_CALL_P
+-@cindex @code{call_insn} and @samp{/i}
+-@cindex @code{return_va

Re: [OE-core] [PATCH] gcc: backport patch to fix ICE in MIPS64 target in G++

2018-02-09 Thread Khem Raj
On Fri, Feb 9, 2018 at 11:34 AM, Mark Hatle  wrote:
> Backport a patch to fix an ICE when compiling for MIPS64.
>
> Signed-off-by: Mark Hatle 
> ---
>  meta/recipes-devtools/gcc/gcc-7.3.inc  |   1 +
>  .../gcc-7.3/0001-PR-rtl-optimization-83030.patch   | 272 
> +
>  2 files changed, 273 insertions(+)
>  create mode 100644 
> meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc 
> b/meta/recipes-devtools/gcc/gcc-7.3.inc
> index 724f9c32a0..9872d81203 100644
> --- a/meta/recipes-devtools/gcc/gcc-7.3.inc
> +++ b/meta/recipes-devtools/gcc/gcc-7.3.inc
> @@ -77,6 +77,7 @@ SRC_URI = "\
> ${BACKPORTS} \
>  "
>  BACKPORTS = "\
> +   file://0001-PR-rtl-optimization-83030.patch \
>  "
>
>  SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2"
> diff --git 
> a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch 
> b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
> new file mode 100644
> index 00..71f7988eaa
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
> @@ -0,0 +1,272 @@
> +From f5c4a9440f15ccf6775659910a2014a5494ee86e Mon Sep 17 00:00:00 2001
> +From: ebotcazou 
> +Date: Wed, 22 Nov 2017 21:43:22 +
> +Subject: [PATCH]   PR rtl-optimization/83030   * doc/rtl.texi (Flags
> + in an RTL Expression): Alphabetize, add entry for CROSSING_JUMP_P 
> and
> + mention usage of 'jump' for JUMP_INSNs.   (Insns): Delete entry for
> + REG_CROSSING_JUMP in register notes.  * bb-reorder.c
> + (update_crossing_jump_flags): Do not test whether the 
> CROSSING_JUMP_P flag
> + is already set before setting it. * cfgrtl.c (fixup_partition_crossing):
> + Likewise. * reorg.c (relax_delay_slots): Do not consider a
> + CROSSING_JUMP_P insn  as useless.
> +
> +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255083 
> 138bc75d-0d04-0410-961f-82ee72b054a4
> +
> +Upstream-Status: Backport
> +
> +This patch removes changes to Changelog from the original upstream patch.
> +This will help us avoid conflicts.
> +
> +Original backport to GCC 7.x by Amruta Pawar 
> +
> +Signed-off-by: Mark Hatle 
> +


LGTM
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] gcc: backport patch to fix ICE in MIPS64 target in G++

2018-02-09 Thread Mark Hatle
Backport a patch to fix an ICE when compiling for MIPS64.

Signed-off-by: Mark Hatle 
---
 meta/recipes-devtools/gcc/gcc-7.3.inc  |   1 +
 .../gcc-7.3/0001-PR-rtl-optimization-83030.patch   | 272 +
 2 files changed, 273 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch

diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc 
b/meta/recipes-devtools/gcc/gcc-7.3.inc
index 724f9c32a0..9872d81203 100644
--- a/meta/recipes-devtools/gcc/gcc-7.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-7.3.inc
@@ -77,6 +77,7 @@ SRC_URI = "\
${BACKPORTS} \
 "
 BACKPORTS = "\
+   file://0001-PR-rtl-optimization-83030.patch \
 "
 
 SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2"
diff --git 
a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch 
b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
new file mode 100644
index 00..71f7988eaa
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-rtl-optimization-83030.patch
@@ -0,0 +1,272 @@
+From f5c4a9440f15ccf6775659910a2014a5494ee86e Mon Sep 17 00:00:00 2001
+From: ebotcazou 
+Date: Wed, 22 Nov 2017 21:43:22 +
+Subject: [PATCH]   PR rtl-optimization/83030   * doc/rtl.texi (Flags
+ in an RTL Expression): Alphabetize, add entry for CROSSING_JUMP_P and
+ mention usage of 'jump' for JUMP_INSNs.   (Insns): Delete entry for
+ REG_CROSSING_JUMP in register notes.  * bb-reorder.c
+ (update_crossing_jump_flags): Do not test whether the CROSSING_JUMP_P 
flag
+ is already set before setting it. * cfgrtl.c (fixup_partition_crossing):
+ Likewise. * reorg.c (relax_delay_slots): Do not consider a
+ CROSSING_JUMP_P insn  as useless.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255083 
138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+
+This patch removes changes to Changelog from the original upstream patch.
+This will help us avoid conflicts.
+
+Original backport to GCC 7.x by Amruta Pawar 
+
+Signed-off-by: Mark Hatle 
+
+---
+ gcc/bb-reorder.c |   5 +--
+ gcc/cfgrtl.c |   3 +-
+ gcc/doc/rtl.texi | 129 ---
+ gcc/reorg.c  |   7 +--
+ 5 files changed, 84 insertions(+), 72 deletions(-)
+
+diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
+index 55e6dc6..794283c 100644
+--- a/gcc/bb-reorder.c
 b/gcc/bb-reorder.c
+@@ -2236,10 +2236,7 @@ update_crossing_jump_flags (void)
+ FOR_EACH_EDGE (e, ei, bb->succs)
+   if (e->flags & EDGE_CROSSING)
+   {
+-if (JUMP_P (BB_END (bb))
+-/* Some flags were added during fix_up_fall_thru_edges, via
+-   force_nonfallthru_and_redirect.  */
+-&& !CROSSING_JUMP_P (BB_END (bb)))
++if (JUMP_P (BB_END (bb)))
+   CROSSING_JUMP_P (BB_END (bb)) = 1;
+ break;
+   }
+diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
+index d6e5ac0..a2ad075 100644
+--- a/gcc/cfgrtl.c
 b/gcc/cfgrtl.c
+@@ -1334,8 +1334,7 @@ fixup_partition_crossing (edge e)
+   if (BB_PARTITION (e->src) != BB_PARTITION (e->dest))
+ {
+   e->flags |= EDGE_CROSSING;
+-  if (JUMP_P (BB_END (e->src))
+-&& !CROSSING_JUMP_P (BB_END (e->src)))
++  if (JUMP_P (BB_END (e->src)))
+   CROSSING_JUMP_P (BB_END (e->src)) = 1;
+ }
+   else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
+diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
+index 21524f5..a58eedc 100644
+--- a/gcc/doc/rtl.texi
 b/gcc/doc/rtl.texi
+@@ -565,6 +565,16 @@ that are used in certain types of expression.  Most often 
they
+ are accessed with the following macros, which expand into lvalues.
+ 
+ @table @code
++@findex CROSSING_JUMP_P
++@cindex @code{jump_insn} and @samp{/j}
++@item CROSSING_JUMP_P (@var{x})
++Nonzero in a @code{jump_insn} if it crosses between hot and cold sections,
++which could potentially be very far apart in the executable.  The presence
++of this flag indicates to other optimizations that this branching instruction
++should not be ``collapsed'' into a simpler branching construct.  It is used
++when the optimization to partition basic blocks into hot and cold sections
++is turned on.
++
+ @findex CONSTANT_POOL_ADDRESS_P
+ @cindex @code{symbol_ref} and @samp{/u}
+ @cindex @code{unchanging}, in @code{symbol_ref}
+@@ -577,37 +587,6 @@ In either case GCC assumes these addresses can be 
addressed directly,
+ perhaps with the help of base registers.
+ Stored in the @code{unchanging} field and printed as @samp{/u}.
+ 
+-@findex RTL_CONST_CALL_P
+-@cindex @code{call_insn} and @samp{/u}
+-@cindex @code{unchanging}, in @code{call_insn}
+-@item RTL_CONST_CALL_P (@var{x})
+-In a @code{call_insn} indicates that the insn represents a call to a
+-const function.  Stored in the @code{unchanging} field and printed as
+-@samp{/u}.
+-
+-@findex RTL_PURE_CALL_P
+-@cindex @code{call_insn} and @samp{/i}
+-@cindex @code{return_val}, in @code{call_insn}
+-@item R