* [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
@ 2015-01-12 3:12 Lei Maohui
2015-01-12 4:08 ` akuster808
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Lei Maohui @ 2015-01-12 3:12 UTC (permalink / raw)
To: openembedded-core
fix the yocto bug #6824
backport from gcc
Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
---
meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
.../0061-Fix-for-unwinder-aborts-on-e500.patch | 161 +++++++++++++++++++++
3 files changed, 180 insertions(+), 6 deletions(-)
create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 2568e99..c4ec40d 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -2,11 +2,11 @@ require gcc-common.inc
# Third digit in PV should be incremented after a minor release
-PV = "4.9.1"
+PV = "4.9.2"
# BINV should be incremented to a revision after a minor gcc release
-BINV = "4.9.1"
+BINV = "4.9.2"
FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
@@ -69,11 +69,11 @@ SRC_URI = "\
file://0051-eabispe.patch \
file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
- file://0055-PR-rtl-optimization-61801.patch \
file://0056-top-level-reorder_gcc-bug-61144.patch \
- file://0057-aarch64-config.patch \
file://0058-gcc-r212171.patch \
file://0059-gcc-PR-rtl-optimization-63348.patch \
+ file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
+ file://0061-Fix-for-unwinder-aborts-on-e500.patch \
"
SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
@@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
EXTRA_OECONF_PATHS = "\
- --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
- --with-sysroot=/not/exist \
+ --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \
+ --with-sysroot=${STAGING_DIR_TARGET} \
--with-build-sysroot=${STAGING_DIR_TARGET} \
"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
new file mode 100644
index 0000000..810ff90
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
@@ -0,0 +1,13 @@
+diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
+index 512e7d6..292fb2c 100644
+--- a/gcc/config/rs6000/rs6000.c
++++ b/gcc/config/rs6000/rs6000.c
+@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno, enum machine_mode mode)
+ SCmode so as to pass the value correctly in a pair of
+ registers. */
+ else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
+- && !DECIMAL_FLOAT_MODE_P (mode))
++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
+ reg_size = UNITS_PER_FP_WORD;
+
+ else
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
new file mode 100644
index 0000000..c37a4c3
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
@@ -0,0 +1,161 @@
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index f94ae17..80a798f 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+ #endif
+
++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
++#ifndef DWARF_REG_TO_UNWIND_COLUMN
++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
++#endif
++
+ /* Map register numbers held in the call frame info that gcc has
+ collected using DWARF_FRAME_REGNUM to those that should be output in
+ .debug_frame and .eh_frame. */
+diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
+index abcdeb3..4e59dfe 100644
+--- a/gcc/dwarf2cfi.c
++++ b/gcc/dwarf2cfi.c
+@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode, rtx mem, unsigned int c)
+ gen_int_mode (size, mode));
+ }
+
+-/* Generate code to initialize the register size table. */
++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
++ init_one_dwarf_reg_size to communicate on what has been done by the
++ latter. */
++
++typedef struct
++{
++ /* Whether the dwarf return column was initialized. */
++ bool wrote_return_column;
++
++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
++ was given REGNO to process already. */
++ bool processed_regno [FIRST_PSEUDO_REGISTER];
++
++} init_one_dwarf_reg_state;
++
++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
++ initialize the dwarf register size table entry corresponding to register
++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode to
++ use for the size entry to initialize, and INIT_STATE is the communication
++ datastructure conveying what we're doing to our caller. */
++
++static
++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
++ rtx table, machine_mode slotmode,
++ init_one_dwarf_reg_state *init_state)
++{
++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
++
++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
++
++ init_state->processed_regno[regno] = true;
++
++ if (rnum >= DWARF_FRAME_REGISTERS)
++ return;
++
++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ {
++ if (regmode == VOIDmode)
++ return;
++ init_state->wrote_return_column = true;
++ }
++
++ if (slotoffset < 0)
++ return;
++
++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
++ gen_int_mode (regsize, slotmode));
++}
++
++/* Generate code to initialize the dwarf register size table located
++ at the provided ADDRESS. */
+
+ void
+ expand_builtin_init_dwarf_reg_sizes (tree address)
+@@ -261,37 +314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
+ enum machine_mode mode = TYPE_MODE (char_type_node);
+ rtx addr = expand_normal (address);
+ rtx mem = gen_rtx_MEM (BLKmode, addr);
+- bool wrote_return_column = false;
++
++ init_one_dwarf_reg_state init_state;
++ memset ((char *)&init_state, 0, sizeof (init_state));
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+- unsigned int dnum = DWARF_FRAME_REGNUM (i);
+- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++ machine_mode save_mode;
++ rtx span;
+
+- if (rnum < DWARF_FRAME_REGISTERS)
+- {
+- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- enum machine_mode save_mode = reg_raw_mode[i];
+- HOST_WIDE_INT size;
++ /* No point in processing a register multiple times. This could happen
++ with register spans, e.g. when a reg is first processed as a piece of
++ a span, then as a register on its own later on. */
+
+- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+- save_mode = choose_hard_reg_mode (i, 1, true);
+- if (dnum == DWARF_FRAME_RETURN_COLUMN)
+- {
+- if (save_mode == VOIDmode)
+- continue;
+- wrote_return_column = true;
+- }
+- size = GET_MODE_SIZE (save_mode);
+- if (offset < 0)
+- continue;
++ if (init_state.processed_regno[i])
++ continue;
+
+- emit_move_insn (adjust_address (mem, mode, offset),
+- gen_int_mode (size, mode));
++ save_mode = reg_raw_mode[i];
++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
++ save_mode = choose_hard_reg_mode (i, 1, true);
++
++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
++ if (!span)
++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
++ else
++ {
++ for (int si = 0; si < XVECLEN (span, 0); si++)
++ {
++ rtx reg = XVECEXP (span, 0, si);
++ init_one_dwarf_reg_size
++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
++ }
+ }
+ }
+
+- if (!wrote_return_column)
++ if (!init_state.wrote_return_column)
+ init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
+
+ #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
+diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
+index 55fc4bc..37f0ae2 100644
+--- a/libgcc/unwind-dw2.c
++++ b/libgcc/unwind-dw2.c
+@@ -55,10 +55,6 @@
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+
+-#ifndef DWARF_REG_TO_UNWIND_COLUMN
+-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+-#endif
+-
+ /* ??? For the public function interfaces, we tend to gcc_assert that the
+ column numbers are in range. For the dwarf2 unwind info this does happen,
+ although so far in a case that doesn't actually matter.
--
1.8.4.2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 3:12 [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824 Lei Maohui
@ 2015-01-12 4:08 ` akuster808
2015-01-12 4:18 ` Lei, Maohui
2015-01-12 9:10 ` Jacob Kroon
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: akuster808 @ 2015-01-12 4:08 UTC (permalink / raw)
To: Lei Maohui, openembedded-core
Lei,
I think all the two patches need an "Upstream-Status:" statement.
- Armin
On 01/11/2015 07:12 PM, Lei Maohui wrote:
> fix the yocto bug #6824
> backport from gcc
>
> Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> ---
> meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
> ...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
> .../0061-Fix-for-unwinder-aborts-on-e500.patch | 161 +++++++++++++++++++++
> 3 files changed, 180 insertions(+), 6 deletions(-)
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
> index 2568e99..c4ec40d 100644
> --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> @@ -2,11 +2,11 @@ require gcc-common.inc
>
> # Third digit in PV should be incremented after a minor release
>
> -PV = "4.9.1"
> +PV = "4.9.2"
>
> # BINV should be incremented to a revision after a minor gcc release
>
> -BINV = "4.9.1"
> +BINV = "4.9.2"
>
> FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
>
> @@ -69,11 +69,11 @@ SRC_URI = "\
> file://0051-eabispe.patch \
> file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
> file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
> - file://0055-PR-rtl-optimization-61801.patch \
> file://0056-top-level-reorder_gcc-bug-61144.patch \
> - file://0057-aarch64-config.patch \
> file://0058-gcc-r212171.patch \
> file://0059-gcc-PR-rtl-optimization-63348.patch \
> + file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
> + file://0061-Fix-for-unwinder-aborts-on-e500.patch \
> "
> SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
> SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
> @@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
> EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
>
> EXTRA_OECONF_PATHS = "\
> - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> - --with-sysroot=/not/exist \
> + --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \
> + --with-sysroot=${STAGING_DIR_TARGET} \
> --with-build-sysroot=${STAGING_DIR_TARGET} \
> "
>
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> new file mode 100644
> index 0000000..810ff90
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> @@ -0,0 +1,13 @@
> +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> +index 512e7d6..292fb2c 100644
> +--- a/gcc/config/rs6000/rs6000.c
> ++++ b/gcc/config/rs6000/rs6000.c
> +@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno, enum machine_mode mode)
> + SCmode so as to pass the value correctly in a pair of
> + registers. */
> + else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
> +- && !DECIMAL_FLOAT_MODE_P (mode))
> ++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
> + reg_size = UNITS_PER_FP_WORD;
> +
> + else
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
> new file mode 100644
> index 0000000..c37a4c3
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
> @@ -0,0 +1,161 @@
> +diff --git a/gcc/defaults.h b/gcc/defaults.h
> +index f94ae17..80a798f 100644
> +--- a/gcc/defaults.h
> ++++ b/gcc/defaults.h
> +@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
> + #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
> + #endif
> +
> ++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
> ++#ifndef DWARF_REG_TO_UNWIND_COLUMN
> ++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
> ++#endif
> ++
> + /* Map register numbers held in the call frame info that gcc has
> + collected using DWARF_FRAME_REGNUM to those that should be output in
> + .debug_frame and .eh_frame. */
> +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
> +index abcdeb3..4e59dfe 100644
> +--- a/gcc/dwarf2cfi.c
> ++++ b/gcc/dwarf2cfi.c
> +@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode, rtx mem, unsigned int c)
> + gen_int_mode (size, mode));
> + }
> +
> +-/* Generate code to initialize the register size table. */
> ++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
> ++ init_one_dwarf_reg_size to communicate on what has been done by the
> ++ latter. */
> ++
> ++typedef struct
> ++{
> ++ /* Whether the dwarf return column was initialized. */
> ++ bool wrote_return_column;
> ++
> ++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
> ++ was given REGNO to process already. */
> ++ bool processed_regno [FIRST_PSEUDO_REGISTER];
> ++
> ++} init_one_dwarf_reg_state;
> ++
> ++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
> ++ initialize the dwarf register size table entry corresponding to register
> ++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode to
> ++ use for the size entry to initialize, and INIT_STATE is the communication
> ++ datastructure conveying what we're doing to our caller. */
> ++
> ++static
> ++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
> ++ rtx table, machine_mode slotmode,
> ++ init_one_dwarf_reg_state *init_state)
> ++{
> ++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
> ++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> ++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
> ++
> ++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
> ++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
> ++
> ++ init_state->processed_regno[regno] = true;
> ++
> ++ if (rnum >= DWARF_FRAME_REGISTERS)
> ++ return;
> ++
> ++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
> ++ {
> ++ if (regmode == VOIDmode)
> ++ return;
> ++ init_state->wrote_return_column = true;
> ++ }
> ++
> ++ if (slotoffset < 0)
> ++ return;
> ++
> ++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
> ++ gen_int_mode (regsize, slotmode));
> ++}
> ++
> ++/* Generate code to initialize the dwarf register size table located
> ++ at the provided ADDRESS. */
> +
> + void
> + expand_builtin_init_dwarf_reg_sizes (tree address)
> +@@ -261,37 +314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
> + enum machine_mode mode = TYPE_MODE (char_type_node);
> + rtx addr = expand_normal (address);
> + rtx mem = gen_rtx_MEM (BLKmode, addr);
> +- bool wrote_return_column = false;
> ++
> ++ init_one_dwarf_reg_state init_state;
> ++ memset ((char *)&init_state, 0, sizeof (init_state));
> +
> + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> + {
> +- unsigned int dnum = DWARF_FRAME_REGNUM (i);
> +- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> ++ machine_mode save_mode;
> ++ rtx span;
> +
> +- if (rnum < DWARF_FRAME_REGISTERS)
> +- {
> +- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
> +- enum machine_mode save_mode = reg_raw_mode[i];
> +- HOST_WIDE_INT size;
> ++ /* No point in processing a register multiple times. This could happen
> ++ with register spans, e.g. when a reg is first processed as a piece of
> ++ a span, then as a register on its own later on. */
> +
> +- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> +- save_mode = choose_hard_reg_mode (i, 1, true);
> +- if (dnum == DWARF_FRAME_RETURN_COLUMN)
> +- {
> +- if (save_mode == VOIDmode)
> +- continue;
> +- wrote_return_column = true;
> +- }
> +- size = GET_MODE_SIZE (save_mode);
> +- if (offset < 0)
> +- continue;
> ++ if (init_state.processed_regno[i])
> ++ continue;
> +
> +- emit_move_insn (adjust_address (mem, mode, offset),
> +- gen_int_mode (size, mode));
> ++ save_mode = reg_raw_mode[i];
> ++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> ++ save_mode = choose_hard_reg_mode (i, 1, true);
> ++
> ++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
> ++ if (!span)
> ++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
> ++ else
> ++ {
> ++ for (int si = 0; si < XVECLEN (span, 0); si++)
> ++ {
> ++ rtx reg = XVECEXP (span, 0, si);
> ++ init_one_dwarf_reg_size
> ++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
> ++ }
> + }
> + }
> +
> +- if (!wrote_return_column)
> ++ if (!init_state.wrote_return_column)
> + init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
> +
> + #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
> +diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
> +index 55fc4bc..37f0ae2 100644
> +--- a/libgcc/unwind-dw2.c
> ++++ b/libgcc/unwind-dw2.c
> +@@ -55,10 +55,6 @@
> + #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
> + #endif
> +
> +-#ifndef DWARF_REG_TO_UNWIND_COLUMN
> +-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
> +-#endif
> +-
> + /* ??? For the public function interfaces, we tend to gcc_assert that the
> + column numbers are in range. For the dwarf2 unwind info this does happen,
> + although so far in a case that doesn't actually matter.
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 4:08 ` akuster808
@ 2015-01-12 4:18 ` Lei, Maohui
2015-01-12 9:07 ` Martin Jansa
0 siblings, 1 reply; 12+ messages in thread
From: Lei, Maohui @ 2015-01-12 4:18 UTC (permalink / raw)
To: openembedded-core@lists.openembedded.org
Hi Armin
> I think all the two patches need an "Upstream-Status:" statement.
>
OK. I will modify my patch and submit it again.
Cheers
Lei Maohui
> -----Original Message-----
> From: akuster808 [mailto:akuster808@gmail.com]
> Sent: Monday, January 12, 2015 12:09 PM
> To: Lei, Maohui/雷 茂慧; openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
>
> Lei,
>
> I think all the two patches need an "Upstream-Status:" statement.
>
> - Armin
>
> On 01/11/2015 07:12 PM, Lei Maohui wrote:
> > fix the yocto bug #6824
> > backport from gcc
> >
> > Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> > ---
> > meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
> > ...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
> > .../0061-Fix-for-unwinder-aborts-on-e500.patch | 161
> +++++++++++++++++++++
> > 3 files changed, 180 insertions(+), 6 deletions(-)
> > create mode 100644
> meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_
> REGNO_P-registers.patch
> > create mode 100644
> > meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500
> > .patch
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > index 2568e99..c4ec40d 100644
> > --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > @@ -2,11 +2,11 @@ require gcc-common.inc
> >
> > # Third digit in PV should be incremented after a minor release
> >
> > -PV = "4.9.1"
> > +PV = "4.9.2"
> >
> > # BINV should be incremented to a revision after a minor gcc release
> >
> > -BINV = "4.9.1"
> > +BINV = "4.9.2"
> >
> > FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
> >
> > @@ -69,11 +69,11 @@ SRC_URI = "\
> > file://0051-eabispe.patch \
> >
> file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
> > file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
> > - file://0055-PR-rtl-optimization-61801.patch \
> > file://0056-top-level-reorder_gcc-bug-61144.patch \
> > - file://0057-aarch64-config.patch \
> > file://0058-gcc-r212171.patch \
> > file://0059-gcc-PR-rtl-optimization-63348.patch \
> > +
> file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
> > + file://0061-Fix-for-unwinder-aborts-on-e500.patch \
> > "
> > SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
> > SRC_URI[sha256sum] =
> "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
> > @@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
> > EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
> >
> > EXTRA_OECONF_PATHS = "\
> > - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> > - --with-sysroot=/not/exist \
> > +
> --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BIN
> V} \
> > + --with-sysroot=${STAGING_DIR_TARGET} \
> > --with-build-sysroot=${STAGING_DIR_TARGET} \
> > "
> >
> > diff --git
> > a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > _SIMD_REGNO_P-registers.patch
> > b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > _SIMD_REGNO_P-registers.patch
> > new file mode 100644
> > index 0000000..810ff90
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in
> > +++ -SPE_SIMD_REGNO_P-registers.patch
> > @@ -0,0 +1,13 @@
> > +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> > +index 512e7d6..292fb2c 100644
> > +--- a/gcc/config/rs6000/rs6000.c
> > ++++ b/gcc/config/rs6000/rs6000.c
> > +@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno, enum
> machine_mode mode)
> > + SCmode so as to pass the value correctly in a pair of
> > + registers. */
> > + else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
> > +- && !DECIMAL_FLOAT_MODE_P (mode))
> > ++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P
> > ++ (regno))
> > + reg_size = UNITS_PER_FP_WORD;
> > +
> > + else
> > diff --git
> > a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > 00.patch
> > b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > 00.patch
> > new file mode 100644
> > index 0000000..c37a4c3
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-o
> > +++ n-e500.patch
> > @@ -0,0 +1,161 @@
> > +diff --git a/gcc/defaults.h b/gcc/defaults.h index f94ae17..80a798f
> > +100644
> > +--- a/gcc/defaults.h
> > ++++ b/gcc/defaults.h
> > +@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME
> > +respectively. If not, see #define DWARF_FRAME_REGNUM(REG)
> > +DBX_REGISTER_NUMBER (REG) #endif
> > +
> > ++/* The mapping from dwarf CFA reg number to internal dwarf reg
> > ++numbers. */ #ifndef DWARF_REG_TO_UNWIND_COLUMN #define
> > ++DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) #endif
> > ++
> > + /* Map register numbers held in the call frame info that gcc has
> > + collected using DWARF_FRAME_REGNUM to those that should be output in
> > + .debug_frame and .eh_frame. */
> > +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index abcdeb3..4e59dfe
> > +100644
> > +--- a/gcc/dwarf2cfi.c
> > ++++ b/gcc/dwarf2cfi.c
> > +@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode, rtx
> mem, unsigned int c)
> > + gen_int_mode (size, mode));
> > + }
> > +
> > +-/* Generate code to initialize the register size table. */
> > ++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
> > ++ init_one_dwarf_reg_size to communicate on what has been done by the
> > ++ latter. */
> > ++
> > ++typedef struct
> > ++{
> > ++ /* Whether the dwarf return column was initialized. */
> > ++ bool wrote_return_column;
> > ++
> > ++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
> > ++ was given REGNO to process already. */ bool processed_regno
> > ++ [FIRST_PSEUDO_REGISTER];
> > ++
> > ++} init_one_dwarf_reg_state;
> > ++
> > ++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
> > ++ initialize the dwarf register size table entry corresponding to register
> > ++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode
> to
> > ++ use for the size entry to initialize, and INIT_STATE is the communication
> > ++ datastructure conveying what we're doing to our caller. */
> > ++
> > ++static
> > ++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
> > ++ rtx table, machine_mode slotmode,
> > ++ init_one_dwarf_reg_state *init_state) {
> > ++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
> > ++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > ++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
> > ++
> > ++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
> > ++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
> > ++
> > ++ init_state->processed_regno[regno] = true;
> > ++
> > ++ if (rnum >= DWARF_FRAME_REGISTERS)
> > ++ return;
> > ++
> > ++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > ++ {
> > ++ if (regmode == VOIDmode)
> > ++ return;
> > ++ init_state->wrote_return_column = true;
> > ++ }
> > ++
> > ++ if (slotoffset < 0)
> > ++ return;
> > ++
> > ++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
> > ++ gen_int_mode (regsize, slotmode)); }
> > ++
> > ++/* Generate code to initialize the dwarf register size table located
> > ++ at the provided ADDRESS. */
> > +
> > + void
> > + expand_builtin_init_dwarf_reg_sizes (tree address) @@ -261,37
> > ++314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
> > + enum machine_mode mode = TYPE_MODE (char_type_node);
> > + rtx addr = expand_normal (address);
> > + rtx mem = gen_rtx_MEM (BLKmode, addr);
> > +- bool wrote_return_column = false;
> > ++
> > ++ init_one_dwarf_reg_state init_state; memset ((char *)&init_state,
> > ++ 0, sizeof (init_state));
> > +
> > + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> > + {
> > +- unsigned int dnum = DWARF_FRAME_REGNUM (i);
> > +- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > ++ machine_mode save_mode;
> > ++ rtx span;
> > +
> > +- if (rnum < DWARF_FRAME_REGISTERS)
> > +- {
> > +- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
> > +- enum machine_mode save_mode = reg_raw_mode[i];
> > +- HOST_WIDE_INT size;
> > ++ /* No point in processing a register multiple times. This could
> happen
> > ++ with register spans, e.g. when a reg is first processed as a piece
> of
> > ++ a span, then as a register on its own later on. */
> > +
> > +- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > +- save_mode = choose_hard_reg_mode (i, 1, true);
> > +- if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > +- {
> > +- if (save_mode == VOIDmode)
> > +- continue;
> > +- wrote_return_column = true;
> > +- }
> > +- size = GET_MODE_SIZE (save_mode);
> > +- if (offset < 0)
> > +- continue;
> > ++ if (init_state.processed_regno[i])
> > ++ continue;
> > +
> > +- emit_move_insn (adjust_address (mem, mode, offset),
> > +- gen_int_mode (size, mode));
> > ++ save_mode = reg_raw_mode[i];
> > ++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > ++ save_mode = choose_hard_reg_mode (i, 1, true);
> > ++
> > ++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
> > ++ if (!span)
> > ++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
> > ++ else
> > ++ {
> > ++ for (int si = 0; si < XVECLEN (span, 0); si++)
> > ++ {
> > ++ rtx reg = XVECEXP (span, 0, si);
> > ++ init_one_dwarf_reg_size
> > ++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
> > ++ }
> > + }
> > + }
> > +
> > +- if (!wrote_return_column)
> > ++ if (!init_state.wrote_return_column)
> > + init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
> > +
> > + #ifdef DWARF_ALT_FRAME_RETURN_COLUMN diff --git
> > +a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c index 55fc4bc..37f0ae2
> > +100644
> > +--- a/libgcc/unwind-dw2.c
> > ++++ b/libgcc/unwind-dw2.c
> > +@@ -55,10 +55,6 @@
> > + #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS #endif
> > +
> > +-#ifndef DWARF_REG_TO_UNWIND_COLUMN
> > +-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) -#endif
> > +-
> > + /* ??? For the public function interfaces, we tend to gcc_assert that the
> > + column numbers are in range. For the dwarf2 unwind info this does happen,
> > + although so far in a case that doesn't actually matter.
> >
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 4:18 ` Lei, Maohui
@ 2015-01-12 9:07 ` Martin Jansa
0 siblings, 0 replies; 12+ messages in thread
From: Martin Jansa @ 2015-01-12 9:07 UTC (permalink / raw)
To: Lei, Maohui; +Cc: openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 12204 bytes --]
Why did you revert default sysroot poisoning?
On Mon, Jan 12, 2015 at 5:18 AM, Lei, Maohui <leimaohui@cn.fujitsu.com>
wrote:
> Hi Armin
>
> > I think all the two patches need an "Upstream-Status:" statement.
> >
>
> OK. I will modify my patch and submit it again.
>
>
> Cheers
>
> Lei Maohui
>
>
>
> > -----Original Message-----
> > From: akuster808 [mailto:akuster808@gmail.com]
> > Sent: Monday, January 12, 2015 12:09 PM
> > To: Lei, Maohui/雷 茂慧; openembedded-core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH] gcc: upgrade to 4.9.2 and fix the bug
> #6824
> >
> > Lei,
> >
> > I think all the two patches need an "Upstream-Status:" statement.
> >
> > - Armin
> >
> > On 01/11/2015 07:12 PM, Lei Maohui wrote:
> > > fix the yocto bug #6824
> > > backport from gcc
> > >
> > > Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> > > ---
> > > meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
> > > ...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
> > > .../0061-Fix-for-unwinder-aborts-on-e500.patch | 161
> > +++++++++++++++++++++
> > > 3 files changed, 180 insertions(+), 6 deletions(-)
> > > create mode 100644
> >
> meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_
> > REGNO_P-registers.patch
> > > create mode 100644
> > > meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500
> > > .patch
> > >
> > > diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > > b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > > index 2568e99..c4ec40d 100644
> > > --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > > +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > > @@ -2,11 +2,11 @@ require gcc-common.inc
> > >
> > > # Third digit in PV should be incremented after a minor release
> > >
> > > -PV = "4.9.1"
> > > +PV = "4.9.2"
> > >
> > > # BINV should be incremented to a revision after a minor gcc release
> > >
> > > -BINV = "4.9.1"
> > > +BINV = "4.9.2"
> > >
> > > FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
> > >
> > > @@ -69,11 +69,11 @@ SRC_URI = "\
> > > file://0051-eabispe.patch \
> > >
> > file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
> > > file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
> > > - file://0055-PR-rtl-optimization-61801.patch \
> > > file://0056-top-level-reorder_gcc-bug-61144.patch \
> > > - file://0057-aarch64-config.patch \
> > > file://0058-gcc-r212171.patch \
> > > file://0059-gcc-PR-rtl-optimization-63348.patch \
> > > +
> > file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
> > > + file://0061-Fix-for-unwinder-aborts-on-e500.patch \
> > > "
> > > SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
> > > SRC_URI[sha256sum] =
> > "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
> > > @@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
> > > EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
> > >
> > > EXTRA_OECONF_PATHS = "\
> > > - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> > > - --with-sysroot=/not/exist \
> > > +
> >
> --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BIN
> > V} \
> > > + --with-sysroot=${STAGING_DIR_TARGET} \
> > > --with-build-sysroot=${STAGING_DIR_TARGET} \
> > > "
> > >
> > > diff --git
> > > a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > > _SIMD_REGNO_P-registers.patch
> > > b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > > _SIMD_REGNO_P-registers.patch
> > > new file mode 100644
> > > index 0000000..810ff90
> > > --- /dev/null
> > > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in
> > > +++ -SPE_SIMD_REGNO_P-registers.patch
> > > @@ -0,0 +1,13 @@
> > > +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> > > +index 512e7d6..292fb2c 100644
> > > +--- a/gcc/config/rs6000/rs6000.c
> > > ++++ b/gcc/config/rs6000/rs6000.c
> > > +@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno,
> enum
> > machine_mode mode)
> > > + SCmode so as to pass the value correctly in a pair of
> > > + registers. */
> > > + else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode !=
> SCmode
> > > +- && !DECIMAL_FLOAT_MODE_P (mode))
> > > ++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P
> > > ++ (regno))
> > > + reg_size = UNITS_PER_FP_WORD;
> > > +
> > > + else
> > > diff --git
> > > a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > > 00.patch
> > > b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > > 00.patch
> > > new file mode 100644
> > > index 0000000..c37a4c3
> > > --- /dev/null
> > > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-o
> > > +++ n-e500.patch
> > > @@ -0,0 +1,161 @@
> > > +diff --git a/gcc/defaults.h b/gcc/defaults.h index f94ae17..80a798f
> > > +100644
> > > +--- a/gcc/defaults.h
> > > ++++ b/gcc/defaults.h
> > > +@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME
> > > +respectively. If not, see #define DWARF_FRAME_REGNUM(REG)
> > > +DBX_REGISTER_NUMBER (REG) #endif
> > > +
> > > ++/* The mapping from dwarf CFA reg number to internal dwarf reg
> > > ++numbers. */ #ifndef DWARF_REG_TO_UNWIND_COLUMN #define
> > > ++DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) #endif
> > > ++
> > > + /* Map register numbers held in the call frame info that gcc has
> > > + collected using DWARF_FRAME_REGNUM to those that should be output
> in
> > > + .debug_frame and .eh_frame. */
> > > +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index abcdeb3..4e59dfe
> > > +100644
> > > +--- a/gcc/dwarf2cfi.c
> > > ++++ b/gcc/dwarf2cfi.c
> > > +@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode,
> rtx
> > mem, unsigned int c)
> > > + gen_int_mode (size, mode));
> > > + }
> > > +
> > > +-/* Generate code to initialize the register size table. */
> > > ++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
> > > ++ init_one_dwarf_reg_size to communicate on what has been done by
> the
> > > ++ latter. */
> > > ++
> > > ++typedef struct
> > > ++{
> > > ++ /* Whether the dwarf return column was initialized. */
> > > ++ bool wrote_return_column;
> > > ++
> > > ++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
> > > ++ was given REGNO to process already. */ bool processed_regno
> > > ++ [FIRST_PSEUDO_REGISTER];
> > > ++
> > > ++} init_one_dwarf_reg_state;
> > > ++
> > > ++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
> > > ++ initialize the dwarf register size table entry corresponding to
> register
> > > ++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is
> the mode
> > to
> > > ++ use for the size entry to initialize, and INIT_STATE is the
> communication
> > > ++ datastructure conveying what we're doing to our caller. */
> > > ++
> > > ++static
> > > ++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
> > > ++ rtx table, machine_mode slotmode,
> > > ++ init_one_dwarf_reg_state *init_state) {
> > > ++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
> > > ++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > > ++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
> > > ++
> > > ++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
> > > ++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
> > > ++
> > > ++ init_state->processed_regno[regno] = true;
> > > ++
> > > ++ if (rnum >= DWARF_FRAME_REGISTERS)
> > > ++ return;
> > > ++
> > > ++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > > ++ {
> > > ++ if (regmode == VOIDmode)
> > > ++ return;
> > > ++ init_state->wrote_return_column = true;
> > > ++ }
> > > ++
> > > ++ if (slotoffset < 0)
> > > ++ return;
> > > ++
> > > ++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
> > > ++ gen_int_mode (regsize, slotmode)); }
> > > ++
> > > ++/* Generate code to initialize the dwarf register size table located
> > > ++ at the provided ADDRESS. */
> > > +
> > > + void
> > > + expand_builtin_init_dwarf_reg_sizes (tree address) @@ -261,37
> > > ++314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
> > > + enum machine_mode mode = TYPE_MODE (char_type_node);
> > > + rtx addr = expand_normal (address);
> > > + rtx mem = gen_rtx_MEM (BLKmode, addr);
> > > +- bool wrote_return_column = false;
> > > ++
> > > ++ init_one_dwarf_reg_state init_state; memset ((char *)&init_state,
> > > ++ 0, sizeof (init_state));
> > > +
> > > + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> > > + {
> > > +- unsigned int dnum = DWARF_FRAME_REGNUM (i);
> > > +- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > > ++ machine_mode save_mode;
> > > ++ rtx span;
> > > +
> > > +- if (rnum < DWARF_FRAME_REGISTERS)
> > > +- {
> > > +- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
> > > +- enum machine_mode save_mode = reg_raw_mode[i];
> > > +- HOST_WIDE_INT size;
> > > ++ /* No point in processing a register multiple times. This
> could
> > happen
> > > ++ with register spans, e.g. when a reg is first processed as
> a piece
> > of
> > > ++ a span, then as a register on its own later on. */
> > > +
> > > +- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > > +- save_mode = choose_hard_reg_mode (i, 1, true);
> > > +- if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > > +- {
> > > +- if (save_mode == VOIDmode)
> > > +- continue;
> > > +- wrote_return_column = true;
> > > +- }
> > > +- size = GET_MODE_SIZE (save_mode);
> > > +- if (offset < 0)
> > > +- continue;
> > > ++ if (init_state.processed_regno[i])
> > > ++ continue;
> > > +
> > > +- emit_move_insn (adjust_address (mem, mode, offset),
> > > +- gen_int_mode (size, mode));
> > > ++ save_mode = reg_raw_mode[i];
> > > ++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > > ++ save_mode = choose_hard_reg_mode (i, 1, true);
> > > ++
> > > ++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode,
> i));
> > > ++ if (!span)
> > > ++ init_one_dwarf_reg_size (i, save_mode, mem, mode,
> &init_state);
> > > ++ else
> > > ++ {
> > > ++ for (int si = 0; si < XVECLEN (span, 0); si++)
> > > ++ {
> > > ++ rtx reg = XVECEXP (span, 0, si);
> > > ++ init_one_dwarf_reg_size
> > > ++ (REGNO (reg), GET_MODE (reg), mem, mode,
> &init_state);
> > > ++ }
> > > + }
> > > + }
> > > +
> > > +- if (!wrote_return_column)
> > > ++ if (!init_state.wrote_return_column)
> > > + init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
> > > +
> > > + #ifdef DWARF_ALT_FRAME_RETURN_COLUMN diff --git
> > > +a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c index 55fc4bc..37f0ae2
> > > +100644
> > > +--- a/libgcc/unwind-dw2.c
> > > ++++ b/libgcc/unwind-dw2.c
> > > +@@ -55,10 +55,6 @@
> > > + #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS #endif
> > > +
> > > +-#ifndef DWARF_REG_TO_UNWIND_COLUMN
> > > +-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) -#endif
> > > +-
> > > + /* ??? For the public function interfaces, we tend to gcc_assert
> that the
> > > + column numbers are in range. For the dwarf2 unwind info this
> does happen,
> > > + although so far in a case that doesn't actually matter.
> > >
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
[-- Attachment #2: Type: text/html, Size: 15929 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 3:12 [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824 Lei Maohui
2015-01-12 4:08 ` akuster808
@ 2015-01-12 9:10 ` Jacob Kroon
2015-01-13 2:09 ` Lei, Maohui
2015-01-12 9:18 ` Richard Purdie
2015-01-12 12:38 ` Peter A. Bigot
3 siblings, 1 reply; 12+ messages in thread
From: Jacob Kroon @ 2015-01-12 9:10 UTC (permalink / raw)
To: Lei Maohui; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 585 bytes --]
Hi,
On Mon, Jan 12, 2015 at 4:12 AM, Lei Maohui <leimaohui@cn.fujitsu.com>
wrote:
<snip>
>
> EXTRA_OECONF_PATHS = "\
> - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> - --with-sysroot=/not/exist \
> +
> --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV}
> \
> + --with-sysroot=${STAGING_DIR_TARGET} \
> --with-build-sysroot=${STAGING_DIR_TARGET} \
> "
>
Unless things have changed, the sysroot is supposed to be poisoned by
default, see commit 04b725511a505c582a3abdf63d096967f0320779 in OE-Core.
[-- Attachment #2: Type: text/html, Size: 1049 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 3:12 [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824 Lei Maohui
2015-01-12 4:08 ` akuster808
2015-01-12 9:10 ` Jacob Kroon
@ 2015-01-12 9:18 ` Richard Purdie
2015-01-13 2:19 ` Lei, Maohui
2015-01-12 12:38 ` Peter A. Bigot
3 siblings, 1 reply; 12+ messages in thread
From: Richard Purdie @ 2015-01-12 9:18 UTC (permalink / raw)
To: Lei Maohui; +Cc: openembedded-core
On Mon, 2015-01-12 at 11:12 +0800, Lei Maohui wrote:
> fix the yocto bug #6824
> backport from gcc
>
> Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> ---
> meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
> ...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
> .../0061-Fix-for-unwinder-aborts-on-e500.patch | 161 +++++++++++++++++++++
> 3 files changed, 180 insertions(+), 6 deletions(-)
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
> index 2568e99..c4ec40d 100644
> --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> @@ -2,11 +2,11 @@ require gcc-common.inc
>
> # Third digit in PV should be incremented after a minor release
>
> -PV = "4.9.1"
> +PV = "4.9.2"
>
> # BINV should be incremented to a revision after a minor gcc release
>
> -BINV = "4.9.1"
> +BINV = "4.9.2"
I can't spot the upgrade from 4.9.1 to 4.9.2 in here. The SRC_URI
checksums are unchanged for example? Is there part of the patch missing?
Cheers,
Richard
>
> FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
>
> @@ -69,11 +69,11 @@ SRC_URI = "\
> file://0051-eabispe.patch \
> file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
> file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
> - file://0055-PR-rtl-optimization-61801.patch \
> file://0056-top-level-reorder_gcc-bug-61144.patch \
> - file://0057-aarch64-config.patch \
> file://0058-gcc-r212171.patch \
> file://0059-gcc-PR-rtl-optimization-63348.patch \
> + file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
> + file://0061-Fix-for-unwinder-aborts-on-e500.patch \
> "
> SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
> SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
> @@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
> EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
>
> EXTRA_OECONF_PATHS = "\
> - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> - --with-sysroot=/not/exist \
> + --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \
> + --with-sysroot=${STAGING_DIR_TARGET} \
> --with-build-sysroot=${STAGING_DIR_TARGET} \
> "
>
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> new file mode 100644
> index 0000000..810ff90
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> @@ -0,0 +1,13 @@
> +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> +index 512e7d6..292fb2c 100644
> +--- a/gcc/config/rs6000/rs6000.c
> ++++ b/gcc/config/rs6000/rs6000.c
> +@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno, enum machine_mode mode)
> + SCmode so as to pass the value correctly in a pair of
> + registers. */
> + else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
> +- && !DECIMAL_FLOAT_MODE_P (mode))
> ++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
> + reg_size = UNITS_PER_FP_WORD;
> +
> + else
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
> new file mode 100644
> index 0000000..c37a4c3
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
> @@ -0,0 +1,161 @@
> +diff --git a/gcc/defaults.h b/gcc/defaults.h
> +index f94ae17..80a798f 100644
> +--- a/gcc/defaults.h
> ++++ b/gcc/defaults.h
> +@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
> + #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
> + #endif
> +
> ++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
> ++#ifndef DWARF_REG_TO_UNWIND_COLUMN
> ++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
> ++#endif
> ++
> + /* Map register numbers held in the call frame info that gcc has
> + collected using DWARF_FRAME_REGNUM to those that should be output in
> + .debug_frame and .eh_frame. */
> +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
> +index abcdeb3..4e59dfe 100644
> +--- a/gcc/dwarf2cfi.c
> ++++ b/gcc/dwarf2cfi.c
> +@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode, rtx mem, unsigned int c)
> + gen_int_mode (size, mode));
> + }
> +
> +-/* Generate code to initialize the register size table. */
> ++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
> ++ init_one_dwarf_reg_size to communicate on what has been done by the
> ++ latter. */
> ++
> ++typedef struct
> ++{
> ++ /* Whether the dwarf return column was initialized. */
> ++ bool wrote_return_column;
> ++
> ++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
> ++ was given REGNO to process already. */
> ++ bool processed_regno [FIRST_PSEUDO_REGISTER];
> ++
> ++} init_one_dwarf_reg_state;
> ++
> ++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
> ++ initialize the dwarf register size table entry corresponding to register
> ++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode to
> ++ use for the size entry to initialize, and INIT_STATE is the communication
> ++ datastructure conveying what we're doing to our caller. */
> ++
> ++static
> ++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
> ++ rtx table, machine_mode slotmode,
> ++ init_one_dwarf_reg_state *init_state)
> ++{
> ++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
> ++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> ++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
> ++
> ++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
> ++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
> ++
> ++ init_state->processed_regno[regno] = true;
> ++
> ++ if (rnum >= DWARF_FRAME_REGISTERS)
> ++ return;
> ++
> ++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
> ++ {
> ++ if (regmode == VOIDmode)
> ++ return;
> ++ init_state->wrote_return_column = true;
> ++ }
> ++
> ++ if (slotoffset < 0)
> ++ return;
> ++
> ++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
> ++ gen_int_mode (regsize, slotmode));
> ++}
> ++
> ++/* Generate code to initialize the dwarf register size table located
> ++ at the provided ADDRESS. */
> +
> + void
> + expand_builtin_init_dwarf_reg_sizes (tree address)
> +@@ -261,37 +314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
> + enum machine_mode mode = TYPE_MODE (char_type_node);
> + rtx addr = expand_normal (address);
> + rtx mem = gen_rtx_MEM (BLKmode, addr);
> +- bool wrote_return_column = false;
> ++
> ++ init_one_dwarf_reg_state init_state;
> ++ memset ((char *)&init_state, 0, sizeof (init_state));
> +
> + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> + {
> +- unsigned int dnum = DWARF_FRAME_REGNUM (i);
> +- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> ++ machine_mode save_mode;
> ++ rtx span;
> +
> +- if (rnum < DWARF_FRAME_REGISTERS)
> +- {
> +- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
> +- enum machine_mode save_mode = reg_raw_mode[i];
> +- HOST_WIDE_INT size;
> ++ /* No point in processing a register multiple times. This could happen
> ++ with register spans, e.g. when a reg is first processed as a piece of
> ++ a span, then as a register on its own later on. */
> +
> +- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> +- save_mode = choose_hard_reg_mode (i, 1, true);
> +- if (dnum == DWARF_FRAME_RETURN_COLUMN)
> +- {
> +- if (save_mode == VOIDmode)
> +- continue;
> +- wrote_return_column = true;
> +- }
> +- size = GET_MODE_SIZE (save_mode);
> +- if (offset < 0)
> +- continue;
> ++ if (init_state.processed_regno[i])
> ++ continue;
> +
> +- emit_move_insn (adjust_address (mem, mode, offset),
> +- gen_int_mode (size, mode));
> ++ save_mode = reg_raw_mode[i];
> ++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> ++ save_mode = choose_hard_reg_mode (i, 1, true);
> ++
> ++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
> ++ if (!span)
> ++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
> ++ else
> ++ {
> ++ for (int si = 0; si < XVECLEN (span, 0); si++)
> ++ {
> ++ rtx reg = XVECEXP (span, 0, si);
> ++ init_one_dwarf_reg_size
> ++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
> ++ }
> + }
> + }
> +
> +- if (!wrote_return_column)
> ++ if (!init_state.wrote_return_column)
> + init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
> +
> + #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
> +diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
> +index 55fc4bc..37f0ae2 100644
> +--- a/libgcc/unwind-dw2.c
> ++++ b/libgcc/unwind-dw2.c
> +@@ -55,10 +55,6 @@
> + #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
> + #endif
> +
> +-#ifndef DWARF_REG_TO_UNWIND_COLUMN
> +-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
> +-#endif
> +-
> + /* ??? For the public function interfaces, we tend to gcc_assert that the
> + column numbers are in range. For the dwarf2 unwind info this does happen,
> + although so far in a case that doesn't actually matter.
> --
> 1.8.4.2
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 3:12 [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824 Lei Maohui
` (2 preceding siblings ...)
2015-01-12 9:18 ` Richard Purdie
@ 2015-01-12 12:38 ` Peter A. Bigot
2015-01-13 2:39 ` Lei, Maohui
3 siblings, 1 reply; 12+ messages in thread
From: Peter A. Bigot @ 2015-01-12 12:38 UTC (permalink / raw)
To: openembedded-core
On 01/11/2015 09:12 PM, Lei Maohui wrote:
> fix the yocto bug #6824
> backport from gcc
>
> Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> ---
> meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
> ...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
> .../0061-Fix-for-unwinder-aborts-on-e500.patch | 161 +++++++++++++++++++++
> 3 files changed, 180 insertions(+), 6 deletions(-)
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
> index 2568e99..c4ec40d 100644
> --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> @@ -2,11 +2,11 @@ require gcc-common.inc
>
> # Third digit in PV should be incremented after a minor release
>
> -PV = "4.9.1"
> +PV = "4.9.2"
>
> # BINV should be incremented to a revision after a minor gcc release
>
> -BINV = "4.9.1"
> +BINV = "4.9.2"
>
> FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
>
> @@ -69,11 +69,11 @@ SRC_URI = "\
> file://0051-eabispe.patch \
> file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
> file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
> - file://0055-PR-rtl-optimization-61801.patch \
> file://0056-top-level-reorder_gcc-bug-61144.patch \
> - file://0057-aarch64-config.patch \
> file://0058-gcc-r212171.patch \
> file://0059-gcc-PR-rtl-optimization-63348.patch \
> + file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
> + file://0061-Fix-for-unwinder-aborts-on-e500.patch \
> "
> SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
> SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
> @@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
> EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
>
> EXTRA_OECONF_PATHS = "\
> - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> - --with-sysroot=/not/exist \
> + --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \
> + --with-sysroot=${STAGING_DIR_TARGET} \
> --with-build-sysroot=${STAGING_DIR_TARGET} \
> "
>
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
As gcc is (IMO) one of the most critical components of Yocto I think we
need to be very clear about what changes are being made to it and why.
In addition to missing SOB lines, these patches at a minimum should
reference the upstream bug that they supposedly patch. That would be
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63908
Ideally, the patch would be taken from upstream, being created by
git-format-patch with the SHA1 of the relevant change as retrieved from:
git://gcc.gnu.org/git/gcc.git
It worries me that these patches, though present in upstream trunk, have
not been back-ported to gcc-4_9-branch. There may be a reason for that,
and the fact backports have not (yet) been done should be noted in the
OE patch header.
This first patch is apparently upstream commit
5c0092070253113cf0d9c45eacc884b3ecc34d81.
> new file mode 100644
> index 0000000..810ff90
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
> @@ -0,0 +1,13 @@
> +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> +index 512e7d6..292fb2c 100644
> +--- a/gcc/config/rs6000/rs6000.c
> ++++ b/gcc/config/rs6000/rs6000.c
> +@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno, enum machine_mode mode)
> + SCmode so as to pass the value correctly in a pair of
> + registers. */
> + else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
> +- && !DECIMAL_FLOAT_MODE_P (mode))
> ++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
> + reg_size = UNITS_PER_FP_WORD;
> +
> + else
> diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
> new file mode 100644
This patch appears to combine c0235a33de8c4f78cce35b2a8c2035c83fe1bd14
with 4fd39f1329379e00f958394adde6be96f0caf21f.
> index 0000000..c37a4c3
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500.patch
> @@ -0,0 +1,161 @@
> +diff --git a/gcc/defaults.h b/gcc/defaults.h
> +index f94ae17..80a798f 100644
> +--- a/gcc/defaults.h
> ++++ b/gcc/defaults.h
> +@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
> + #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
> + #endif
> +
> ++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
> ++#ifndef DWARF_REG_TO_UNWIND_COLUMN
> ++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
> ++#endif
> ++
> + /* Map register numbers held in the call frame info that gcc has
> + collected using DWARF_FRAME_REGNUM to those that should be output in
> + .debug_frame and .eh_frame. */
> +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
> +index abcdeb3..4e59dfe 100644
> +--- a/gcc/dwarf2cfi.c
> ++++ b/gcc/dwarf2cfi.c
> +@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode, rtx mem, unsigned int c)
> + gen_int_mode (size, mode));
> + }
> +
> +-/* Generate code to initialize the register size table. */
> ++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
> ++ init_one_dwarf_reg_size to communicate on what has been done by the
> ++ latter. */
> ++
> ++typedef struct
> ++{
> ++ /* Whether the dwarf return column was initialized. */
> ++ bool wrote_return_column;
> ++
> ++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
> ++ was given REGNO to process already. */
> ++ bool processed_regno [FIRST_PSEUDO_REGISTER];
> ++
> ++} init_one_dwarf_reg_state;
> ++
> ++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
> ++ initialize the dwarf register size table entry corresponding to register
> ++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode to
> ++ use for the size entry to initialize, and INIT_STATE is the communication
> ++ datastructure conveying what we're doing to our caller. */
> ++
> ++static
> ++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
> ++ rtx table, machine_mode slotmode,
> ++ init_one_dwarf_reg_state *init_state)
> ++{
> ++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
> ++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> ++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
> ++
> ++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
> ++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
> ++
> ++ init_state->processed_regno[regno] = true;
> ++
> ++ if (rnum >= DWARF_FRAME_REGISTERS)
> ++ return;
> ++
> ++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
> ++ {
> ++ if (regmode == VOIDmode)
> ++ return;
> ++ init_state->wrote_return_column = true;
> ++ }
> ++
> ++ if (slotoffset < 0)
> ++ return;
> ++
> ++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
> ++ gen_int_mode (regsize, slotmode));
> ++}
> ++
> ++/* Generate code to initialize the dwarf register size table located
> ++ at the provided ADDRESS. */
> +
> + void
> + expand_builtin_init_dwarf_reg_sizes (tree address)
> +@@ -261,37 +314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
> + enum machine_mode mode = TYPE_MODE (char_type_node);
> + rtx addr = expand_normal (address);
> + rtx mem = gen_rtx_MEM (BLKmode, addr);
> +- bool wrote_return_column = false;
> ++
> ++ init_one_dwarf_reg_state init_state;
> ++ memset ((char *)&init_state, 0, sizeof (init_state));
> +
> + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> + {
> +- unsigned int dnum = DWARF_FRAME_REGNUM (i);
> +- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> ++ machine_mode save_mode;
> ++ rtx span;
> +
> +- if (rnum < DWARF_FRAME_REGISTERS)
> +- {
> +- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
> +- enum machine_mode save_mode = reg_raw_mode[i];
> +- HOST_WIDE_INT size;
> ++ /* No point in processing a register multiple times. This could happen
> ++ with register spans, e.g. when a reg is first processed as a piece of
> ++ a span, then as a register on its own later on. */
> +
> +- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> +- save_mode = choose_hard_reg_mode (i, 1, true);
> +- if (dnum == DWARF_FRAME_RETURN_COLUMN)
> +- {
> +- if (save_mode == VOIDmode)
> +- continue;
> +- wrote_return_column = true;
> +- }
> +- size = GET_MODE_SIZE (save_mode);
> +- if (offset < 0)
> +- continue;
> ++ if (init_state.processed_regno[i])
> ++ continue;
> +
> +- emit_move_insn (adjust_address (mem, mode, offset),
> +- gen_int_mode (size, mode));
> ++ save_mode = reg_raw_mode[i];
> ++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> ++ save_mode = choose_hard_reg_mode (i, 1, true);
> ++
> ++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
> ++ if (!span)
> ++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
> ++ else
> ++ {
> ++ for (int si = 0; si < XVECLEN (span, 0); si++)
> ++ {
> ++ rtx reg = XVECEXP (span, 0, si);
> ++ init_one_dwarf_reg_size
> ++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
> ++ }
> + }
> + }
> +
> +- if (!wrote_return_column)
> ++ if (!init_state.wrote_return_column)
> + init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
> +
> + #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
> +diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
> +index 55fc4bc..37f0ae2 100644
> +--- a/libgcc/unwind-dw2.c
> ++++ b/libgcc/unwind-dw2.c
> +@@ -55,10 +55,6 @@
> + #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
> + #endif
> +
> +-#ifndef DWARF_REG_TO_UNWIND_COLUMN
> +-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
> +-#endif
> +-
> + /* ??? For the public function interfaces, we tend to gcc_assert that the
> + column numbers are in range. For the dwarf2 unwind info this does happen,
> + although so far in a case that doesn't actually matter.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 9:10 ` Jacob Kroon
@ 2015-01-13 2:09 ` Lei, Maohui
0 siblings, 0 replies; 12+ messages in thread
From: Lei, Maohui @ 2015-01-13 2:09 UTC (permalink / raw)
To: Jacob Kroon, Martin Jansa; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]
Hi Jacob, Martin
I think I brought back the old version things about the sysroot. I’m sorry.
It should be the following:
EXTRA_OECONF_PATHS = "\
--with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
--with-sysroot=/not/exist \
--with-build-sysroot=${STAGING_DIR_TARGET} \
"
From: Jacob Kroon [mailto:jacob.kroon@gmail.com]
Sent: Monday, January 12, 2015 5:11 PM
To: Lei, Maohui/雷 茂慧
Cc: openembedded-core
Subject: Re: [OE-core] [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
Hi,
On Mon, Jan 12, 2015 at 4:12 AM, Lei Maohui <leimaohui@cn.fujitsu.com<mailto:leimaohui@cn.fujitsu.com>> wrote:
<snip>
EXTRA_OECONF_PATHS = "\
- --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
- --with-sysroot=/not/exist \
+ --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \
+ --with-sysroot=${STAGING_DIR_TARGET} \
--with-build-sysroot=${STAGING_DIR_TARGET} \
"
Unless things have changed, the sysroot is supposed to be poisoned by default, see commit 04b725511a505c582a3abdf63d096967f0320779 in OE-Core.
[-- Attachment #2: Type: text/html, Size: 7625 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 9:18 ` Richard Purdie
@ 2015-01-13 2:19 ` Lei, Maohui
2015-01-13 10:17 ` Paul Eggleton
0 siblings, 1 reply; 12+ messages in thread
From: Lei, Maohui @ 2015-01-13 2:19 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core@lists.openembedded.org
Hi Richard
> I can't spot the upgrade from 4.9.1 to 4.9.2 in here. The SRC_URI checksums
> are unchanged for example? Is there part of the patch missing?
When I bitbake the gcc-4.9.2, there is no error or warning message about the checksums.
But it did wrong.
[downloads]$ md5sum gcc-4.9.2.tar.bz2 > gcc-4.9.2.tar.bz2.sum
[downloads]$ cat gcc-4.9.2.tar.bz2.sum
4df8ee253b7f3863ad0b86359cd39c43 gcc-4.9.2.tar.bz2
[downloads]$
I noticed that there is a file named "gcc-4.9.2.tar.bz2_bad-checksum_4df8ee253b7f3863ad0b86359cd39c43" in my download directory.
I don't know why. I think md5sum will be checked automatically.
Is it a bug?
Cheers,
Lei
> -----Original Message-----
> From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org]
> Sent: Monday, January 12, 2015 5:19 PM
> To: Lei, Maohui/雷 茂慧
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
>
> On Mon, 2015-01-12 at 11:12 +0800, Lei Maohui wrote:
> > fix the yocto bug #6824
> > backport from gcc
> >
> > Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> > ---
> > meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
> > ...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
> > .../0061-Fix-for-unwinder-aborts-on-e500.patch | 161
> +++++++++++++++++++++
> > 3 files changed, 180 insertions(+), 6 deletions(-) create mode
> > 100644
> > meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_S
> > IMD_REGNO_P-registers.patch create mode 100644
> > meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500
> > .patch
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > index 2568e99..c4ec40d 100644
> > --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > @@ -2,11 +2,11 @@ require gcc-common.inc
> >
> > # Third digit in PV should be incremented after a minor release
> >
> > -PV = "4.9.1"
> > +PV = "4.9.2"
> >
> > # BINV should be incremented to a revision after a minor gcc release
> >
> > -BINV = "4.9.1"
> > +BINV = "4.9.2"
>
> I can't spot the upgrade from 4.9.1 to 4.9.2 in here. The SRC_URI checksums
> are unchanged for example? Is there part of the patch missing?
>
> Cheers,
>
> Richard
>
> >
> > FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
> >
> > @@ -69,11 +69,11 @@ SRC_URI = "\
> > file://0051-eabispe.patch \
> >
> file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
> > file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
> > - file://0055-PR-rtl-optimization-61801.patch \
> > file://0056-top-level-reorder_gcc-bug-61144.patch \
> > - file://0057-aarch64-config.patch \
> > file://0058-gcc-r212171.patch \
> > file://0059-gcc-PR-rtl-optimization-63348.patch \
> > +
> file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
> > + file://0061-Fix-for-unwinder-aborts-on-e500.patch \
> > "
> > SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
> > SRC_URI[sha256sum] =
> "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
> > @@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
> > EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
> >
> > EXTRA_OECONF_PATHS = "\
> > - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> > - --with-sysroot=/not/exist \
> > +
> --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BIN
> V} \
> > + --with-sysroot=${STAGING_DIR_TARGET} \
> > --with-build-sysroot=${STAGING_DIR_TARGET} \ "
> >
> > diff --git
> > a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > _SIMD_REGNO_P-registers.patch
> > b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > _SIMD_REGNO_P-registers.patch
> > new file mode 100644
> > index 0000000..810ff90
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in
> > +++ -SPE_SIMD_REGNO_P-registers.patch
> > @@ -0,0 +1,13 @@
> > +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> > +index 512e7d6..292fb2c 100644
> > +--- a/gcc/config/rs6000/rs6000.c
> > ++++ b/gcc/config/rs6000/rs6000.c
> > +@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno, enum
> machine_mode mode)
> > + SCmode so as to pass the value correctly in a pair of
> > + registers. */
> > + else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
> > +- && !DECIMAL_FLOAT_MODE_P (mode))
> > ++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P
> > ++ (regno))
> > + reg_size = UNITS_PER_FP_WORD;
> > +
> > + else
> > diff --git
> > a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > 00.patch
> > b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > 00.patch
> > new file mode 100644
> > index 0000000..c37a4c3
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-o
> > +++ n-e500.patch
> > @@ -0,0 +1,161 @@
> > +diff --git a/gcc/defaults.h b/gcc/defaults.h index f94ae17..80a798f
> > +100644
> > +--- a/gcc/defaults.h
> > ++++ b/gcc/defaults.h
> > +@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME
> > +respectively. If not, see #define DWARF_FRAME_REGNUM(REG)
> > +DBX_REGISTER_NUMBER (REG) #endif
> > +
> > ++/* The mapping from dwarf CFA reg number to internal dwarf reg
> > ++numbers. */ #ifndef DWARF_REG_TO_UNWIND_COLUMN #define
> > ++DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) #endif
> > ++
> > + /* Map register numbers held in the call frame info that gcc has
> > + collected using DWARF_FRAME_REGNUM to those that should be output in
> > + .debug_frame and .eh_frame. */
> > +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index abcdeb3..4e59dfe
> > +100644
> > +--- a/gcc/dwarf2cfi.c
> > ++++ b/gcc/dwarf2cfi.c
> > +@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode, rtx
> mem, unsigned int c)
> > + gen_int_mode (size, mode));
> > + }
> > +
> > +-/* Generate code to initialize the register size table. */
> > ++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
> > ++ init_one_dwarf_reg_size to communicate on what has been done by the
> > ++ latter. */
> > ++
> > ++typedef struct
> > ++{
> > ++ /* Whether the dwarf return column was initialized. */
> > ++ bool wrote_return_column;
> > ++
> > ++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
> > ++ was given REGNO to process already. */ bool processed_regno
> > ++ [FIRST_PSEUDO_REGISTER];
> > ++
> > ++} init_one_dwarf_reg_state;
> > ++
> > ++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
> > ++ initialize the dwarf register size table entry corresponding to register
> > ++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode
> to
> > ++ use for the size entry to initialize, and INIT_STATE is the communication
> > ++ datastructure conveying what we're doing to our caller. */
> > ++
> > ++static
> > ++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
> > ++ rtx table, machine_mode slotmode,
> > ++ init_one_dwarf_reg_state *init_state) {
> > ++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
> > ++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > ++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
> > ++
> > ++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
> > ++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
> > ++
> > ++ init_state->processed_regno[regno] = true;
> > ++
> > ++ if (rnum >= DWARF_FRAME_REGISTERS)
> > ++ return;
> > ++
> > ++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > ++ {
> > ++ if (regmode == VOIDmode)
> > ++ return;
> > ++ init_state->wrote_return_column = true;
> > ++ }
> > ++
> > ++ if (slotoffset < 0)
> > ++ return;
> > ++
> > ++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
> > ++ gen_int_mode (regsize, slotmode)); }
> > ++
> > ++/* Generate code to initialize the dwarf register size table located
> > ++ at the provided ADDRESS. */
> > +
> > + void
> > + expand_builtin_init_dwarf_reg_sizes (tree address) @@ -261,37
> > ++314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
> > + enum machine_mode mode = TYPE_MODE (char_type_node);
> > + rtx addr = expand_normal (address);
> > + rtx mem = gen_rtx_MEM (BLKmode, addr);
> > +- bool wrote_return_column = false;
> > ++
> > ++ init_one_dwarf_reg_state init_state; memset ((char *)&init_state,
> > ++ 0, sizeof (init_state));
> > +
> > + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> > + {
> > +- unsigned int dnum = DWARF_FRAME_REGNUM (i);
> > +- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > ++ machine_mode save_mode;
> > ++ rtx span;
> > +
> > +- if (rnum < DWARF_FRAME_REGISTERS)
> > +- {
> > +- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
> > +- enum machine_mode save_mode = reg_raw_mode[i];
> > +- HOST_WIDE_INT size;
> > ++ /* No point in processing a register multiple times. This could
> happen
> > ++ with register spans, e.g. when a reg is first processed as a piece
> of
> > ++ a span, then as a register on its own later on. */
> > +
> > +- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > +- save_mode = choose_hard_reg_mode (i, 1, true);
> > +- if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > +- {
> > +- if (save_mode == VOIDmode)
> > +- continue;
> > +- wrote_return_column = true;
> > +- }
> > +- size = GET_MODE_SIZE (save_mode);
> > +- if (offset < 0)
> > +- continue;
> > ++ if (init_state.processed_regno[i])
> > ++ continue;
> > +
> > +- emit_move_insn (adjust_address (mem, mode, offset),
> > +- gen_int_mode (size, mode));
> > ++ save_mode = reg_raw_mode[i];
> > ++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > ++ save_mode = choose_hard_reg_mode (i, 1, true);
> > ++
> > ++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
> > ++ if (!span)
> > ++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
> > ++ else
> > ++ {
> > ++ for (int si = 0; si < XVECLEN (span, 0); si++)
> > ++ {
> > ++ rtx reg = XVECEXP (span, 0, si);
> > ++ init_one_dwarf_reg_size
> > ++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
> > ++ }
> > + }
> > + }
> > +
> > +- if (!wrote_return_column)
> > ++ if (!init_state.wrote_return_column)
> > + init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
> > +
> > + #ifdef DWARF_ALT_FRAME_RETURN_COLUMN diff --git
> > +a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c index 55fc4bc..37f0ae2
> > +100644
> > +--- a/libgcc/unwind-dw2.c
> > ++++ b/libgcc/unwind-dw2.c
> > +@@ -55,10 +55,6 @@
> > + #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS #endif
> > +
> > +-#ifndef DWARF_REG_TO_UNWIND_COLUMN
> > +-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) -#endif
> > +-
> > + /* ??? For the public function interfaces, we tend to gcc_assert that the
> > + column numbers are in range. For the dwarf2 unwind info this does happen,
> > + although so far in a case that doesn't actually matter.
> > --
> > 1.8.4.2
> >
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-12 12:38 ` Peter A. Bigot
@ 2015-01-13 2:39 ` Lei, Maohui
0 siblings, 0 replies; 12+ messages in thread
From: Lei, Maohui @ 2015-01-13 2:39 UTC (permalink / raw)
To: Peter A. Bigot, openembedded-core@lists.openembedded.org
Hi Peter
> As gcc is (IMO) one of the most critical components of Yocto I think we need
> to be very clear about what changes are being made to it and why.
>
Yes ,It does.
> In addition to missing SOB lines, these patches at a minimum should reference
> the upstream bug that they supposedly patch. That would be
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63908
I got it.
>
> Ideally, the patch would be taken from upstream, being created by
> git-format-patch with the SHA1 of the relevant change as retrieved from:
> git://gcc.gnu.org/git/gcc.git
Yes, but the patches created by git-format-patch from upstream can't be applied to 4.9 branch directly.
I tried to backport the patches to 4.9.1 for minimum patch, But I failed.
>
> It worries me that these patches, though present in upstream trunk, have not
> been back-ported to gcc-4_9-branch. There may be a reason for that, and the
> fact backports have not (yet) been done should be noted in the OE patch header.
It does make sense. I hope these patches can be backported to gcc-4_9-branch by gcc member.
But I didn't get the answer from gcc Bugzilla.
I think the https://bugzilla.yoctoproject.org/show_bug.cgi?id=6824 is a a serious bug. So I did it by myself. :)
Cheers,
Lei
> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Peter
> A. Bigot
> Sent: Monday, January 12, 2015 8:38 PM
> To: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
>
> On 01/11/2015 09:12 PM, Lei Maohui wrote:
> > fix the yocto bug #6824
> > backport from gcc
> >
> > Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
> > ---
> > meta/recipes-devtools/gcc/gcc-4.9.inc | 12 +-
> > ...e500-double-in-SPE_SIMD_REGNO_P-registers.patch | 13 ++
> > .../0061-Fix-for-unwinder-aborts-on-e500.patch | 161
> +++++++++++++++++++++
> > 3 files changed, 180 insertions(+), 6 deletions(-)
> > create mode 100644
> meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_
> REGNO_P-registers.patch
> > create mode 100644
> > meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e500
> > .patch
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > index 2568e99..c4ec40d 100644
> > --- a/meta/recipes-devtools/gcc/gcc-4.9.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
> > @@ -2,11 +2,11 @@ require gcc-common.inc
> >
> > # Third digit in PV should be incremented after a minor release
> >
> > -PV = "4.9.1"
> > +PV = "4.9.2"
> >
> > # BINV should be incremented to a revision after a minor gcc release
> >
> > -BINV = "4.9.1"
> > +BINV = "4.9.2"
> >
> > FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
> >
> > @@ -69,11 +69,11 @@ SRC_URI = "\
> > file://0051-eabispe.patch \
> >
> file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
> > file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
> > - file://0055-PR-rtl-optimization-61801.patch \
> > file://0056-top-level-reorder_gcc-bug-61144.patch \
> > - file://0057-aarch64-config.patch \
> > file://0058-gcc-r212171.patch \
> > file://0059-gcc-PR-rtl-optimization-63348.patch \
> > +
> file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
> > + file://0061-Fix-for-unwinder-aborts-on-e500.patch \
> > "
> > SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
> > SRC_URI[sha256sum] =
> "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
> > @@ -125,8 +125,8 @@ EXTRA_OECONF_INTERMEDIATE = "\
> > EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
> >
> > EXTRA_OECONF_PATHS = "\
> > - --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
> > - --with-sysroot=/not/exist \
> > +
> --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BIN
> V} \
> > + --with-sysroot=${STAGING_DIR_TARGET} \
> > --with-build-sysroot=${STAGING_DIR_TARGET} \
> > "
> >
> > diff --git
> > a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > _SIMD_REGNO_P-registers.patch
> > b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE
> > _SIMD_REGNO_P-registers.patch
>
> As gcc is (IMO) one of the most critical components of Yocto I think we need
> to be very clear about what changes are being made to it and why.
>
> In addition to missing SOB lines, these patches at a minimum should reference
> the upstream bug that they supposedly patch. That would be
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63908
>
> Ideally, the patch would be taken from upstream, being created by
> git-format-patch with the SHA1 of the relevant change as retrieved from:
> git://gcc.gnu.org/git/gcc.git
>
> It worries me that these patches, though present in upstream trunk, have not
> been back-ported to gcc-4_9-branch. There may be a reason for that, and the
> fact backports have not (yet) been done should be noted in the OE patch header.
>
> This first patch is apparently upstream commit
> 5c0092070253113cf0d9c45eacc884b3ecc34d81.
>
> > new file mode 100644
> > index 0000000..810ff90
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in
> > +++ -SPE_SIMD_REGNO_P-registers.patch
> > @@ -0,0 +1,13 @@
> > +diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> > +index 512e7d6..292fb2c 100644
> > +--- a/gcc/config/rs6000/rs6000.c
> > ++++ b/gcc/config/rs6000/rs6000.c
> > +@@ -1704,7 +1704,7 @@ rs6000_hard_regno_nregs_internal (int regno, enum
> machine_mode mode)
> > + SCmode so as to pass the value correctly in a pair of
> > + registers. */
> > + else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
> > +- && !DECIMAL_FLOAT_MODE_P (mode))
> > ++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P
> > ++ (regno))
> > + reg_size = UNITS_PER_FP_WORD;
> > +
> > + else
> > diff --git
> > a/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > 00.patch
> > b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-on-e5
> > 00.patch
> > new file mode 100644
>
> This patch appears to combine c0235a33de8c4f78cce35b2a8c2035c83fe1bd14
> with 4fd39f1329379e00f958394adde6be96f0caf21f.
>
> > index 0000000..c37a4c3
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-Fix-for-unwinder-aborts-o
> > +++ n-e500.patch
> > @@ -0,0 +1,161 @@
> > +diff --git a/gcc/defaults.h b/gcc/defaults.h index f94ae17..80a798f
> > +100644
> > +--- a/gcc/defaults.h
> > ++++ b/gcc/defaults.h
> > +@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTIME
> > +respectively. If not, see #define DWARF_FRAME_REGNUM(REG)
> > +DBX_REGISTER_NUMBER (REG) #endif
> > +
> > ++/* The mapping from dwarf CFA reg number to internal dwarf reg
> > ++numbers. */ #ifndef DWARF_REG_TO_UNWIND_COLUMN #define
> > ++DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) #endif
> > ++
> > + /* Map register numbers held in the call frame info that gcc has
> > + collected using DWARF_FRAME_REGNUM to those that should be output in
> > + .debug_frame and .eh_frame. */
> > +diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index abcdeb3..4e59dfe
> > +100644
> > +--- a/gcc/dwarf2cfi.c
> > ++++ b/gcc/dwarf2cfi.c
> > +@@ -252,7 +252,60 @@ init_return_column_size (enum machine_mode mode, rtx
> mem, unsigned int c)
> > + gen_int_mode (size, mode));
> > + }
> > +
> > +-/* Generate code to initialize the register size table. */
> > ++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
> > ++ init_one_dwarf_reg_size to communicate on what has been done by the
> > ++ latter. */
> > ++
> > ++typedef struct
> > ++{
> > ++ /* Whether the dwarf return column was initialized. */
> > ++ bool wrote_return_column;
> > ++
> > ++ /* For each hard register REGNO, whether init_one_dwarf_reg_size
> > ++ was given REGNO to process already. */ bool processed_regno
> > ++ [FIRST_PSEUDO_REGISTER];
> > ++
> > ++} init_one_dwarf_reg_state;
> > ++
> > ++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
> > ++ initialize the dwarf register size table entry corresponding to register
> > ++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode
> to
> > ++ use for the size entry to initialize, and INIT_STATE is the communication
> > ++ datastructure conveying what we're doing to our caller. */
> > ++
> > ++static
> > ++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
> > ++ rtx table, machine_mode slotmode,
> > ++ init_one_dwarf_reg_state *init_state) {
> > ++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
> > ++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > ++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
> > ++
> > ++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
> > ++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
> > ++
> > ++ init_state->processed_regno[regno] = true;
> > ++
> > ++ if (rnum >= DWARF_FRAME_REGISTERS)
> > ++ return;
> > ++
> > ++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > ++ {
> > ++ if (regmode == VOIDmode)
> > ++ return;
> > ++ init_state->wrote_return_column = true;
> > ++ }
> > ++
> > ++ if (slotoffset < 0)
> > ++ return;
> > ++
> > ++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
> > ++ gen_int_mode (regsize, slotmode)); }
> > ++
> > ++/* Generate code to initialize the dwarf register size table located
> > ++ at the provided ADDRESS. */
> > +
> > + void
> > + expand_builtin_init_dwarf_reg_sizes (tree address) @@ -261,37
> > ++314,41 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
> > + enum machine_mode mode = TYPE_MODE (char_type_node);
> > + rtx addr = expand_normal (address);
> > + rtx mem = gen_rtx_MEM (BLKmode, addr);
> > +- bool wrote_return_column = false;
> > ++
> > ++ init_one_dwarf_reg_state init_state; memset ((char *)&init_state,
> > ++ 0, sizeof (init_state));
> > +
> > + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> > + {
> > +- unsigned int dnum = DWARF_FRAME_REGNUM (i);
> > +- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
> > ++ machine_mode save_mode;
> > ++ rtx span;
> > +
> > +- if (rnum < DWARF_FRAME_REGISTERS)
> > +- {
> > +- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
> > +- enum machine_mode save_mode = reg_raw_mode[i];
> > +- HOST_WIDE_INT size;
> > ++ /* No point in processing a register multiple times. This could
> happen
> > ++ with register spans, e.g. when a reg is first processed as a piece
> of
> > ++ a span, then as a register on its own later on. */
> > +
> > +- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > +- save_mode = choose_hard_reg_mode (i, 1, true);
> > +- if (dnum == DWARF_FRAME_RETURN_COLUMN)
> > +- {
> > +- if (save_mode == VOIDmode)
> > +- continue;
> > +- wrote_return_column = true;
> > +- }
> > +- size = GET_MODE_SIZE (save_mode);
> > +- if (offset < 0)
> > +- continue;
> > ++ if (init_state.processed_regno[i])
> > ++ continue;
> > +
> > +- emit_move_insn (adjust_address (mem, mode, offset),
> > +- gen_int_mode (size, mode));
> > ++ save_mode = reg_raw_mode[i];
> > ++ if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
> > ++ save_mode = choose_hard_reg_mode (i, 1, true);
> > ++
> > ++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
> > ++ if (!span)
> > ++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
> > ++ else
> > ++ {
> > ++ for (int si = 0; si < XVECLEN (span, 0); si++)
> > ++ {
> > ++ rtx reg = XVECEXP (span, 0, si);
> > ++ init_one_dwarf_reg_size
> > ++ (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
> > ++ }
> > + }
> > + }
> > +
> > +- if (!wrote_return_column)
> > ++ if (!init_state.wrote_return_column)
> > + init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
> > +
> > + #ifdef DWARF_ALT_FRAME_RETURN_COLUMN diff --git
> > +a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c index 55fc4bc..37f0ae2
> > +100644
> > +--- a/libgcc/unwind-dw2.c
> > ++++ b/libgcc/unwind-dw2.c
> > +@@ -55,10 +55,6 @@
> > + #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS #endif
> > +
> > +-#ifndef DWARF_REG_TO_UNWIND_COLUMN
> > +-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO) -#endif
> > +-
> > + /* ??? For the public function interfaces, we tend to gcc_assert that the
> > + column numbers are in range. For the dwarf2 unwind info this does happen,
> > + although so far in a case that doesn't actually matter.
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-13 2:19 ` Lei, Maohui
@ 2015-01-13 10:17 ` Paul Eggleton
2015-01-13 12:39 ` Burton, Ross
0 siblings, 1 reply; 12+ messages in thread
From: Paul Eggleton @ 2015-01-13 10:17 UTC (permalink / raw)
To: Lei, Maohui; +Cc: openembedded-core
Hi Lei,
On Tuesday 13 January 2015 02:19:55 Lei, Maohui wrote:
> > I can't spot the upgrade from 4.9.1 to 4.9.2 in here. The SRC_URI
> > checksums are unchanged for example? Is there part of the patch missing?
>
> When I bitbake the gcc-4.9.2, there is no error or warning message about the
> checksums. But it did wrong.
> [downloads]$ md5sum gcc-4.9.2.tar.bz2 > gcc-4.9.2.tar.bz2.sum
> [downloads]$ cat gcc-4.9.2.tar.bz2.sum
> 4df8ee253b7f3863ad0b86359cd39c43 gcc-4.9.2.tar.bz2
> [downloads]$
>
> I noticed that there is a file named
> "gcc-4.9.2.tar.bz2_bad-checksum_4df8ee253b7f3863ad0b86359cd39c43" in my
> download directory. I don't know why.
This will be from the first fetch you had with the old checksums.
> I think md5sum will be checked automatically. Is it a bug?
Once a file has been successfully downloaded and checksums matched once (and
the .done file has been written), they won't be checked again for that file. Did
you perhaps update the checksum in one of the gcc recipes and not some of the
others? If so, that would explain this situation.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824
2015-01-13 10:17 ` Paul Eggleton
@ 2015-01-13 12:39 ` Burton, Ross
0 siblings, 0 replies; 12+ messages in thread
From: Burton, Ross @ 2015-01-13 12:39 UTC (permalink / raw)
To: Paul Eggleton; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 359 bytes --]
On 13 January 2015 at 10:17, Paul Eggleton <paul.eggleton@linux.intel.com>
wrote:
> Once a file has been successfully downloaded and checksums matched once
> (and
> the .done file has been written), they won't be checked again for that
> file.
>
There's a patch to change that behaviour which I promised to review... I'll
dig it out now.
Ross
[-- Attachment #2: Type: text/html, Size: 778 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-01-13 12:39 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12 3:12 [PATCH] gcc: upgrade to 4.9.2 and fix the bug #6824 Lei Maohui
2015-01-12 4:08 ` akuster808
2015-01-12 4:18 ` Lei, Maohui
2015-01-12 9:07 ` Martin Jansa
2015-01-12 9:10 ` Jacob Kroon
2015-01-13 2:09 ` Lei, Maohui
2015-01-12 9:18 ` Richard Purdie
2015-01-13 2:19 ` Lei, Maohui
2015-01-13 10:17 ` Paul Eggleton
2015-01-13 12:39 ` Burton, Ross
2015-01-12 12:38 ` Peter A. Bigot
2015-01-13 2:39 ` Lei, Maohui
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.