This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rtl-optimization]: Fix PR 37544


On Wed, Sep 17, 2008 at 9:13 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:

>> As described in the PR audit trail, the problem lies in cprop_hardreg pass
>> that shortcuts through the sequence of DImode->SImode->DImode conversions by
>> omitting SImode intermediate result.
>>
>> The core of the problem is in maybe_mode_change function in regrename.c that
>> permits mode change for
>> orig_mode = DImode
>> copy_mode = SImode
>> new_mode = DImode.
>>
>> Attached patch simply prevents mode change when copy mode is narrower than
>> new_mode.
>
> Shouldn't it be when orig_mode is wider than copy_mode in addition?
> QImode -> SImode ->DImode
> should be ok, as would SImode -> DImode -> QImode or QImode ->SImode -> HImode.
>
> Ok with that change.

I have committed attached patch after re-testing the change on
i686-pc-linux-gnu. I will backport the same patch to gcc-4.3 and
gcc-4.2 after some days.

2008-09-17  Uros Bizjak  <ubizjak@gmail.com>

       PR rtl-optimization/37544
       * regrename.c (maybe_mode_change): Exit early when copy_mode
       is narrower than orig_mode and narrower than new_mode.

testsuite/ChangeLog:

2008-09-17  Uros Bizjak  <ubizjak@gmail.com>

       PR rtl-optimization/37544
       * gcc.dg/pr37544.c: New test.

Thanks,
Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]