* [Bug target/65151] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
@ 2015-02-21 13:29 ` olegendo at gcc dot gnu.org
2015-02-21 14:16 ` glaubitz at physik dot fu-berlin.de
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-21 13:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |olegendo at gcc dot gnu.org
--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to John Paul Adrian Glaubitz from comment #0)
>
> I am attaching the preproccesed source file cchMsw9Z.out to this bugreport.
>
There are no attachments in this PR. Could you please check again?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
2015-02-21 13:29 ` [Bug target/65151] " olegendo at gcc dot gnu.org
@ 2015-02-21 14:16 ` glaubitz at physik dot fu-berlin.de
2015-02-21 14:47 ` [Bug target/65151] [SH][4.9 Regression] " olegendo at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-02-21 14:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #2 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
Created attachment 34822
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34822&action=edit
Pre-compiled source file for libav 11.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
2015-02-21 13:29 ` [Bug target/65151] " olegendo at gcc dot gnu.org
2015-02-21 14:16 ` glaubitz at physik dot fu-berlin.de
@ 2015-02-21 14:47 ` olegendo at gcc dot gnu.org
2015-02-21 21:29 ` olegendo at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-21 14:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-02-21
Summary|Internal compiler error |[SH][4.9 Regression]
|when trying to build libav |Internal compiler error
|11.2 on sh4 |when trying to build libav
| |11.2 on sh4
Ever confirmed|0 |1
--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> ---
I was able to reproduce the problem on 4.9 branch sh-elf with -m4 -ml -O3.
On trunk (GCC 5) it seems not to happen.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (2 preceding siblings ...)
2015-02-21 14:47 ` [Bug target/65151] [SH][4.9 Regression] " olegendo at gcc dot gnu.org
@ 2015-02-21 21:29 ` olegendo at gcc dot gnu.org
2015-02-21 23:09 ` olegendo at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-21 21:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> ---
The problem is the following insn:
(insn 45 11 12 2 (set (reg:HI 168 [ x ])
(subreg/s/u:HI (reg:SI 147 t) 0)) cchMsw9Z.out:9 -1
(expr_list:REG_DEAD (reg:SI 147 t)
(nil)))
which is not in sh.md.
The insn is created by the asmcons pass.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (3 preceding siblings ...)
2015-02-21 21:29 ` olegendo at gcc dot gnu.org
@ 2015-02-21 23:09 ` olegendo at gcc dot gnu.org
2015-02-21 23:26 ` olegendo at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-21 23:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #6 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #5)
> The problem is the following insn:
>
> (insn 45 11 12 2 (set (reg:HI 168 [ x ])
> (subreg/s/u:HI (reg:SI 147 t) 0)) cchMsw9Z.out:9 -1
> (expr_list:REG_DEAD (reg:SI 147 t)
> (nil)))
>
> which is not in sh.md.
> The insn is created by the asmcons pass.
More precisely, it's 'emit_move_insn' in gcc/function.c in function
match_asm_constraints_1 at line 7152.
BTW, the test case from attachment 34825 also fails at -O1, -O2 and -Os.
On current trunk (GCC 5), the problem doesn't happen due to the treg_set_expr
stuff that has been recently added, it seems.
After combine, the insns are:
(insn 11 8 12 2 (parallel [
(set (reg/v:SI 163 [ x ])
(eq:SI (reg:SI 6 r6 [ bits_per_component ])
(const_int 10 [0xa])))
(clobber (reg:SI 147 t))
]) 410 {any_treg_expr_to_reg}
(expr_list:REG_UNUSED (reg:SI 147 t)
(expr_list:REG_DEAD (reg:SI 6 r6 [ bits_per_component ])
(nil))))
(insn 12 11 13 2 (set (reg:HI 170 [ x ])
(asm_operands:HI ("swap.b %0,%0") ("=r") 0 [
(subreg/s/v:HI (reg/v:SI 163 [ x ]) 0)
]
[
(asm_input:HI ("0") cchMsw9Z.out:8)
]
[] cchMsw9Z.out:8)) cchMsw9Z.out:8 -1
(expr_list:REG_DEAD (reg/v:SI 163 [ x ])
(nil)))
Which is then converted by the treg_set_expr splitter code during the split1
pass into:
(insn 52 8 53 2 (set (reg:SI 147 t)
(eq:SI (reg:SI 6 r6 [ bits_per_component ])
(const_int 10 [0xa]))) -1
(nil))
(insn 53 52 12 2 (set (reg/v:SI 163 [ x ])
(reg:SI 147 t)) -1
(expr_list:REG_UNUSED (reg:SI 147 t)
(nil)))
(insn 12 53 13 2 (set (reg:HI 170 [ x ])
(asm_operands:HI ("swap.b %0,%0") ("=r") 0 [
(subreg/s/v:HI (reg/v:SI 163 [ x ]) 0)
]
[
(asm_input:HI ("0") cchMsw9Z.out:8)
]
[] cchMsw9Z.out:8)) cchMsw9Z.out:8 -1
(expr_list:REG_DEAD (reg/v:SI 163 [ x ])
(nil)))
In asmcons, emit_move_insn then adds the following insn:
(insn 58 53 12 2 (set (reg:HI 170 [ x ])
(subreg/s/v:HI (reg/v:SI 163 [ x ]) 0)) cchMsw9Z.out:8 -1
(nil))
from there on everything works out.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (4 preceding siblings ...)
2015-02-21 23:09 ` olegendo at gcc dot gnu.org
@ 2015-02-21 23:26 ` olegendo at gcc dot gnu.org
2015-02-22 14:17 ` olegendo at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-21 23:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> ---
The following fixes the problem:
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c (revision 220889)
+++ gcc/config/sh/sh.c (working copy)
@@ -12049,6 +12049,9 @@
bool
sh_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
{
+ if (regno == T_REG)
+ return mode == SImode || mode == HImode || mode == QImode;
+
if (SPECIAL_REGISTER_P (regno))
return mode == SImode;
Index: gcc/config/sh/sh.md
===================================================================
--- gcc/config/sh/sh.md (revision 220889)
+++ gcc/config/sh/sh.md (working copy)
@@ -11224,6 +11224,13 @@
"movt %0"
[(set_attr "type" "arith")])
+(define_insn "*movt"
+ [(set (match_operand:QIHI 0 "arith_reg_dest" "=r")
+ (match_operand:QIHI 1 "t_reg_operand"))]
+ "TARGET_SH1"
+ "movt %0"
+ [(set_attr "type" "arith")])
+
(define_insn "movrt"
[(set (match_operand:SI 0 "arith_reg_dest" "=r")
(xor:SI (match_operand:SI 1 "t_reg_operand" "") (const_int 1)))]
However, I've not tested it for any further side effects.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (5 preceding siblings ...)
2015-02-21 23:26 ` olegendo at gcc dot gnu.org
@ 2015-02-22 14:17 ` olegendo at gcc dot gnu.org
2015-02-23 0:00 ` kkojima at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: olegendo at gcc dot gnu.org @ 2015-02-22 14:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kkojima at gcc dot gnu.org
--- Comment #8 from Oleg Endo <olegendo at gcc dot gnu.org> ---
I've also tried to see if the movrt pattern on SH2A has the same problem. But
the only thing that seems to trigger it is a movt. The patch in c#7 could also
be applied to trunk, just in case. But I'm not sure if we should do so,
because on trunk the problem doesn't happen and I actually don't like the hunk
for sh_hard_regno_mode_ok, as everything in the backend treats T_REG as SImode.
Kaz, do you have any opinions?
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (6 preceding siblings ...)
2015-02-22 14:17 ` olegendo at gcc dot gnu.org
@ 2015-02-23 0:00 ` kkojima at gcc dot gnu.org
2015-02-23 11:07 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kkojima at gcc dot gnu.org @ 2015-02-23 0:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #9 from Kazumoto Kojima <kkojima at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #8)
> I've also tried to see if the movrt pattern on SH2A has the same problem.
> But the only thing that seems to trigger it is a movt. The patch in c#7
> could also be applied to trunk, just in case. But I'm not sure if we should
> do so, because on trunk the problem doesn't happen and I actually don't like
> the hunk for sh_hard_regno_mode_ok, as everything in the backend treats
> T_REG as SImode.
> Kaz, do you have any opinions?
I have no idea other than that.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (7 preceding siblings ...)
2015-02-23 0:00 ` kkojima at gcc dot gnu.org
@ 2015-02-23 11:07 ` rguenth at gcc dot gnu.org
2015-06-26 19:59 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-02-23 11:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Target Milestone|--- |4.9.3
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (8 preceding siblings ...)
2015-02-23 11:07 ` rguenth at gcc dot gnu.org
@ 2015-06-26 19:59 ` jakub at gcc dot gnu.org
2015-06-26 20:30 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 19:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (9 preceding siblings ...)
2015-06-26 19:59 ` jakub at gcc dot gnu.org
@ 2015-06-26 20:30 ` jakub at gcc dot gnu.org
2015-08-08 14:54 ` thomas.petazzoni@free-electrons.com
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.9.3 |4.9.4
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (10 preceding siblings ...)
2015-06-26 20:30 ` jakub at gcc dot gnu.org
@ 2015-08-08 14:54 ` thomas.petazzoni@free-electrons.com
2015-08-08 15:09 ` glaubitz at physik dot fu-berlin.de
2015-08-08 15:24 ` thomas.petazzoni@free-electrons.com
13 siblings, 0 replies; 15+ messages in thread
From: thomas.petazzoni@free-electrons.com @ 2015-08-08 14:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |thomas.petazzoni@free-elect
| |rons.com
--- Comment #11 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> ---
(In reply to Jakub Jelinek from comment #10)
> GCC 4.9.3 has been released.
This problem still occurs with GCC 4.9.3, as far as I can see.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (11 preceding siblings ...)
2015-08-08 14:54 ` thomas.petazzoni@free-electrons.com
@ 2015-08-08 15:09 ` glaubitz at physik dot fu-berlin.de
2015-08-08 15:24 ` thomas.petazzoni@free-electrons.com
13 siblings, 0 replies; 15+ messages in thread
From: glaubitz at physik dot fu-berlin.de @ 2015-08-08 15:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #12 from John Paul Adrian Glaubitz <glaubitz at physik dot fu-berlin.de> ---
(In reply to Thomas Petazzoni from comment #11)
> (In reply to Jakub Jelinek from comment #10)
> > GCC 4.9.3 has been released.
>
> This problem still occurs with GCC 4.9.3, as far as I can see.
I'm actually not sure. There have been many changes to the SH backend ever
since and as Debian moved from libav to ffmpeg as the default library, I
haven't had a chance to test-build libav for a long time.
That will happen in the near future though, so thanks for reminding us of this
bug.
Adrian
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4
2015-02-21 4:48 [Bug c/65151] New: Internal compiler error when trying to build libav 11.2 on sh4 glaubitz at physik dot fu-berlin.de
` (12 preceding siblings ...)
2015-08-08 15:09 ` glaubitz at physik dot fu-berlin.de
@ 2015-08-08 15:24 ` thomas.petazzoni@free-electrons.com
13 siblings, 0 replies; 15+ messages in thread
From: thomas.petazzoni@free-electrons.com @ 2015-08-08 15:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151
--- Comment #13 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> ---
(In reply to John Paul Adrian Glaubitz from comment #12)
> (In reply to Thomas Petazzoni from comment #11)
> > (In reply to Jakub Jelinek from comment #10)
> > > GCC 4.9.3 has been released.
> >
> > This problem still occurs with GCC 4.9.3, as far as I can see.
>
> I'm actually not sure. There have been many changes to the SH backend ever
> since and as Debian moved from libav to ffmpeg as the default library, I
> haven't had a chance to test-build libav for a long time.
I am quite sure, see
http://autobuild.buildroot.org/results/09b/09b08d329e632365dd8371371706dbeaa10539a3/build-end.log:
libavcodec/dpxenc.c: In function 'encode_frame':
libavcodec/dpxenc.c:162:1: internal compiler error: in
elimination_costs_in_insn, at reload1.c:3638
The toolchain, available at
http://autobuild.buildroot.org/toolchains/tarballs/br-sh4-full-2015.05-496-g85945aa.tar.bz2,
uses gcc 4.9.3.
^ permalink raw reply [flat|nested] 15+ messages in thread