[PATCH] Fix PR37053: Move tweaks of commutative precedence to target hook

Maxim Kuvyrkov maxim@codesourcery.com
Tue Jul 14 14:39:00 GMT 2009


Paolo Bonzini wrote:
> On 07/10/2009 03:14 PM, Peter Bergner wrote:
>> On Fri, 2009-07-10 at 00:58 +0200, Paolo Bonzini wrote:
>>> Note that it is already being done if reload_completed, just not if
>>> reload_in_progress.  No matter how pleasant, it would be a surprise if
>>> the attached patch worked without this change it includes:
>>>
>>> -      if (! constrain_operands (1))
>>> +      if (! constrain_operands (reload_completed))
>>>
>>> (Note: I haven't tested it with the change, either).  On the other hand,
>>> with the change there is a subtle difference in reload_as_needed now
>>> (I'm not sure it matters).
>>>
>>> Maxim, can you try it on m68k?
>>
>> FYI, this bootstrapped and regtested with no errors on powerpc64-linux.
> 
> [patch at http://permalink.gmane.org/gmane.comp.gcc.patches/189115]
> 
> It also fixes the testcase.  Ok for mainline and branches?

Sorry it took me so long to reply.

The above patch doesn't fix the ICE on m68k.  Compiling the preprocessed 
testcase in PR37053 yields:

./cc1 -fpic -O1 /tmp/postreload.c -o /tmp/postreload.s -m68020

...

postreload.c: In function 'do_termsform':
postreload.c:886:1: error: insn does not satisfy its constraints:
(insn 480 3109 3111 34 postreload.c:446 (set (reg:SI 0 %d0)
         (plus:SI (mem/f:SI (post_inc:SI (reg:SI 8 %a0)) [0 S4 A16])
             (reg:SI 0 %d0))) 140 {*addsi3_internal} (expr_list:REG_INC 
(reg:SI 8 %a0)
         (nil)))
postreload.c:886:1: internal compiler error: in 
reload_cse_simplify_operands, at postreload.c:396

Note that -m68020 option is necessary to trigger the bug.

--
Maxim



More information about the Gcc-patches mailing list