* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
@ 2012-08-16 23:23 ` ubizjak at gmail dot com
2012-08-16 23:25 ` ubizjak at gmail dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2012-08-16 23:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
--- Comment #1 from Uros Bizjak <ubizjak at gmail dot com> 2012-08-16 23:23:39 UTC ---
Created attachment 28040
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28040
Preprocessed source of the object file that triggers comparison failure
~/gcc-build/stage1-gcc/xgcc -B ~/gcc-build/stage1-gcc -O2 -fno-exceptions
-fno-rtti -fno-common -fcompare-debug cprop.ii
xgcc: error: cprop.ii: -fcompare-debug failure (length)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
2012-08-16 23:23 ` [Bug rtl-optimization/54294] " ubizjak at gmail dot com
@ 2012-08-16 23:25 ` ubizjak at gmail dot com
2012-08-17 8:10 ` ubizjak at gmail dot com
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2012-08-16 23:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
Uros Bizjak <ubizjak at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aoliva at gcc dot gnu.org,
| |steven at gcc dot gnu.org
--- Comment #2 from Uros Bizjak <ubizjak at gmail dot com> 2012-08-16 23:25:30 UTC ---
Adding come CCs that might be interested in this issue.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
2012-08-16 23:23 ` [Bug rtl-optimization/54294] " ubizjak at gmail dot com
2012-08-16 23:25 ` ubizjak at gmail dot com
@ 2012-08-17 8:10 ` ubizjak at gmail dot com
2012-08-17 8:39 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2012-08-17 8:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2012-08-17 08:10:07 UTC ---
(In reply to comment #1)
> Created attachment 28040 [details]
> Preprocessed source of the object file that triggers comparison failure
>
> ~/gcc-build/stage1-gcc/xgcc -B ~/gcc-build/stage1-gcc -O2 -fno-exceptions
> -fno-rtti -fno-common -fcompare-debug cprop.ii
> xgcc: error: cprop.ii: -fcompare-debug failure (length)
Adding -fno-forward-propagate to the above flags fixes compare-debug failure.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (2 preceding siblings ...)
2012-08-17 8:10 ` ubizjak at gmail dot com
@ 2012-08-17 8:39 ` jakub at gcc dot gnu.org
2012-08-17 10:06 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-17 8:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-08-17
CC| |jakub at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-17 08:39:24 UTC ---
Looking into it.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (3 preceding siblings ...)
2012-08-17 8:39 ` jakub at gcc dot gnu.org
@ 2012-08-17 10:06 ` jakub at gcc dot gnu.org
2012-08-17 10:29 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-17 10:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bonzini at gnu dot org
Target Milestone|--- |4.8.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (4 preceding siblings ...)
2012-08-17 10:06 ` jakub at gcc dot gnu.org
@ 2012-08-17 10:29 ` jakub at gcc dot gnu.org
2012-08-17 11:15 ` ubizjak at gmail dot com
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-17 10:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-17 10:29:20 UTC ---
Created attachment 28041
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28041
gcc48-pr54294.patch
Seems my other PR42728 patch fixes the -fcompare-debug failure and is IMHO
desirable in any case. What is going on here is that we have:
(insn 14254 14253 512 423 (set (reg:DI 1196 [ ei ])
(sign_extend:DI (subreg:SI (reg:DI 1196 [ ei ]) 0))) 2 {*extendsidi2_1}
(nil))
insn where (subreg:SI (reg:DI 1196 [ ei ]) 0) is replaced by (reg:SI 2915).
But fwprop is df_set_flags (DF_DEFER_INSN_RESCAN);. When replacing the next
insn,
which without -g turns to be another set, but with -g there are several debug
insns in between and next insn is the first of them, we take a shortcut. As
rescan is deferred, we see both 1196 and 2915 regs as "uses" of def_insn. The
shortcut performs a rtx_equal_p check on DF_REF_REG (use) which fails though,
as DF_REF_REG (use) is the subreg, thus we replace the subreg in the
immediately following insn. But when trying to replace it in following debug
insns and with -g in the first following non-debug insn, it is not NEXT_INSN,
shortcut is not taken and we do both the rtx_equal_p check (fine, DF_REF_REG is
again a subreg), but also do use_killed_between including def_insn, and that
calls local_ref_killed_between_p, which compares DF_REF_REGNO instead of using
rtx_equal_p and therefore says that the (already non-existing) use in def_insn
is killed by the set in the def_insn.
So, IMHO we should possibly replace the rtx_equal_p checks with simple
DF_REF_REGNO comparisons instead, which will be more conservatively correct,
but we risk code quality regressions.
So, perhaps another thing to do could be that when walking uses of def_insn in
all_uses_available_at, we'd double check if the reg in question is really still
used in the insn pattern (perhaps conditionally on whether the insn is still
marked for rescanning or not).
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (5 preceding siblings ...)
2012-08-17 10:29 ` jakub at gcc dot gnu.org
@ 2012-08-17 11:15 ` ubizjak at gmail dot com
2012-08-17 14:26 ` ubizjak at gmail dot com
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2012-08-17 11:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
--- Comment #6 from Uros Bizjak <ubizjak at gmail dot com> 2012-08-17 11:14:45 UTC ---
(In reply to comment #5)
> Created attachment 28041 [details]
> gcc48-pr54294.patch
This patch fixes the debug-compare failure with testcase on alpha. I am running
bootstrap now.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (6 preceding siblings ...)
2012-08-17 11:15 ` ubizjak at gmail dot com
@ 2012-08-17 14:26 ` ubizjak at gmail dot com
2012-08-17 19:50 ` ubizjak at gmail dot com
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2012-08-17 14:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
--- Comment #7 from Uros Bizjak <ubizjak at gmail dot com> 2012-08-17 14:25:52 UTC ---
(In reply to comment #6)
> (In reply to comment #5)
> > Created attachment 28041 [details]
> > gcc48-pr54294.patch
>
> This patch fixes the debug-compare failure with testcase on alpha. I am running
> bootstrap now.
Bootstrap finished OK, all interesting regression test passed on
alphaev68-unknown-linux-gnu.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (7 preceding siblings ...)
2012-08-17 14:26 ` ubizjak at gmail dot com
@ 2012-08-17 19:50 ` ubizjak at gmail dot com
2012-08-20 18:57 ` jakub at gcc dot gnu.org
2012-08-20 18:58 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2012-08-17 19:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
--- Comment #8 from Uros Bizjak <ubizjak at gmail dot com> 2012-08-17 19:50:10 UTC ---
(In reply to comment #7)
> Bootstrap finished OK, all interesting regression test passed on
> alphaev68-unknown-linux-gnu.
Regression test is also ok [1].
[1] http://gcc.gnu.org/ml/gcc-testresults/2012-08/msg01654.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (8 preceding siblings ...)
2012-08-17 19:50 ` ubizjak at gmail dot com
@ 2012-08-20 18:57 ` jakub at gcc dot gnu.org
2012-08-20 18:58 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-20 18:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-20 18:56:58 UTC ---
Author: jakub
Date: Mon Aug 20 18:56:49 2012
New Revision: 190541
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190541
Log:
PR rtl-optimization/54294
* fwprop.c (all_uses_available_at): Ignore debug insns in between
def_insn and target_insn when checking whether the shortcut is
possible.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fwprop.c
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug rtl-optimization/54294] [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns
2012-08-16 23:20 [Bug rtl-optimization/54294] New: [4.8 Regression]: [alpha] Bootstrap comparison failure due to fwprop handling of debug insns ubizjak at gmail dot com
` (9 preceding siblings ...)
2012-08-20 18:57 ` jakub at gcc dot gnu.org
@ 2012-08-20 18:58 ` jakub at gcc dot gnu.org
10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-08-20 18:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54294
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-08-20 18:58:24 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread