This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, testsuite] Remove bad test gcc.dg/pr35729.c
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Steve Ellcey <sje at cup dot hp dot com>, Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>, Richard Guenther <richard dot guenther at gmail dot com>
- Date: Wed, 21 Jan 2009 22:02:48 +0100
- Subject: Re: [patch, testsuite] Remove bad test gcc.dg/pr35729.c
Hello!
> I would like to propose removing the test gcc.dg/pr35729.c. The bug
> reported by 35729 has been fixed and seems to be fine but the test that
> was added for it is failing on multiple systems.
>
> The code change that this test is checking is to make sure that we do
> not hoist assigments from volatile variables out of a loop and the test
> tries to check this by checking that we do not see 'Decided to move
> invariant' in the dump loop-invariant dump file, the problem is that
> there are invariant statements that can and do get hoisted out of the
> loop so we see this statement in the dump file and fail the test.
what are the statements that are moved out of the loop? Can the test
be modified to avoid these statements?
On alpha, HIGH part of HIGH/LO_SUM split address in moved out of the loop:
Set in insn 22 is invariant (0), cost 6, depends on
Set in insn 10 is invariant (1), cost 6, depends on
Decided to move invariant 0
Decided to move invariant 1
...
(insn 22 6 10 2 pr35729.c:8 (set (reg/f:DI 83)
(high:DI (symbol_ref:DI ("g_2") [flags 0x6] <var_decl
0x7f9d4c190640 g_2>))) 252 {*movdi_er_nofix} (nil))
(insn 10 22 25 2 pr35729.c:10 (set (reg/f:DI 84)
(high:DI (symbol_ref:DI ("g_361") [flags 0x6] <var_decl
0x7f9d4c1905a0 g_361>))) 252 {*movdi_er_nofix} (nil))
...
... (loop starts here) ...
...
(insn 11 39 14 3 pr35729.c:10 (set (reg:SI 75 [ g_361 ])
(mem/v/u/c/i:SI (lo_sum:DI (reg/f:DI 84)
(symbol_ref:DI ("g_361") [flags 0x6] <var_decl
0x7f9d4c1905a0 g_361>)) [3 g_361+0 S4 A32])) 241 {*movsi}
(expr_list:REG_DEAD (reg/f:DI 74)
(expr_list:REG_UNUSED (reg:SI 75 [ g_361 ])
(expr_list:REG_EQUAL (mem/v/u/c/i:SI (symbol_ref:DI
("g_361") [flags 0x6] <var_decl 0x7f9d4c1905a0 g_361>) [3 g_361+0 S4 A32])
(nil)))))
(insn 14 11 15 3 pr35729.c:8 (set (reg:SI 77 [ g_2 ])
(mem/v/c/i:SI (lo_sum:DI (reg/f:DI 83)
(symbol_ref:DI ("g_2") [flags 0x6] <var_decl
0x7f9d4c190640 g_2>)) [3 g_2+0 S4 A32])) 241 {*movsi}
(expr_list:REG_EQUAL (mem/v/c/i:SI (symbol_ref:DI ("g_2") [flags 0x6]
<var_decl 0x7f9d4c190640 g_2>) [3 g_2+0 S4 A32])
(nil)))
...
So, HIGH parts are always invariant, and they don't access volatile
memory. They are correctly moved out the loop.
I agree with Richard, that this test should not be removed, but should
instead be run only on targets that do not have split addressing. x86 is
one of these targets, but there are others.
Uros.